diff --git a/.editorconfig b/.editorconfig
index 40381bd6a77..f00ed01c2e3 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,6 +11,6 @@ trim_trailing_whitespace = true
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
-[{.travis.yml,npm-shrinkwrap.json,package.json}]
+[{*.yml,*.yaml,npm-shrinkwrap.json,package.json}]
indent_style = space
indent_size = 2
diff --git a/.github/classifier.yml b/.github/classifier.yml
index b3199eb0752..50c280cf4bf 100644
--- a/.github/classifier.yml
+++ b/.github/classifier.yml
@@ -6,40 +6,40 @@
accessibility: [],
api: [],
css-less-sass: [],
- debug: [ isidorn ],
- editor: [ alexandrudima ],
+ debug: [ weinand ],
+ editor: [],
editor-brackets: [],
- editor-clipboard: [ rebornix ],
+ editor-clipboard: [],
editor-colors: [],
- editor-contrib: [ rebornix ],
+ editor-contrib: [],
editor-core: [],
- editor-find-widget: [ rebornix ],
+ editor-find-widget: [],
editor-folding: [],
- editor-ime: [ rebornix ],
- editor-indentation: [ rebornix ],
+ editor-ime: [],
+ editor-indentation: [],
editor-input: [],
editor-minimap: [],
editor-multicursor: [],
editor-wrapping: [],
emmet: [ ramya-rao-a ],
error-list: [],
- extensions: [],
git: [ joaomoreno ],
hot-exit: [ Tyriar ],
- html: [],
+ html: [ aeschli ],
i18n: [],
install-update: [],
integrated-terminal: [ Tyriar ],
javascript: [ mjbvz ],
json: [],
languages basic: [],
- markdown: [],
+ markdown: [ mjbvz ],
+ merge-conflict: [ chrmarti ],
perf-profile: [],
php: [ roblourens ],
search: [ roblourens ],
snippets: [ jrieken ],
- tasks: [],
+ tasks: [ dbaeumer ],
typescript: [ mjbvz ],
- workbench: [],
+ workbench: [ bpasero, isidorn, sandy081]
}
}
diff --git a/.github/new_release.yml b/.github/new_release.yml
index 790633b1f1f..e54d1a8aba0 100644
--- a/.github/new_release.yml
+++ b/.github/new_release.yml
@@ -1,5 +1,5 @@
{
newReleaseLabel: 'new release',
- newReleases: ['1.15'],
- perform: true
+ newReleases: ['1.17.2'],
+ perform: false
}
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index b552f3ee567..70cdee4c6f0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,8 +5,14 @@ os:
- linux
- osx
+cache:
+ directories:
+ - $HOME/.npm
+
notifications:
email: false
+ webhooks:
+ - http://vscode-test-probot.westus.cloudapp.azure.com:3450/travis/notifications
addons:
apt:
@@ -27,24 +33,26 @@ before_install:
- git submodule update --init --recursive
- git clone --depth 1 https://github.com/creationix/nvm.git ./.nvm
- source ./.nvm/nvm.sh
- - nvm install 7.4.0
- - nvm use 7.4.0
+ - nvm install 7.9.0
+ - nvm use 7.9.0
- npm config set python `which python`
- - npm install -g gulp
- if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
+ # Make npm logs less verbose
+ - npm config set depth 0
+ - npm config set loglevel warn
install:
- ./scripts/npm.sh install
script:
- - gulp hygiene --silent
- - gulp electron --silent
- - gulp compile --silent --max_old_space_size=4096
- - gulp optimize-vscode --silent --max_old_space_size=4096
+ - node_modules/.bin/gulp hygiene
+ - node_modules/.bin/gulp electron --silent
+ - node_modules/.bin/gulp compile --silent --max_old_space_size=4096
+ - node_modules/.bin/gulp optimize-vscode --silent --max_old_space_size=4096
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
- ./scripts/test-integration.sh
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 5665ba67416..efe1edad82e 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -6,12 +6,12 @@
"type": "node",
"request": "launch",
"name": "Gulp Build",
- "program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
+ "program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"stopOnEntry": true,
"args": [
"watch-extension:json-client"
],
- "cwd": "${workspaceRoot}"
+ "cwd": "${workspaceFolder}"
},
{
"type": "node",
@@ -21,7 +21,7 @@
"port": 5870,
"restart": true,
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -31,7 +31,7 @@
"protocol": "inspector",
"port": 5871,
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -41,7 +41,7 @@
"name": "Attach to Search Process",
"port": 5876,
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -51,7 +51,7 @@
"protocol": "inspector",
"port": 5874,
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -61,7 +61,7 @@
"protocol": "inspector",
"port": 5875,
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -70,12 +70,12 @@
"name": "VS Code Emmet Tests",
"runtimeExecutable": "${execPath}",
"args": [
- "${workspaceRoot}/extensions/emmet/test-fixtures",
- "--extensionDevelopmentPath=${workspaceRoot}/extensions/emmet",
- "--extensionTestsPath=${workspaceRoot}/extensions/emmet/out/test"
+ "${workspaceFolder}/extensions/emmet/test-fixtures",
+ "--extensionDevelopmentPath=${workspaceFolder}/extensions/emmet",
+ "--extensionTestsPath=${workspaceFolder}/extensions/emmet/out/test"
],
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -84,12 +84,12 @@
"name": "VS Code API Tests",
"runtimeExecutable": "${execPath}",
"args": [
- "${workspaceRoot}/extensions/vscode-api-tests/testWorkspace",
- "--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-api-tests",
- "--extensionTestsPath=${workspaceRoot}/extensions/vscode-api-tests/out"
+ "${workspaceFolder}/extensions/vscode-api-tests/testWorkspace",
+ "--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode-api-tests",
+ "--extensionTestsPath=${workspaceFolder}/extensions/vscode-api-tests/out"
],
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -98,12 +98,12 @@
"name": "VS Code Tokenizer Tests",
"runtimeExecutable": "${execPath}",
"args": [
- "${workspaceRoot}/extensions/vscode-colorize-tests/test",
- "--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-colorize-tests",
- "--extensionTestsPath=${workspaceRoot}/extensions/vscode-colorize-tests/out"
+ "${workspaceFolder}/extensions/vscode-colorize-tests/test",
+ "--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode-colorize-tests",
+ "--extensionTestsPath=${workspaceFolder}/extensions/vscode-colorize-tests/out"
],
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
@@ -117,30 +117,30 @@
"request": "launch",
"name": "Launch VS Code",
"windows": {
- "runtimeExecutable": "${workspaceRoot}/scripts/code.bat"
+ "runtimeExecutable": "${workspaceFolder}/scripts/code.bat"
},
"osx": {
- "runtimeExecutable": "${workspaceRoot}/scripts/code.sh"
+ "runtimeExecutable": "${workspaceFolder}/scripts/code.sh"
},
"linux": {
- "runtimeExecutable": "${workspaceRoot}/scripts/code.sh"
+ "runtimeExecutable": "${workspaceFolder}/scripts/code.sh"
},
"urlFilter": "*index.html*",
"runtimeArgs": [
"--inspect=5875"
],
- "webRoot": "${workspaceRoot}"
+ "webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Git Unit Tests",
"protocol": "inspector",
- "program": "${workspaceRoot}/extensions/git/node_modules/mocha/bin/_mocha",
+ "program": "${workspaceFolder}/extensions/git/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
- "cwd": "${workspaceRoot}/extensions/git",
+ "cwd": "${workspaceFolder}/extensions/git",
"outFiles": [
- "${workspaceRoot}/extensions/git/out/**/*.js"
+ "${workspaceFolder}/extensions/git/out/**/*.js"
]
},
{
@@ -148,38 +148,38 @@
"request": "launch",
"name": "Unit Tests",
"protocol": "inspector",
- "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
- "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
+ "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
+ "runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
"windows": {
- "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.exe"
+ "runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.exe"
},
"linux": {
- "runtimeExecutable": "${workspaceRoot}/.build/electron/code-oss"
+ "runtimeExecutable": "${workspaceFolder}/.build/electron/code-oss"
},
"stopOnEntry": false,
"args": [
"--timeout",
"2000"
],
- "cwd": "${workspaceRoot}",
+ "cwd": "${workspaceFolder}",
"env": {
"ELECTRON_RUN_AS_NODE": "true"
},
"outFiles": [
- "${workspaceRoot}/out/**/*.js"
+ "${workspaceFolder}/out/**/*.js"
]
},
{
"type": "node",
"request": "launch",
"name": "Launch Smoke Test",
- "program": "${workspaceRoot}/test/smoke/out/main.js",
- "cwd": "${workspaceRoot}/test/smoke",
+ "program": "${workspaceFolder}/test/smoke/out/main.js",
+ "cwd": "${workspaceFolder}/test/smoke",
"timeout": 240000,
"port": 9999,
"args": [
"-l",
- "${workspaceRoot}/.build/electron/Code - OSS.app/Contents/MacOS/Electron"
+ "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron"
],
"outFiles": [
"${cwd}/out/**/*.js"
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 39adc0e7f24..0d85ac560db 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -14,7 +14,9 @@
"**/node_modules": true,
"**/bower_components": true,
".build/**": true,
- "out*/**": true,
+ "out/**": true,
+ "out-build/**": true,
+ "out-vscode/**": true,
"i18n/**": true,
"extensions/**/out/**": true,
"test/smoke/out/**": true
@@ -27,9 +29,9 @@
"lcov.watch": [
{
"pattern": "**/*.test.js",
- "command": "${workspaceRoot}/scripts/test.sh --coverage --run ${file}",
+ "command": "${workspaceFolder}/scripts/test.sh --coverage --run ${file}",
"windows": {
- "command": "${workspaceRoot}\\scripts\\test.bat --coverage --run ${file}"
+ "command": "${workspaceFolder}\\scripts\\test.bat --coverage --run ${file}"
}
}
]
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 45d4995aa65..2239597b1f3 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -33,11 +33,11 @@
"task": "tslint",
"label": "Run tslint",
"problemMatcher": [
- "$tslint4"
+ "$tslint5"
]
},
{
- "taskName": "Run tests",
+ "label": "Run tests",
"type": "shell",
"command": "./scripts/test.sh",
"windows": {
@@ -50,7 +50,7 @@
}
},
{
- "taskName": "Run Dev",
+ "label": "Run Dev",
"type": "shell",
"command": "./scripts/code.sh",
"windows": {
diff --git a/README.md b/README.md
index 670195c3c92..5ea45fe3c75 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
a code editor with what developers need for their core edit-build-debug cycle. Code
provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools.
-VS Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [VS Code's website](https://code.visualstudio.com/Download). To get the latest releases everyday, you can install the [Insiders version of VS Code](https://code.visualstudio.com/insiders). This builds from the master branch and is updated at least daily.
+VS Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [VS Code's website](https://code.visualstudio.com/Download). To get the latest releases every day, you can install the [Insiders version of VS Code](https://code.visualstudio.com/insiders). This builds from the master branch and is updated at least daily.
@@ -30,6 +30,7 @@ please see the document [How to Contribute](https://github.com/Microsoft/vscode/
* [The development workflow, including debugging and running tests](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#development-workflow)
* [Coding Guidelines](https://github.com/Microsoft/vscode/wiki/Coding-Guidelines)
* [Submitting pull requests](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#pull-requests)
+* [Contributing to translations](https://aka.ms/vscodeloc)
Please see also our [Code of Conduct](CODE_OF_CONDUCT.md).
diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt
index f34e2aaf808..4a73d4a61eb 100644
--- a/ThirdPartyNotices.txt
+++ b/ThirdPartyNotices.txt
@@ -26,42 +26,41 @@ This project incorporates components from the projects listed below. The origina
19. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle)
20. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift)
21. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/)
-22. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site)
-23. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar)
-24. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
-25. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
-26. language-docker (https://github.com/moby/moby)
-27. language-go version 0.39.0 (https://github.com/atom/language-go)
-28. language-less (https://github.com/atom/language-less)
-29. language-php (https://github.com/atom/language-php)
-30. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust)
-31. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython)
-32. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage)
-33. octicons-code version 3.1.0 (https://octicons.github.com)
-34. octicons-font version 3.1.0 (https://octicons.github.com)
-35. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
-36. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
-37. string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
-38. sublimehq/Packages (https://github.com/sublimehq/Packages)
-39. SublimeText/PowerShell (https://github.com/SublimeText/PowerShell)
-40. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
-41. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
-42. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
-43. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
-44. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
-45. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
-46. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
-47. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
-48. textmate/lua.tmbundle (https://github.com/textmate/lua.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)
+22. Ikuyadeu/vscode-R (https://github.com/Ikuyadeu/vscode-R)
+23. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site)
+24. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar)
+25. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
+26. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
+27. language-docker (https://github.com/moby/moby)
+28. language-go version 0.39.0 (https://github.com/atom/language-go)
+29. language-less (https://github.com/atom/language-less)
+30. language-php (https://github.com/atom/language-php)
+31. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust)
+32. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython)
+33. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage)
+34. Microsoft/vscode-mssql (https://github.com/Microsoft/vscode-mssql)
+35. octicons-code version 3.1.0 (https://octicons.github.com)
+36. octicons-font version 3.1.0 (https://octicons.github.com)
+37. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
+38. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
+39. sublimehq/Packages (https://github.com/sublimehq/Packages)
+40. SublimeText/PowerShell (https://github.com/SublimeText/PowerShell)
+41. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
+42. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
+43. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
+44. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
+45. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
+46. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
+47. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
+48. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
+49. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
+50. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
+51. textmate/perl.tmbundle (https://github.com/textmate/perl.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-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
-57. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
+54. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
+55. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
+56. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
%% atom/language-c NOTICES AND INFORMATION BEGIN HERE
@@ -694,6 +693,32 @@ without specific, written prior permission. Title to copyright in this document
=========================================
END OF HTML 5.1 W3C Working Draft NOTICES AND INFORMATION
+%% Ikuyadeu/vscode-R NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2017 Yuki Ueda
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF Ikuyadeu/vscode-R NOTICES AND INFORMATION
+
%% Ionic documentation NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright Drifty Co. http://drifty.com/.
@@ -1238,187 +1263,46 @@ END OF MagicStack/MagicPython NOTICES AND INFORMATION
%% Microsoft/TypeScript-TmLanguage NOTICES AND INFORMATION BEGIN HERE
=========================================
-Copyright (c) Microsoft Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation
+All rights reserved.
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
+MIT License
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+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:
- 1. Definitions.
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
- "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:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) 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
-
- (d) 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
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
=========================================
END OF Microsoft/TypeScript-TmLanguage NOTICES AND INFORMATION
+%% Microsoft/vscode-mssql NOTICES AND INFORMATION BEGIN HERE
+=========================================
+------------------------------------------ START OF LICENSE -----------------------------------------
+vscode-mssql
+Copyright (c) Microsoft Corporation
+All rights reserved.
+MIT License
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+Copyright (c) 2016 Sanjay Nagamangalam
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+----------------------------------------------- END OF LICENSE ------------------------------------------
+=========================================
+END OF Microsoft/vscode-mssql NOTICES AND INFORMATION
+
%% octicons-code NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
@@ -1587,31 +1471,6 @@ SOFTWARE.
=========================================
END OF shaders-tmLanguage NOTICES AND INFORMATION
-%% string_scorer NOTICES AND INFORMATION BEGIN HERE
-=========================================
-This software is released under the MIT license:
-
-Copyright (c) Joshaven Potter
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-=========================================
-END OF string_scorer NOTICES AND INFORMATION
-
%% sublimehq/Packages NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) Sublime Packages project authors
@@ -1851,19 +1710,6 @@ to the base-name name of the original file, and an extension of txt, html, or si
=========================================
END OF textmate/perl.tmbundle NOTICES AND INFORMATION
-%% textmate/r.tmbundle NOTICES AND INFORMATION BEGIN HERE
-=========================================
-Copyright (c) textmate-r.tmbundle project authors
-
-If not otherwise specified (see below), files in this folder 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.
-=========================================
-END OF textmate/r.tmbundle NOTICES AND INFORMATION
-
%% textmate/ruby.tmbundle NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) textmate-ruby.tmbundle project authors
@@ -1900,24 +1746,6 @@ to the base-name name of the original file, and an extension of txt, html, or si
=========================================
END OF textmate/shellscript.tmbundle NOTICES AND INFORMATION
-%% textmate/sql.tmbundle NOTICES AND INFORMATION BEGIN HERE
-=========================================
-Copyright (c) textmate-sql.tmbundle project authors
-
-If not otherwise specified (see below), files in this folder 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/sql.tmbundle NOTICES AND INFORMATION
-
%% textmate/yaml.tmbundle NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2015 FichteFoll
@@ -1943,184 +1771,28 @@ END OF textmate/yaml.tmbundle NOTICES AND INFORMATION
%% TypeScript-TmLanguage NOTICES AND INFORMATION BEGIN HERE
=========================================
-Copyright (c) Microsoft Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation
+All rights reserved.
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
+MIT License
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+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:
- 1. Definitions.
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
- "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:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) 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
-
- (d) 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
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
=========================================
END OF TypeScript-TmLanguage NOTICES AND INFORMATION
diff --git a/appveyor.yml b/appveyor.yml
index 49e80fed313..5c5c23c776a 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,14 +2,16 @@ environment:
ELECTRON_RUN_AS_NODE: 1
VSCODE_BUILD_VERBOSE: true
+cache:
+ - '%APPDATA%\npm-cache'
+
install:
- - ps: Install-Product node 7.4.0 x64
+ - ps: Install-Product node 7.9.0 x64
- npm install -g npm@4 --silent
- - npm install -g gulp mocha --silent
build_script:
- .\scripts\npm.bat install
- - gulp electron
+ - .\node_modules\.bin\gulp electron
- npm run compile
test_script:
diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js
index 97b1ab8367e..056dc86065e 100644
--- a/build/gulpfile.hygiene.js
+++ b/build/gulpfile.hygiene.js
@@ -12,6 +12,7 @@ const gulptslint = require('gulp-tslint');
const gulpeslint = require('gulp-eslint');
const tsfmt = require('typescript-formatter');
const tslint = require('tslint');
+const vfs = require('vinyl-fs');
/**
* Hygiene works by creating cascading subsets of all our files and
@@ -54,6 +55,7 @@ const indentationFilter = [
'!**/*.md',
'!**/*.ps1',
'!**/*.template',
+ '!**/*.yaml',
'!**/*.yml',
'!**/lib/**',
'!extensions/**/*.d.ts',
@@ -93,6 +95,7 @@ const copyrightFilter = [
'!**/*.opts',
'!**/*.disabled',
'!build/**/*.init',
+ '!resources/linux/snap/snapcraft.yaml',
'!resources/win32/bin/code.js',
'!extensions/markdown/media/tomorrow.css',
'!extensions/html/server/src/modes/typescript/*'
@@ -120,7 +123,8 @@ const tslintFilter = [
'!**/node_modules/**',
'!extensions/typescript/test/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**',
- '!extensions/**/*.test.ts'
+ '!extensions/**/*.test.ts',
+ '!extensions/html/server/lib/jquery.d.ts'
];
const copyrightHeader = [
@@ -130,19 +134,8 @@ const copyrightHeader = [
' *--------------------------------------------------------------------------------------------*/'
].join('\n');
-function reportFailures(failures) {
- failures.forEach(failure => {
- const name = failure.name || failure.fileName;
- const position = failure.startPosition;
- const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line;
- const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character;
-
- console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`);
- });
-}
-
gulp.task('eslint', () => {
- return gulp.src(all, { base: '.' })
+ return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(eslintFilter))
.pipe(gulpeslint('src/.eslintrc'))
.pipe(gulpeslint.formatEach('compact'))
@@ -150,12 +143,12 @@ gulp.task('eslint', () => {
});
gulp.task('tslint', () => {
- const options = { summarizeFailureOutput: true };
+ const options = { emitError: false };
- return gulp.src(all, { base: '.' })
+ return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintFilter))
.pipe(gulptslint({ rulesDirectory: 'build/lib/tslint' }))
- .pipe(gulptslint.report(reportFailures, options));
+ .pipe(gulptslint.report(options));
});
const hygiene = exports.hygiene = (some, options) => {
@@ -216,6 +209,17 @@ const hygiene = exports.hygiene = (some, options) => {
cb(err);
});
});
+
+ function reportFailures(failures) {
+ failures.forEach(failure => {
+ const name = failure.name || failure.fileName;
+ const position = failure.startPosition;
+ const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line;
+ const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character;
+
+ console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`);
+ });
+ }
const tsl = es.through(function (file) {
const configuration = tslint.Configuration.findConfiguration(null, '.');
@@ -233,7 +237,7 @@ const hygiene = exports.hygiene = (some, options) => {
this.emit('data', file);
});
- const result = gulp.src(some || all, { base: '.' })
+ const result = vfs.src(some || all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(f => !f.stat.isDirectory()))
.pipe(filter(eolFilter))
.pipe(options.skipEOL ? es.through() : eol)
@@ -253,8 +257,16 @@ const hygiene = exports.hygiene = (some, options) => {
.pipe(gulpeslint.formatEach('compact'))
.pipe(gulpeslint.failAfterError());
+ let count = 0;
return es.merge(typescript, javascript)
- .pipe(es.through(null, function () {
+ .pipe(es.through(function (data) {
+ count++;
+ if (count % 10 === 0) {
+ process.stdout.write('.');
+ }
+ this.emit('data', data);
+ }, function () {
+ process.stdout.write('\n');
if (errorCount > 0) {
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
} else {
@@ -263,7 +275,7 @@ const hygiene = exports.hygiene = (some, options) => {
}));
};
-gulp.task('hygiene', () => hygiene());
+gulp.task('hygiene', () => hygiene(''));
// this allows us to run hygiene as a git pre-commit hook
if (require.main === module) {
@@ -296,11 +308,13 @@ if (require.main === module) {
.split(/\r?\n/)
.filter(l => !!l);
- hygiene(some, { skipEOL: skipEOL }).on('error', err => {
- console.error();
- console.error(err);
- process.exit(1);
- });
+ if (some.length > 0) {
+ hygiene(some, { skipEOL: skipEOL }).on('error', err => {
+ console.error();
+ console.error(err);
+ process.exit(1);
+ });
+ }
});
});
}
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index ff6bb258b62..bb04933439a 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -7,6 +7,8 @@
const gulp = require('gulp');
const fs = require('fs');
+const os = require('os');
+const cp = require('child_process');
const path = require('path');
const es = require('event-stream');
const azure = require('gulp-azure-storage');
@@ -43,8 +45,8 @@ const nodeModules = ['electron', 'original-fs']
// Build
const builtInExtensions = [
- { name: 'ms-vscode.node-debug', version: '1.17.0' },
- { name: 'ms-vscode.node-debug2', version: '1.17.0' }
+ { name: 'ms-vscode.node-debug', version: '1.18.3' },
+ { name: 'ms-vscode.node-debug2', version: '1.18.4' }
];
const excludedExtensions = [
@@ -66,7 +68,7 @@ const vscodeResources = [
'out-build/bootstrap-amd.js',
'out-build/paths.js',
'out-build/vs/**/*.{svg,png,cur,html}',
- 'out-build/vs/base/node/startupTimers.js',
+ 'out-build/vs/base/common/performance.js',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh}',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/workbench/browser/media/*-theme.css',
@@ -136,6 +138,7 @@ const config = {
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "code-workspace", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xcodeproj", "xcworkspace", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"],
+ utis: ['public.source-code'],
iconFile: 'resources/darwin/code_file.icns'
}],
darwinBundleURLTypes: [{
@@ -271,9 +274,10 @@ function packageTask(platform, arch, opts) {
const packageJsonStream = gulp.src(['package.json'], { base: '.' })
.pipe(json({ name, version }));
+ const settingsSearchBuildId = getBuildNumber();
const date = new Date().toISOString();
const productJsonStream = gulp.src(['product.json'], { base: '.' })
- .pipe(json({ commit, date, checksums }));
+ .pipe(json({ commit, date, checksums, settingsSearchBuildId }));
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
@@ -297,6 +301,7 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.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('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
.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']));
@@ -443,3 +448,136 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
prefix: commit + '/'
}));
});
+
+const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
+gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
+ const branch = process.env.BUILD_SOURCEBRANCH;
+ if (!branch.endsWith('/master') && !branch.startsWith('release/')) {
+ console.log(`Only runs on master and release branches, not ${branch}`);
+ return;
+ }
+
+ if (!fs.existsSync(allConfigDetailsPath)) {
+ console.error(`configuration file at ${allConfigDetailsPath} does not exist`);
+ return;
+ }
+
+ const settingsSearchBuildId = getBuildNumber();
+ if (!settingsSearchBuildId) {
+ console.error('Failed to compute build number');
+ return;
+ }
+
+ return gulp.src(allConfigDetailsPath)
+ .pipe(azure.upload({
+ account: process.env.AZURE_STORAGE_ACCOUNT,
+ key: process.env.AZURE_STORAGE_ACCESS_KEY,
+ container: 'configuration',
+ prefix: `${settingsSearchBuildId}/${commit}/`
+ }));
+});
+
+function getBuildNumber() {
+ const previous = getPreviousVersion(packageJson.version);
+ if (!previous) {
+ return 0;
+ }
+
+ try {
+ const out = cp.execSync(`git rev-list ${previous}..HEAD --count`);
+ const count = parseInt(out.toString());
+ return versionStringToNumber(packageJson.version) * 1e4 + count;
+ } catch (e) {
+ console.error('Could not determine build number: ' + e.toString());
+ return 0;
+ }
+}
+
+/**
+ * Given 1.17.2, return 1.17.1
+ * 1.18.0 => 1.17.2.
+ * 2.0.0 => 1.18.0 (or the highest 1.x)
+ */
+function getPreviousVersion(versionStr) {
+ function tagExists(tagName) {
+ try {
+ cp.execSync(`git rev-parse ${tagName}`, { stdio: 'ignore' });
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+
+ function getLastTagFromBase(semverArr, componentToTest) {
+ const baseVersion = semverArr.join('.');
+ if (!tagExists(baseVersion)) {
+ console.error('Failed to find tag for base version, ' + baseVersion);
+ return null;
+ }
+
+ let goodTag;
+ do {
+ goodTag = semverArr.join('.');
+ semverArr[componentToTest]++;
+ } while (tagExists(semverArr.join('.')));
+
+ return goodTag;
+ }
+
+ const semverArr = versionStr.split('.');
+ if (semverArr[2] > 0) {
+ semverArr[2]--;
+ return semverArr.join('.');
+ } else if (semverArr[1] > 0) {
+ semverArr[1]--;
+ return getLastTagFromBase(semverArr, 2);
+ } else {
+ semverArr[0]--;
+ return getLastTagFromBase(semverArr, 1);
+ }
+}
+
+function versionStringToNumber(versionStr) {
+ const semverRegex = /(\d+)\.(\d+)\.(\d+)/;
+ const match = versionStr.match(semverRegex);
+ if (!match) {
+ return 0;
+ }
+
+ return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
+}
+
+gulp.task('generate-vscode-configuration', () => {
+ return new Promise((resolve, reject) => {
+ const buildDir = process.env['AGENT_BUILDDIRECTORY'];
+ if (!buildDir) {
+ return reject(new Error('$AGENT_BUILDDIRECTORY not set'));
+ }
+
+ const userDataDir = path.join(os.tmpdir(), 'tmpuserdata');
+ const extensionsDir = path.join(os.tmpdir(), 'tmpextdir');
+ const appPath = path.join(buildDir, 'VSCode-darwin/Visual\\ Studio\\ Code\\ -\\ Insiders.app/Contents/Resources/app/bin/code');
+ const codeProc = cp.exec(`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`);
+
+ const timer = setTimeout(() => {
+ codeProc.kill();
+ reject(new Error('export-default-configuration process timed out'));
+ }, 10 * 1000);
+
+ codeProc.stdout.on('data', d => console.log(d.toString()));
+ codeProc.stderr.on('data', d => console.log(d.toString()));
+
+ codeProc.on('exit', () => {
+ clearTimeout(timer);
+ resolve();
+ });
+
+ codeProc.on('error', err => {
+ clearTimeout(timer);
+ reject(err);
+ });
+ }).catch(e => {
+ // Don't fail the build
+ console.error(e.toString());
+ });
+});
diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
index 54c73a538c2..ee92561849e 100644
--- a/build/gulpfile.vscode.linux.js
+++ b/build/gulpfile.vscode.linux.js
@@ -55,6 +55,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
+ .pipe(replace('@@ICON@@', product.applicationName))
.pipe(rename('usr/share/applications/' + product.applicationName + '.desktop'));
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
@@ -131,6 +132,7 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
+ .pipe(replace('@@ICON@@', product.applicationName))
.pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '.desktop'));
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
@@ -178,6 +180,50 @@ function buildRpmPackage(arch) {
'cp "' + rpmOut + '/$(ls ' + rpmOut + ')" ' + destination + '/'
]);
}
+function getSnapBuildPath(arch) {
+ return `.build/linux/snap/${arch}/${product.applicationName}-${arch}`;
+}
+
+function prepareSnapPackage(arch) {
+ const binaryDir = '../VSCode-linux-' + arch;
+ const destination = getSnapBuildPath(arch);
+
+ return function () {
+ const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
+ .pipe(replace('@@NAME_LONG@@', product.nameLong))
+ .pipe(replace('@@NAME_SHORT@@', product.nameShort))
+ .pipe(replace('@@NAME@@', product.applicationName))
+ .pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`))
+ .pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
+
+ const icon = gulp.src('resources/linux/code.png', { base: '.' })
+ .pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`));
+
+ const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
+ .pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
+
+ const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
+ .pipe(replace('@@NAME@@', product.applicationName))
+ .pipe(replace('@@VERSION@@', packageJson.version))
+ .pipe(rename('snap/snapcraft.yaml'));
+
+ const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
+ .pipe(rename('electron-launch'));
+
+ const all = es.merge(desktop, icon, code, snapcraft, electronLaunch);
+
+ return all.pipe(vfs.dest(destination));
+ };
+}
+
+function buildSnapPackage(arch) {
+ const snapBuildPath = getSnapBuildPath(arch);
+
+ return shell.task([
+ `chmod +x ${snapBuildPath}/electron-launch`,
+ `cd ${snapBuildPath} && snapcraft snap`
+ ]);
+}
function getFlatpakArch(arch) {
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch];
@@ -258,6 +304,12 @@ gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
+gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
+gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
+gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
+gulp.task('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386'));
+gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64'));
+gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm'));
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
@@ -273,14 +325,16 @@ gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buil
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
-gulp.task('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386'));
-gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64'));
-gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm'));
+gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
+gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
+gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
+gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
+gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
+gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
gulp.task('vscode-linux-ia32-prepare-flatpak', ['clean-vscode-linux-ia32-flatpak'], prepareFlatpak('ia32'));
gulp.task('vscode-linux-x64-prepare-flatpak', ['clean-vscode-linux-x64-flatpak'], prepareFlatpak('x64'));
gulp.task('vscode-linux-arm-prepare-flatpak', ['clean-vscode-linux-arm-flatpak'], prepareFlatpak('arm'));
-
gulp.task('vscode-linux-ia32-flatpak', ['vscode-linux-ia32-prepare-flatpak'], buildFlatpak('ia32'));
gulp.task('vscode-linux-x64-flatpak', ['vscode-linux-x64-prepare-flatpak'], buildFlatpak('x64'));
gulp.task('vscode-linux-arm-flatpak', ['vscode-linux-arm-prepare-flatpak'], buildFlatpak('arm'));
diff --git a/build/lib/i18n.resources.json b/build/lib/i18n.resources.json
index 393438d2bfd..0e4c15c7408 100644
--- a/build/lib/i18n.resources.json
+++ b/build/lib/i18n.resources.json
@@ -130,10 +130,6 @@
"name": "vs/workbench/parts/update",
"project": "vscode-workbench"
},
- {
- "name": "vs/workbench/parts/views",
- "project": "vscode-workbench"
- },
{
"name": "vs/workbench/parts/watermark",
"project": "vscode-workbench"
@@ -190,9 +186,17 @@
"name": "vs/workbench/services/textMate",
"project": "vscode-workbench"
},
+ {
+ "name": "vs/workbench/services/workspace",
+ "project": "vscode-workbench"
+ },
+ {
+ "name": "vs/workbench/services/decorations",
+ "project": "vscode-workbench"
+ },
{
"name": "setup_messages",
"project": "vscode-workbench"
}
]
-}
\ No newline at end of file
+}
diff --git a/build/lib/tslint/allowAsyncRule.js b/build/lib/tslint/allowAsyncRule.js
deleted file mode 100644
index a27d2870779..00000000000
--- a/build/lib/tslint/allowAsyncRule.js
+++ /dev/null
@@ -1,59 +0,0 @@
-"use strict";
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-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 ts = require("typescript");
-var Lint = require("tslint");
-var Rule = /** @class */ (function (_super) {
- __extends(Rule, _super);
- function Rule() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Rule.prototype.apply = function (sourceFile) {
- var allowed = this.getOptions().ruleArguments[0];
- return this.applyWithWalker(new AsyncRuleWalker(sourceFile, this.getOptions(), allowed));
- };
- return Rule;
-}(Lint.Rules.AbstractRule));
-exports.Rule = Rule;
-var AsyncRuleWalker = /** @class */ (function (_super) {
- __extends(AsyncRuleWalker, _super);
- function AsyncRuleWalker(file, opts, allowed) {
- var _this = _super.call(this, file, opts) || this;
- _this.allowed = allowed;
- return _this;
- }
- AsyncRuleWalker.prototype.visitMethodDeclaration = function (node) {
- this.visitFunctionLikeDeclaration(node);
- };
- AsyncRuleWalker.prototype.visitFunctionDeclaration = function (node) {
- this.visitFunctionLikeDeclaration(node);
- };
- AsyncRuleWalker.prototype.visitFunctionLikeDeclaration = function (node) {
- var _this = this;
- var flags = ts.getCombinedModifierFlags(node);
- if (!(flags & ts.ModifierFlags.Async)) {
- return;
- }
- var path = node.getSourceFile().path;
- var pathParts = path.split(/\\|\//);
- if (pathParts.some(function (part) { return _this.allowed.some(function (allowed) { return part === allowed; }); })) {
- return;
- }
- var message = "You are not allowed to use async function in this layer. Allowed layers are: [" + this.allowed + "]";
- this.addFailureAtNode(node, message);
- };
- return AsyncRuleWalker;
-}(Lint.RuleWalker));
diff --git a/build/lib/tslint/allowAsyncRule.ts b/build/lib/tslint/allowAsyncRule.ts
deleted file mode 100644
index e61765bf53d..00000000000
--- a/build/lib/tslint/allowAsyncRule.ts
+++ /dev/null
@@ -1,47 +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 ts from 'typescript';
-import * as Lint from 'tslint';
-
-export class Rule extends Lint.Rules.AbstractRule {
- public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
- const allowed = this.getOptions().ruleArguments[0] as string[];
- return this.applyWithWalker(new AsyncRuleWalker(sourceFile, this.getOptions(), allowed));
- }
-}
-
-class AsyncRuleWalker extends Lint.RuleWalker {
-
- constructor(file: ts.SourceFile, opts: Lint.IOptions, private allowed: string[]) {
- super(file, opts);
- }
-
- protected visitMethodDeclaration(node: ts.MethodDeclaration): void {
- this.visitFunctionLikeDeclaration(node);
- }
-
- protected visitFunctionDeclaration(node: ts.FunctionDeclaration): void {
- this.visitFunctionLikeDeclaration(node);
- }
-
- private visitFunctionLikeDeclaration(node: ts.FunctionLikeDeclaration) {
- const flags = ts.getCombinedModifierFlags(node);
-
- if (!(flags & ts.ModifierFlags.Async)) {
- return;
- }
-
- const path = (node.getSourceFile() as any).path;
- const pathParts = path.split(/\\|\//);
-
- if (pathParts.some(part => this.allowed.some(allowed => part === allowed))) {
- return;
- }
-
- const message = `You are not allowed to use async function in this layer. Allowed layers are: [${this.allowed}]`;
- this.addFailureAtNode(node, message);
- }
-}
diff --git a/build/lib/tslint/noUnexternalizedStringsRule.js b/build/lib/tslint/noUnexternalizedStringsRule.js
index d1d3c76b8ea..2925f0a0c63 100644
--- a/build/lib/tslint/noUnexternalizedStringsRule.js
+++ b/build/lib/tslint/noUnexternalizedStringsRule.js
@@ -88,10 +88,11 @@ var NoUnexternalizedStringsRuleWalker = /** @class */ (function (_super) {
var info = this.findDescribingParent(node);
// Ignore strings in import and export nodes.
if (info && info.isImport && doubleQuoted) {
- this.addFailureAtNode(node, NoUnexternalizedStringsRuleWalker.ImportFailureMessage, new Lint.Fix(NoUnexternalizedStringsRuleWalker.ImportFailureMessage, [
- this.createReplacement(node.getStart(), 1, '\''),
- this.createReplacement(node.getStart() + text.length - 1, 1, '\''),
- ]));
+ var fix = [
+ Lint.Replacement.replaceFromTo(node.getStart(), 1, '\''),
+ Lint.Replacement.replaceFromTo(node.getStart() + text.length - 1, 1, '\''),
+ ];
+ this.addFailureAtNode(node, NoUnexternalizedStringsRuleWalker.ImportFailureMessage, fix);
return;
}
var callInfo = info ? info.callInfo : null;
@@ -101,8 +102,9 @@ var NoUnexternalizedStringsRuleWalker = /** @class */ (function (_super) {
}
if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) {
var s = node.getText();
- var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")");
- var fix = new Lint.Fix('Unexternalitzed string', [replacement]);
+ var fix = [
+ Lint.Replacement.replaceFromTo(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")"),
+ ];
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix));
return;
}
diff --git a/build/lib/tslint/noUnexternalizedStringsRule.ts b/build/lib/tslint/noUnexternalizedStringsRule.ts
index 172db4d6b12..7b12df97596 100644
--- a/build/lib/tslint/noUnexternalizedStringsRule.ts
+++ b/build/lib/tslint/noUnexternalizedStringsRule.ts
@@ -104,13 +104,14 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
let info = this.findDescribingParent(node);
// Ignore strings in import and export nodes.
if (info && info.isImport && doubleQuoted) {
+ const fix = [
+ Lint.Replacement.replaceFromTo(node.getStart(), 1, '\''),
+ Lint.Replacement.replaceFromTo(node.getStart() + text.length - 1, 1, '\''),
+ ];
this.addFailureAtNode(
node,
NoUnexternalizedStringsRuleWalker.ImportFailureMessage,
- new Lint.Fix(NoUnexternalizedStringsRuleWalker.ImportFailureMessage, [
- this.createReplacement(node.getStart(), 1, '\''),
- this.createReplacement(node.getStart() + text.length - 1, 1, '\''),
- ])
+ fix
);
return;
}
@@ -122,8 +123,9 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) {
const s = node.getText();
- const replacement = new Lint.Replacement(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`);
- const fix = new Lint.Fix('Unexternalitzed string', [replacement]);
+ const fix = [
+ Lint.Replacement.replaceFromTo(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`),
+ ];
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Unexternalized string found: ${node.getText()}`, fix));
return;
}
diff --git a/build/lib/watch/index.js b/build/lib/watch/index.js
index bed579ec075..93d9babc2de 100644
--- a/build/lib/watch/index.js
+++ b/build/lib/watch/index.js
@@ -19,14 +19,15 @@ function handleDeletions() {
let watch = void 0;
-if (!process.env['VSCODE_USE_LEGACY_WATCH']) {
- try {
- watch = require('./watch-nsfw');
- } catch (err) {
- console.warn('Could not load our cross platform file watcher: ' + err.toString());
- console.warn('Falling back to our platform specific watcher...');
- }
-}
+// Disabled due to https://github.com/Microsoft/vscode/issues/36214
+// if (!process.env['VSCODE_USE_LEGACY_WATCH']) {
+// try {
+// watch = require('./watch-nsfw');
+// } catch (err) {
+// console.warn('Could not load our cross platform file watcher: ' + err.toString());
+// console.warn('Falling back to our platform specific watcher...');
+// }
+// }
if (!watch) {
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe
index cdaee801a9c..da006b6bce4 100644
--- a/build/monaco/monaco.d.ts.recipe
+++ b/build/monaco/monaco.d.ts.recipe
@@ -34,7 +34,7 @@ declare module monaco {
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, Promise
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
-#include(vs/base/common/uri): URI
+#include(vs/base/common/uri): URI, UriComponents
#include(vs/editor/common/standalone/standaloneBase): KeyCode, KeyMod
#include(vs/base/common/htmlContent): IMarkdownString
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
diff --git a/build/monaco/package.json b/build/monaco/package.json
index 4cc3beb09b8..e1a427322d0 100644
--- a/build/monaco/package.json
+++ b/build/monaco/package.json
@@ -13,10 +13,10 @@
"url": "https://github.com/Microsoft/vscode/issues"
},
"devDependencies": {
- "@types/minimist": "^1.2.0",
- "@types/mocha": "^2.2.39",
- "@types/semver": "^5.3.30",
- "@types/sinon": "^1.16.34",
+ "@types/minimist": "1.2.0",
+ "@types/mocha": "2.2.39",
+ "@types/semver": "5.3.30",
+ "@types/sinon": "1.16.34",
"debounce": "^1.0.0",
"eslint": "^3.4.0",
"event-stream": "^3.1.7",
@@ -48,7 +48,7 @@
"sinon": "^1.17.2",
"source-map": "^0.4.4",
"tslint": "^4.3.1",
- "typescript": "2.5.2",
+ "typescript": "2.6.1",
"typescript-formatter": "4.0.1",
"underscore": "^1.8.2",
"vinyl": "^0.4.5",
diff --git a/build/npm/update-all-grammars.js b/build/npm/update-all-grammars.js
index cfea912c3b1..9f85530caf5 100644
--- a/build/npm/update-all-grammars.js
+++ b/build/npm/update-all-grammars.js
@@ -54,7 +54,7 @@ const extensions = [
'scss',
'shaderlab',
'shellscript',
- // 'sql', customized, PRs pending
+ 'sql',
'swift',
'typescript',
'vb',
diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js
index fca60d83242..9d0cad11dc7 100644
--- a/build/npm/update-grammar.js
+++ b/build/npm/update-grammar.js
@@ -22,7 +22,7 @@ function getOptions(urlString) {
headers: {
'User-Agent': 'NodeJS'
}
- }
+ };
}
function download(url, redirectCount) {
@@ -100,7 +100,9 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
result.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha;
}
for (let key in grammar) {
- result[key] = grammar[key];
+ if (!result.hasOwnProperty(key)) {
+ result[key] = grammar[key];
+ }
}
try {
@@ -116,7 +118,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
});
}, console.error);
-}
+};
if (path.basename(process.argv[1]) === 'update-grammar.js') {
for (var i = 3; i < process.argv.length; i += 2) {
diff --git a/build/package.json b/build/package.json
index d94f9aad64a..9936a4ac9f1 100644
--- a/build/package.json
+++ b/build/package.json
@@ -2,18 +2,18 @@
"name": "code-oss-dev-build",
"version": "1.0.0",
"devDependencies": {
- "@types/azure": "^0.9.18",
- "@types/documentdb": "^1.10.1",
- "@types/es6-collections": "^0.5.30",
- "@types/es6-promise": "0.0.32",
+ "@types/azure": "0.9.19",
+ "@types/documentdb": "1.10.2",
+ "@types/es6-collections": "0.5.31",
+ "@types/es6-promise": "0.0.33",
"@types/mime": "0.0.29",
- "@types/node": "^7.0.13",
- "@types/xml2js": "^0.0.33",
+ "@types/node": "8.0.33",
+ "@types/xml2js": "0.0.33",
"azure-storage": "^2.1.0",
"documentdb": "^1.11.0",
"mime": "^1.3.4",
"minimist": "^1.2.0",
- "typescript": "2.5.2",
+ "typescript": "2.6.1",
"xml2js": "^0.4.17"
},
"scripts": {
diff --git a/build/tfs/common/enqueue.ts b/build/tfs/common/enqueue.ts
index 61e1171f2eb..f781737313f 100644
--- a/build/tfs/common/enqueue.ts
+++ b/build/tfs/common/enqueue.ts
@@ -52,20 +52,20 @@ function isBuildSigned(quality: string, commit: string): Promise {
});
}
-async function waitForSignedBuild(quality: string, commit: string): Promise {
- let retries = 0;
+// async function waitForSignedBuild(quality: string, commit: string): Promise {
+// let retries = 0;
- while (retries < 180) {
- if (await isBuildSigned(quality, commit)) {
- return;
- }
+// while (retries < 180) {
+// if (await isBuildSigned(quality, commit)) {
+// return;
+// }
- await new Promise(c => setTimeout(c, 10000));
- retries++;
- }
+// await new Promise(c => setTimeout(c, 10000));
+// retries++;
+// }
- throw new Error('Timed out waiting for signed build');
-}
+// throw new Error('Timed out waiting for signed build');
+// }
async function main(quality: string): Promise {
const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
@@ -73,10 +73,10 @@ async function main(quality: string): Promise {
console.log(`Queueing signing request for '${quality}/${commit}'...`);
await queueSigningRequest(quality, commit);
- console.log('Waiting on signed build...');
- await waitForSignedBuild(quality, commit);
+ // console.log('Waiting on signed build...');
+ // await waitForSignedBuild(quality, commit);
- console.log('Found signed build!');
+ // console.log('Found signed build!');
}
main(process.argv[2]).catch(err => {
diff --git a/build/tfs/common/publish.ts b/build/tfs/common/publish.ts
index d959159dc86..e4cbdc80f0e 100644
--- a/build/tfs/common/publish.ts
+++ b/build/tfs/common/publish.ts
@@ -68,6 +68,7 @@ interface Asset {
mooncakeUrl: string;
hash: string;
sha256hash: string;
+ size: number;
}
function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise {
@@ -156,7 +157,7 @@ async function publish(commit: string, quality: string, platform: string, type:
console.log('Publishing...');
console.log('Quality:', quality);
- console.log('Platforn:', platform);
+ console.log('Platform:', platform);
console.log('Type:', type);
console.log('Name:', name);
console.log('Version:', version);
@@ -165,6 +166,11 @@ async function publish(commit: string, quality: string, platform: string, type:
console.log('Is Released:', isReleased);
console.log('File:', file);
+ const stat = await new Promise((c, e) => fs.stat(file, (err, stat) => err ? e(err) : c(stat)));
+ const size = stat.size;
+
+ console.log('Size:', size);
+
const stream = fs.createReadStream(file);
const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]);
@@ -224,7 +230,8 @@ async function publish(commit: string, quality: string, platform: string, type:
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
mooncakeUrl: `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}`,
hash: sha1hash,
- sha256hash
+ sha256hash,
+ size
};
const release = {
diff --git a/build/tfs/darwin/build.sh b/build/tfs/darwin/build.sh
index acbb849d4b3..df7ee5e0b16 100755
--- a/build/tfs/darwin/build.sh
+++ b/build/tfs/darwin/build.sh
@@ -37,5 +37,19 @@ step "Run unit tests" \
step "Run integration tests" \
./scripts/test-integration.sh
+# function smoketest {
+# ARTIFACTS="$AGENT_BUILDDIRECTORY/smoketest-artifacts"
+# rm -rf $ARTIFACTS
+
+# [[ "$VSCODE_QUALITY" == "insider" ]] && VSCODE_APPNAME="Visual Studio Code - Insiders" || VSCODE_APPNAME="Visual Studio Code"
+# npm run smoketest -- --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/$VSCODE_APPNAME.app" --log $ARTIFACTS
+# }
+
+# step "Run smoke test" \
+# smoketest
+
step "Publish release" \
./build/tfs/darwin/release.sh
+
+step "Generate and upload configuration.json" \
+ npm run gulp -- upload-vscode-configuration
diff --git a/build/tfs/darwin/release.sh b/build/tfs/darwin/release.sh
index 24ed4c30a78..4dfecac7dd9 100755
--- a/build/tfs/darwin/release.sh
+++ b/build/tfs/darwin/release.sh
@@ -20,7 +20,7 @@ rm -rf $UNSIGNEDZIP
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
+ node build/tfs/common/publish.js $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
deleted file mode 100755
index 125201c12b5..00000000000
--- a/build/tfs/darwin/smoketest.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-. ./build/tfs/common/node.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 -- vscode-darwin-min
-
-step "Run smoke test" \
- pushd test/smoke
- npm install
- npm run smoketest -- --build "$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/.gitignore b/build/tfs/linux/.gitignore
index 0f46fa7086a..5ca5f22fc5a 100644
--- a/build/tfs/linux/.gitignore
+++ b/build/tfs/linux/.gitignore
@@ -1 +1,2 @@
-pat
\ No newline at end of file
+pat
+*.js
\ No newline at end of file
diff --git a/build/tfs/linux/build.sh b/build/tfs/linux/build.sh
index b3d1825c2d9..f138b5d237e 100755
--- a/build/tfs/linux/build.sh
+++ b/build/tfs/linux/build.sh
@@ -39,5 +39,22 @@ step "Build minified" \
step "Run unit tests" \
./scripts/test.sh --build --reporter dot
+# function smoketest {
+# id -u testuser &>/dev/null || (useradd -m testuser; chpasswd <<< testuser:testpassword)
+# sudo -i -u testuser -- sh -c 'git config --global user.name "VS Code Agent" && git config --global user.email "monacotools@microsoft.com"'
+
+# ARTIFACTS="$AGENT_BUILDDIRECTORY/smoketest-artifacts"
+# rm -rf $ARTIFACTS
+# mkdir -p $ARTIFACTS
+# chown -R testuser $ARTIFACTS
+
+# ps -o pid= -u testuser | xargs sudo kill -9
+# DISPLAY=:10 sudo -i -u testuser -- sh -c "cd $BUILD_SOURCESDIRECTORY/test/smoke && ./node_modules/.bin/mocha --build $AGENT_BUILDDIRECTORY/VSCode-linux-$ARCH --log $ARTIFACTS"
+# # DISPLAY=:10 sudo -i -u testuser -- sh -c "cd /vso/work/1/s/test/smoke && ./node_modules/.bin/mocha --build /vso/work/1/VSCode-linux-ia32"
+# }
+
+# step "Run smoke test" \
+# smoketest
+
step "Publish release" \
./build/tfs/linux/release.sh
diff --git a/build/tfs/linux/frozen-check.ts b/build/tfs/linux/frozen-check.ts
new file mode 100644
index 00000000000..489a24dc28a
--- /dev/null
+++ b/build/tfs/linux/frozen-check.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 { DocumentClient } from 'documentdb';
+
+interface Config {
+ id: string;
+ frozen: boolean;
+}
+
+function createDefaultConfig(quality: string): Config {
+ return {
+ id: quality,
+ frozen: false
+ };
+}
+
+function getConfig(quality: string): Promise {
+ const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
+ const collection = 'dbs/builds/colls/config';
+ const query = {
+ query: `SELECT TOP 1 * FROM c WHERE c.id = @quality`,
+ parameters: [
+ { name: '@quality', value: quality }
+ ]
+ };
+
+ return new Promise((c, e) => {
+ client.queryDocuments(collection, query).toArray((err, results) => {
+ if (err && err.code !== 409) { return e(err); }
+
+ c(!results || results.length === 0 ? createDefaultConfig(quality) : results[0] as any as Config);
+ });
+ });
+}
+
+getConfig(process.argv[2])
+ .then(c => console.log(c.frozen), e => console.error(e));
\ No newline at end of file
diff --git a/build/tfs/linux/ia32/Dockerfile b/build/tfs/linux/ia32/Dockerfile
index b309a1e940f..25d621d99fb 100644
--- a/build/tfs/linux/ia32/Dockerfile
+++ b/build/tfs/linux/ia32/Dockerfile
@@ -40,6 +40,9 @@ ADD xvfb.init /etc/init.d/xvfb
RUN chmod +x /etc/init.d/xvfb
RUN update-rc.d xvfb defaults
+# dbus
+RUN ln -sf /bin/dbus-daemon /usr/bin/dbus-daemon
+
# nvm
ENV NVM_DIR /usr/local/nvm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
@@ -47,4 +50,4 @@ RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | b
# for libsecret
ENV PKG_CONFIG_PATH /usr/lib/i386-linux-gnu/pkgconfig
-CMD (service xvfb start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
+CMD (service xvfb start; service dbus start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
diff --git a/build/tfs/linux/release.sh b/build/tfs/linux/release.sh
index 41f6d35e675..a89eb5cc41c 100755
--- a/build/tfs/linux/release.sh
+++ b/build/tfs/linux/release.sh
@@ -9,6 +9,9 @@ step "Build Debian package" \
step "Build RPM package" \
npm run gulp -- "vscode-linux-$ARCH-build-rpm"
+# step "Build snap package" \
+# npm run gulp -- "vscode-linux-$ARCH-build-snap"
+
(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \
step "Install build dependencies" \
npm install --unsafe-perm)
@@ -49,8 +52,15 @@ 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
+# SNAP_FILENAME="$(ls $REPO/.build/linux/snap/$ARCH/ | grep .snap)"
+# SNAP_PATH="$REPO/.build/linux/snap/$ARCH/$SNAP_FILENAME"
+
+IS_FROZEN="$(node build/tfs/linux/frozen-check.js $VSCODE_QUALITY)"
+
if [ -z "$VSCODE_QUALITY" ]; then
echo "VSCODE_QUALITY is not set, skipping repo package publish"
+elif [ "$IS_FROZEN" = "true" ]; then
+ echo "$VSCODE_QUALITY is frozen, 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
diff --git a/build/tfs/linux/repoapi_client.sh b/build/tfs/linux/repoapi_client.sh
index b214ef10726..3d98dd22d55 100755
--- a/build/tfs/linux/repoapi_client.sh
+++ b/build/tfs/linux/repoapi_client.sh
@@ -1,6 +1,6 @@
#!/bin/bash -e
# This is a VERY basic script for Create/Delete operations on repos and packages
-#
+#
cmd=$1
urls=urls.txt
defaultPackageFile=new_package.json
@@ -53,7 +53,7 @@ function ParseConfigFile {
fi
BailIfFileMissing "$configFile"
secretContents=$(cat "$configFile")
-
+
server=$(ParseFromJson .server)
protocol=$(ParseFromJson .protocol)
port=$(ParseFromJson .port)
@@ -135,14 +135,14 @@ function AddPackageByUrl
rm -f $tmpFile $tmpOut
Bail "File is not a valid deb/rpm package $url"
fi
-
+
rm -f $tmpFile $tmpOut
if [ -z "$pkgName" ]; then
Bail "Unable to parse package name for $url"
elif [ -z "$pkgVer" ]; then
Bail "Unable to parse package version number for $url"
fi
-
+
# Create Package .json file
escapedUrl=$(echo "$url" | sed 's/\//\\\//g' | sed 's/\&/\\\&/g')
cp $defaultPackageFile.template $defaultPackageFile
@@ -153,7 +153,7 @@ function AddPackageByUrl
# Perform Upload
AddPackage $defaultPackageFile
# Cleanup
- rm -f $defaultPackageFile
+ rm -f $defaultPackageFile
}
# Upload multiple packages by reading urls line-by-line from the specified file
diff --git a/build/tfs/linux/smoketest.sh b/build/tfs/linux/smoketest.sh
deleted file mode 100644
index b9f84c2a04a..00000000000
--- a/build/tfs/linux/smoketest.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-set -e
-
-. ./build/tfs/common/node.sh
-. ./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 -- "vscode-linux-$ARCH-min"
-
-function configureEnvironment {
- id -u testuser &>/dev/null || (useradd -m testuser; chpasswd <<< testuser:testpassword)
- sudo -i -u testuser git config --global user.name "VS Code Agent"
- sudo -i -u testuser git config --global user.email "monacotools@microsoft.com"
- chown -R testuser $AGENT_BUILDDIRECTORY
-}
-
-step "Configure environment" \
- configureEnvironment
-
-function runSmokeTest {
- cd test/smoke && sudo -u testuser ../../node_modules/.bin/mocha --build "$AGENT_BUILDDIRECTORY/VSCode-linux-ia32/code-insiders"
-}
-
-step "Run smoke test" \
- runSmokeTest
-
diff --git a/build/tfs/linux/x64/Dockerfile b/build/tfs/linux/x64/Dockerfile
index 4fef9acb19a..ae9190c29db 100644
--- a/build/tfs/linux/x64/Dockerfile
+++ b/build/tfs/linux/x64/Dockerfile
@@ -36,8 +36,11 @@ ADD xvfb.init /etc/init.d/xvfb
RUN chmod +x /etc/init.d/xvfb
RUN update-rc.d xvfb defaults
+# dbus
+RUN ln -sf /bin/dbus-daemon /usr/bin/dbus-daemon
+
# nvm
ENV NVM_DIR /usr/local/nvm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
-CMD (service xvfb start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
+CMD (service xvfb start; service dbus start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
diff --git a/build/tfs/win32/1_build.ps1 b/build/tfs/win32/1_build.ps1
index 0090920d506..c7fb712e18f 100644
--- a/build/tfs/win32/1_build.ps1
+++ b/build/tfs/win32/1_build.ps1
@@ -52,4 +52,11 @@ step "Run unit tests" {
# exec { & .\scripts\test-integration.bat }
# }
+# step "Run smoke test" {
+# $Artifacts = "$env:AGENT_BUILDDIRECTORY\smoketest-artifacts"
+# Remove-Item -Recurse -Force -ErrorAction Ignore $Artifacts
+
+# exec { & npm run smoketest -- --build "$env:AGENT_BUILDDIRECTORY\VSCode-win32-$global:arch" --log "$Artifacts" }
+# }
+
done
diff --git a/build/tfs/win32/build_unsigned.ps1 b/build/tfs/win32/build_unsigned.ps1
new file mode 100644
index 00000000000..207f633999c
--- /dev/null
+++ b/build/tfs/win32/build_unsigned.ps1
@@ -0,0 +1,85 @@
+Param(
+ [string]$arch,
+ [string]$mixinPassword,
+ [string]$vsoPAT,
+ [string]$storageKey,
+ [string]$mooncakeStorageKey,
+ [string]$documentDbKey
+)
+
+. .\build\tfs\win32\node.ps1
+. .\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
+"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:HOME\_netrc" -Encoding ASCII
+
+# Set the right architecture
+$env:npm_config_arch="$arch"
+
+step "Install dependencies" {
+ exec { & npm install }
+}
+
+step "Hygiene" {
+ exec { & npm run gulp -- hygiene }
+}
+
+$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 -- "vscode-win32-$global:arch-min" }
+}
+
+step "Run unit tests" {
+ exec { & .\scripts\test.bat --build --reporter dot }
+}
+
+step "Run smoke test" {
+ $Artifacts = "$env:AGENT_BUILDDIRECTORY\smoketest-artifacts"
+ Remove-Item -Recurse -Force -ErrorAction Ignore $Artifacts
+
+ exec { & npm run smoketest -- --build "$env:AGENT_BUILDDIRECTORY\VSCode-win32-$global:arch" --log "$Artifacts" }
+}
+
+step "Create archive and setup package" {
+ exec { & npm run gulp -- "vscode-win32-$global:arch-archive" "vscode-win32-$global:arch-setup" }
+}
+
+$Repo = "$(pwd)"
+$Root = "$Repo\.."
+$Exe = "$Repo\.build\win32-$arch\setup\VSCodeSetup.exe"
+$Zip = "$Repo\.build\win32-$arch\archive\VSCode-win32-$arch.zip"
+$Build = "$Root\VSCode-win32-$arch"
+
+# get version
+$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
+$Version = $PackageJson.version
+$Quality = "$env:VSCODE_QUALITY"
+$env:AZURE_STORAGE_ACCESS_KEY_2 = $storageKey
+$env:MOONCAKE_STORAGE_ACCESS_KEY = $mooncakeStorageKey
+$env:AZURE_DOCUMENTDB_MASTERKEY = $documentDbKey
+
+$assetPlatform = if ($arch -eq "ia32") { "win32" } else { "win32-x64" }
+
+step "Publish UNSIGNED archive" {
+ exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive-unsigned "VSCode-win32-$global:arch-$Version-unsigned.zip" $Version false $Zip }
+}
+
+step "Publish UNSIGNED setup package" {
+ exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup-unsigned "VSCodeSetup-$global:arch-$Version-unsigned.exe" $Version false $Exe }
+}
+
+done
diff --git a/build/tfs/win32/smoketest.ps1 b/build/tfs/win32/smoketest.ps1
deleted file mode 100644
index 3628dacb222..00000000000
--- a/build/tfs/win32/smoketest.ps1
+++ /dev/null
@@ -1,47 +0,0 @@
-Param(
- [string]$arch,
- [string]$mixinPassword,
- [string]$vsoPAT
-)
-
-. .\build\tfs\win32\node.ps1
-. .\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 -- "vscode-win32-$global:arch-min" }
-}
-
-step "Run smoke test" {
- exec { & Push-Location test\smoke }
- exec { & npm install }
- exec { & npm run smoketest -- --build "$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 73b031fe643..57239c1f677 100644
--- a/build/win32/code.iss
+++ b/build/win32/code.iss
@@ -19,6 +19,7 @@ OutputBaseFilename=VSCodeSetup
Compression=lzma
SolidCompression=yes
AppMutex={#AppMutex}
+SetupMutex={#AppMutex}setup
WizardImageFile={#RepoDir}\resources\win32\inno-big.bmp
WizardSmallImageFile={#RepoDir}\resources\win32\inno-small.bmp
SetupIconFile={#RepoDir}\resources\win32\code.ico
@@ -122,6 +123,12 @@ Root: HKCR; Subkey: "{#RegValueName}.bashrc"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#RegValueName}.bashrc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico"; Tasks: associatewithfiles
Root: HKCR; Subkey: "{#RegValueName}.bashrc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles
+Root: HKCR; Subkey: ".bib\OpenWithProgids"; ValueType: none; ValueName: "{#RegValueName}"; Flags: deletevalue uninsdeletevalue; Tasks: associatewithfiles
+Root: HKCR; Subkey: ".bib\OpenWithProgids"; ValueType: string; ValueName: "{#RegValueName}.bib"; ValueData: ""; Flags: uninsdeletevalue; Tasks: associatewithfiles
+Root: HKCR; Subkey: "{#RegValueName}.bib"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,BibTeX}"; Flags: uninsdeletekey; Tasks: associatewithfiles
+Root: HKCR; Subkey: "{#RegValueName}.bib\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\resources\app\resources\win32\code_file.ico"; Tasks: associatewithfiles
+Root: HKCR; Subkey: "{#RegValueName}.bib\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles
+
Root: HKCR; Subkey: ".bowerrc\OpenWithProgids"; ValueType: none; ValueName: "{#RegValueName}"; Flags: deletevalue uninsdeletevalue; Tasks: associatewithfiles
Root: HKCR; Subkey: ".bowerrc\OpenWithProgids"; ValueType: string; ValueName: "{#RegValueName}.bowerrc"; ValueData: ""; Flags: uninsdeletevalue; Tasks: associatewithfiles
Root: HKCR; Subkey: "{#RegValueName}.bowerrc"; ValueType: string; ValueName: ""; ValueData: "{cm:SourceFile,Bower RC}"; Flags: uninsdeletekey; Tasks: associatewithfiles
diff --git a/extensions/bat/language-configuration.json b/extensions/bat/language-configuration.json
index 8b1695d8ec2..2fb5445a34a 100644
--- a/extensions/bat/language-configuration.json
+++ b/extensions/bat/language-configuration.json
@@ -18,5 +18,11 @@
["[", "]"],
["(", ")"],
["\"", "\""]
- ]
-}
\ No newline at end of file
+ ],
+ "folding": {
+ "markers": {
+ "start": "^\\s*(::\\s*|REM\\s+)#region",
+ "end": "^\\s*(::\\s*|REM\\s+)#endregion"
+ }
+ }
+}
diff --git a/extensions/clojure/language-configuration.json b/extensions/clojure/language-configuration.json
index 004e1dbd95b..24f52480015 100644
--- a/extensions/clojure/language-configuration.json
+++ b/extensions/clojure/language-configuration.json
@@ -18,5 +18,8 @@
["[", "]"],
["(", ")"],
["\"", "\""]
- ]
+ ],
+ "folding": {
+ "offSide": true
+ }
}
\ No newline at end of file
diff --git a/extensions/coffeescript/language-configuration.json b/extensions/coffeescript/language-configuration.json
index 745427eacfb..8c7fbd458df 100644
--- a/extensions/coffeescript/language-configuration.json
+++ b/extensions/coffeescript/language-configuration.json
@@ -21,5 +21,8 @@
["(", ")"],
["\"", "\""],
["'", "'"]
- ]
+ ],
+ "folding": {
+ "offSide": true
+ }
}
\ No newline at end of file
diff --git a/extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json b/extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json
index 0ce25622610..a67f88487ed 100644
--- a/extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json
+++ b/extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/atom/language-coffee-script/commit/087e41aeef03b52615ef5c9e159a4b98e813f8a6",
+ "version": "https://github.com/atom/language-coffee-script/commit/c0dbeede971ff5391ec1d94d4ea5d94e60d7e3e3",
"scopeName": "source.coffee",
"name": "CoffeeScript",
"fileTypes": [
@@ -17,35 +17,22 @@
"firstLineMatch": "(?x)\n# Hashbang\n^\\#!.*(?:\\s|\\/)\n coffee\n(?:$|\\s)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n coffee\n (?=[\\s;]|(?]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=\n coffee\n (?=\\s|:|$)\n)",
"patterns": [
{
- "captures": {
- "1": {
- "name": "variable.parameter.function.coffee"
- },
- "2": {
- "name": "storage.type.function.coffee"
- }
- },
- "comment": "match stuff like: a -> ⦠",
- "match": "(\\([^()]*?\\))\\s*([=-]>)",
- "name": "meta.inline.function.coffee"
- },
- {
+ "match": "(new)\\s+(?:(?:(class)\\s+(\\w+(?:\\.\\w*)*)?)|(\\w+(?:\\.\\w*)*))",
+ "name": "meta.class.instance.constructor.coffee",
"captures": {
"1": {
"name": "keyword.operator.new.coffee"
},
- "4": {
+ "2": {
"name": "storage.type.class.coffee"
},
- "6": {
+ "3": {
"name": "entity.name.type.instance.coffee"
},
- "7": {
+ "4": {
"name": "entity.name.type.instance.coffee"
}
- },
- "match": "(new)\\s+(((class)(\\s+(\\w+(?:\\.\\w*)*))?)|(\\w+(?:\\.\\w*)*))",
- "name": "meta.class.instance.constructor"
+ }
},
{
"begin": "'''",
@@ -60,7 +47,7 @@
"name": "punctuation.definition.string.end.coffee"
}
},
- "name": "string.quoted.heredoc.coffee",
+ "name": "string.quoted.single.heredoc.coffee",
"patterns": [
{
"captures": {
@@ -103,34 +90,38 @@
]
},
{
- "begin": "`",
- "beginCaptures": {
- "0": {
+ "match": "(`)(.*)(`)",
+ "name": "string.quoted.script.coffee",
+ "captures": {
+ "1": {
"name": "punctuation.definition.string.begin.coffee"
- }
- },
- "end": "`",
- "endCaptures": {
- "0": {
+ },
+ "2": {
+ "name": "source.js.embedded.coffee",
+ "patterns": [
+ {
+ "include": "source.js"
+ }
+ ]
+ },
+ "3": {
"name": "punctuation.definition.string.end.coffee"
}
- },
- "name": "string.quoted.script.coffee",
- "contentName": "source.embedded.js",
- "patterns": [
- {
- "include": "source.js"
- }
- ]
+ }
},
{
"begin": "(?>>?|(?*%+\\-&^])?=(?!>)|[!%^*\\/~?:]|\\-?\\-(?!>)|\\+\\+?|<>|<|>|&&?|\\.\\.\\.?|\\|\\|?|\\b(?=]))(?!(\\s*\\(.*\\))?\\s*([=-]>))",
- "captures": {
+ "begin": "(?x)\n(?<=\\s|^)((@)?[a-zA-Z_$][\\w$]*)\n\\s*([:=])\\s*\n(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)",
+ "beginCaptures": {
"1": {
- "name": "variable.assignment.coffee"
+ "name": "entity.name.function.coffee"
},
"2": {
- "name": "punctuation.separator.key-value"
+ "name": "variable.other.readwrite.instance.coffee"
},
"3": {
- "name": "keyword.operator.coffee"
+ "name": "keyword.operator.assignment.coffee"
}
- }
+ },
+ "end": "[=-]>",
+ "endCaptures": {
+ "0": {
+ "name": "storage.type.function.coffee"
+ }
+ },
+ "name": "meta.function.coffee",
+ "patterns": [
+ {
+ "include": "#function_params"
+ }
+ ]
+ },
+ {
+ "begin": "(?x)\n(?<=\\s|^)(?:((')([^']*?)('))|((\")([^\"]*?)(\")))\n\\s*([:=])\\s*\n(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)",
+ "beginCaptures": {
+ "1": {
+ "name": "string.quoted.single.coffee"
+ },
+ "2": {
+ "name": "punctuation.definition.string.begin.coffee"
+ },
+ "3": {
+ "name": "entity.name.function.coffee"
+ },
+ "4": {
+ "name": "punctuation.definition.string.end.coffee"
+ },
+ "5": {
+ "name": "string.quoted.double.coffee"
+ },
+ "6": {
+ "name": "punctuation.definition.string.begin.coffee"
+ },
+ "7": {
+ "name": "entity.name.function.coffee"
+ },
+ "8": {
+ "name": "punctuation.definition.string.end.coffee"
+ },
+ "9": {
+ "name": "keyword.operator.assignment.coffee"
+ }
+ },
+ "end": "[=-]>",
+ "endCaptures": {
+ "0": {
+ "name": "storage.type.function.coffee"
+ }
+ },
+ "name": "meta.function.coffee",
+ "patterns": [
+ {
+ "include": "#function_params"
+ }
+ ]
+ },
+ {
+ "begin": "(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)",
+ "end": "[=-]>",
+ "endCaptures": {
+ "0": {
+ "name": "storage.type.function.coffee"
+ }
+ },
+ "name": "meta.function.inline.coffee",
+ "patterns": [
+ {
+ "include": "#function_params"
+ }
+ ]
},
{
"begin": "(?<=\\s|^)({)(?=[^'\"#]+?}[\\s\\]}]*=)",
@@ -221,9 +284,9 @@
"name": "punctuation.definition.destructuring.begin.bracket.curly.coffee"
}
},
- "end": "(})",
+ "end": "}",
"endCaptures": {
- "1": {
+ "0": {
"name": "punctuation.definition.destructuring.end.bracket.curly.coffee"
}
},
@@ -233,7 +296,8 @@
"include": "$self"
},
{
- "include": "#variable_name"
+ "match": "[a-zA-Z$_]\\w*",
+ "name": "variable.assignment.coffee"
}
]
},
@@ -244,9 +308,9 @@
"name": "punctuation.definition.destructuring.begin.bracket.square.coffee"
}
},
- "end": "(\\])",
+ "end": "\\]",
"endCaptures": {
- "1": {
+ "0": {
"name": "punctuation.definition.destructuring.end.bracket.square.coffee"
}
},
@@ -256,25 +320,11 @@
"include": "$self"
},
{
- "include": "#variable_name"
+ "match": "[a-zA-Z$_]\\w*",
+ "name": "variable.assignment.coffee"
}
]
},
- {
- "match": "(?x)\n(?<=^|\\s)\n(?=@?[a-zA-Z\\$_])\n@?([a-zA-Z\\$_]\\w*)(\\$|:|\\.)?\\s*\n(?=[:=](\\s*\\(.*\\))?\\s*([=-]>))",
- "captures": {
- "1": {
- "name": "entity.name.function.coffee"
- },
- "3": {
- "name": "variable.parameter.function.coffee"
- },
- "4": {
- "name": "storage.type.function.coffee"
- }
- },
- "name": "meta.function.coffee"
- },
{
"match": "\\b(?|\\-\\d|\\[|\\{|\"|'))|(?=\\())",
- "captures": {
- "4": {
- "name": "entity.name.function.coffee"
- }
- }
- },
- {
- "match": "[=-]>",
- "name": "storage.type.function.coffee"
- },
{
"match": "\\b(?|\\-\\d|\\[|{|\"|'))",
+ "end": "(?=\\s*(?|\\-\\d|\\[|{|\"|')))",
+ "beginCaptures": {
+ "1": {
+ "name": "variable.other.readwrite.instance.coffee"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#function_names"
+ }
+ ]
+ }
+ },
+ "end": "(?=\\s*(?|\\-\\d|\\[|{|\"|')))",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.separator.method.period.coffee"
+ },
+ "2": {
+ "name": "keyword.operator.prototype.coffee"
+ },
+ "3": {
+ "patterns": [
+ {
+ "include": "#method_names"
+ }
+ ]
+ }
+ },
+ "end": "(?=\\s*(?>=|>>>=|\\|=)",
+ "captures": {
+ "1": {
+ "name": "variable.assignment.coffee"
+ },
+ "2": {
+ "name": "keyword.operator.assignment.compound.bitwise.coffee"
+ }
+ }
+ },
+ {
+ "match": "<<|>>>|>>",
+ "name": "keyword.operator.bitwise.shift.coffee"
+ },
+ {
+ "match": "!=|<=|>=|==|<|>",
+ "name": "keyword.operator.comparison.coffee"
+ },
+ {
+ "match": "&&|!|\\|\\|",
+ "name": "keyword.operator.logical.coffee"
+ },
+ {
+ "match": "&|\\||\\^|~",
+ "name": "keyword.operator.bitwise.coffee"
+ },
+ {
+ "match": "([a-zA-Z$_][\\w$]*)?\\s*(=|:(?!:))(?![>=])",
+ "captures": {
+ "1": {
+ "name": "variable.assignment.coffee"
+ },
+ "2": {
+ "name": "keyword.operator.assignment.coffee"
+ }
+ }
+ },
+ {
+ "match": "--",
+ "name": "keyword.operator.decrement.coffee"
+ },
+ {
+ "match": "\\+\\+",
+ "name": "keyword.operator.increment.coffee"
+ },
+ {
+ "match": "\\.\\.\\.",
+ "name": "keyword.operator.splat.coffee"
+ },
+ {
+ "match": "\\?",
+ "name": "keyword.operator.existential.coffee"
+ },
+ {
+ "match": "%|\\*|/|-|\\+",
+ "name": "keyword.operator.coffee"
+ },
+ {
+ "match": "(?x)\n\\b(?",
- "t": "source.coffee meta.inline.function.coffee storage.type.function.coffee",
+ "t": "source.coffee meta.function.coffee storage.type.function.coffee",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
@@ -166,7 +188,7 @@
},
{
"c": ":",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee meta.function.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -177,7 +199,7 @@
},
{
"c": " ",
- "t": "source.coffee",
+ "t": "source.coffee meta.function.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -187,19 +209,30 @@
}
},
{
- "c": "()",
- "t": "source.coffee meta.inline.function.coffee variable.parameter.function.coffee",
+ "c": "(",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee punctuation.definition.parameters.begin.bracket.round.coffee",
"r": {
- "dark_plus": "variable: #9CDCFE",
- "light_plus": "variable: #001080",
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
- "hc_black": "variable: #9CDCFE"
+ "hc_black": "default: #FFFFFF"
+ }
+ },
+ {
+ "c": ")",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee punctuation.definition.parameters.end.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
- "t": "source.coffee meta.inline.function.coffee",
+ "t": "source.coffee meta.function.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -210,7 +243,7 @@
},
{
"c": "=>",
- "t": "source.coffee meta.inline.function.coffee storage.type.function.coffee",
+ "t": "source.coffee meta.function.coffee storage.type.function.coffee",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
@@ -232,7 +265,7 @@
},
{
"c": "alert",
- "t": "source.coffee entity.name.function.coffee",
+ "t": "source.coffee meta.function-call.coffee entity.name.function.coffee",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
@@ -243,7 +276,7 @@
},
{
"c": " ",
- "t": "source.coffee",
+ "t": "source.coffee meta.function-call.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -254,7 +287,7 @@
},
{
"c": "\"",
- "t": "source.coffee string.quoted.double.coffee punctuation.definition.string.begin.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -265,7 +298,7 @@
},
{
"c": "Drive ",
- "t": "source.coffee string.quoted.double.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -276,18 +309,18 @@
},
{
"c": "#{",
- "t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
- "dark_plus": "punctuation.section.embedded.coffee: #569CD6",
- "light_plus": "punctuation.section.embedded.coffee: #0000FF",
- "dark_vs": "punctuation.section.embedded.coffee: #569CD6",
- "light_vs": "punctuation.section.embedded.coffee: #0000FF",
- "hc_black": "punctuation.section.embedded.coffee: #569CD6"
+ "dark_plus": "punctuation.section.embedded: #569CD6",
+ "light_plus": "punctuation.section.embedded: #0000FF",
+ "dark_vs": "punctuation.section.embedded: #569CD6",
+ "light_vs": "punctuation.section.embedded: #0000FF",
+ "hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "@name",
- "t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source variable.other.readwrite.instance.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source variable.other.readwrite.instance.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
@@ -298,18 +331,18 @@
},
{
"c": "}",
- "t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
- "dark_plus": "punctuation.section.embedded.coffee: #569CD6",
- "light_plus": "punctuation.section.embedded.coffee: #0000FF",
- "dark_vs": "punctuation.section.embedded.coffee: #569CD6",
- "light_vs": "punctuation.section.embedded.coffee: #0000FF",
- "hc_black": "punctuation.section.embedded.coffee: #569CD6"
+ "dark_plus": "punctuation.section.embedded: #569CD6",
+ "light_plus": "punctuation.section.embedded: #0000FF",
+ "dark_vs": "punctuation.section.embedded: #569CD6",
+ "light_vs": "punctuation.section.embedded: #0000FF",
+ "hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "\"",
- "t": "source.coffee string.quoted.double.coffee punctuation.definition.string.end.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee punctuation.definition.string.end.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -419,7 +452,7 @@
},
{
"c": ":",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee meta.function.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -430,7 +463,7 @@
},
{
"c": " ",
- "t": "source.coffee",
+ "t": "source.coffee meta.function.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -440,19 +473,30 @@
}
},
{
- "c": "()",
- "t": "source.coffee meta.inline.function.coffee variable.parameter.function.coffee",
+ "c": "(",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee punctuation.definition.parameters.begin.bracket.round.coffee",
"r": {
- "dark_plus": "variable: #9CDCFE",
- "light_plus": "variable: #001080",
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
- "hc_black": "variable: #9CDCFE"
+ "hc_black": "default: #FFFFFF"
+ }
+ },
+ {
+ "c": ")",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee punctuation.definition.parameters.end.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
- "t": "source.coffee meta.inline.function.coffee",
+ "t": "source.coffee meta.function.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -463,7 +507,7 @@
},
{
"c": "=>",
- "t": "source.coffee meta.inline.function.coffee storage.type.function.coffee",
+ "t": "source.coffee meta.function.coffee storage.type.function.coffee",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
@@ -485,7 +529,7 @@
},
{
"c": "alert",
- "t": "source.coffee entity.name.function.coffee",
+ "t": "source.coffee meta.function-call.coffee entity.name.function.coffee",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
@@ -496,7 +540,7 @@
},
{
"c": " ",
- "t": "source.coffee",
+ "t": "source.coffee meta.function-call.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -507,7 +551,7 @@
},
{
"c": "\"",
- "t": "source.coffee string.quoted.double.coffee punctuation.definition.string.begin.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -518,7 +562,7 @@
},
{
"c": "Driving ",
- "t": "source.coffee string.quoted.double.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -529,18 +573,18 @@
},
{
"c": "#{",
- "t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
- "dark_plus": "punctuation.section.embedded.coffee: #569CD6",
- "light_plus": "punctuation.section.embedded.coffee: #0000FF",
- "dark_vs": "punctuation.section.embedded.coffee: #569CD6",
- "light_vs": "punctuation.section.embedded.coffee: #0000FF",
- "hc_black": "punctuation.section.embedded.coffee: #569CD6"
+ "dark_plus": "punctuation.section.embedded: #569CD6",
+ "light_plus": "punctuation.section.embedded: #0000FF",
+ "dark_vs": "punctuation.section.embedded: #569CD6",
+ "light_vs": "punctuation.section.embedded: #0000FF",
+ "hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "@name",
- "t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source variable.other.readwrite.instance.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source variable.other.readwrite.instance.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
@@ -551,18 +595,18 @@
},
{
"c": "}",
- "t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
- "dark_plus": "punctuation.section.embedded.coffee: #569CD6",
- "light_plus": "punctuation.section.embedded.coffee: #0000FF",
- "dark_vs": "punctuation.section.embedded.coffee: #569CD6",
- "light_vs": "punctuation.section.embedded.coffee: #0000FF",
- "hc_black": "punctuation.section.embedded.coffee: #569CD6"
+ "dark_plus": "punctuation.section.embedded: #569CD6",
+ "light_plus": "punctuation.section.embedded: #0000FF",
+ "dark_vs": "punctuation.section.embedded: #569CD6",
+ "light_vs": "punctuation.section.embedded: #0000FF",
+ "hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "\"",
- "t": "source.coffee string.quoted.double.coffee punctuation.definition.string.end.coffee",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee string.quoted.double.coffee punctuation.definition.string.end.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@@ -595,7 +639,7 @@
},
{
"c": "=",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -617,7 +661,7 @@
},
{
"c": "new",
- "t": "source.coffee meta.class.instance.constructor keyword.operator.new.coffee",
+ "t": "source.coffee meta.class.instance.constructor.coffee keyword.operator.new.coffee",
"r": {
"dark_plus": "keyword.operator.new: #569CD6",
"light_plus": "keyword.operator.new: #0000FF",
@@ -628,7 +672,7 @@
},
{
"c": " ",
- "t": "source.coffee meta.class.instance.constructor",
+ "t": "source.coffee meta.class.instance.constructor.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -639,7 +683,7 @@
},
{
"c": "Car",
- "t": "source.coffee meta.class.instance.constructor entity.name.type.instance.coffee",
+ "t": "source.coffee meta.class.instance.constructor.coffee entity.name.type.instance.coffee",
"r": {
"dark_plus": "entity.name.type: #4EC9B0",
"light_plus": "entity.name.type: #267F99",
@@ -716,7 +760,7 @@
},
{
"c": "onTheRoad",
- "t": "source.coffee entity.name.function.coffee",
+ "t": "source.coffee meta.function-call.coffee entity.name.function.coffee",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
@@ -726,8 +770,8 @@
}
},
{
- "c": "()",
- "t": "source.coffee meta.brace.round.coffee",
+ "c": "(",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee punctuation.definition.arguments.begin.bracket.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -737,7 +781,18 @@
}
},
{
- "c": " c",
+ "c": ")",
+ "t": "source.coffee meta.function-call.coffee meta.arguments.coffee punctuation.definition.arguments.end.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
+ }
+ },
+ {
+ "c": " ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
@@ -747,9 +802,20 @@
"hc_black": "default: #FFFFFF"
}
},
+ {
+ "c": "c",
+ "t": "source.coffee variable.other.object.coffee",
+ "r": {
+ "dark_plus": "variable: #9CDCFE",
+ "light_plus": "variable: #001080",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "variable: #9CDCFE"
+ }
+ },
{
"c": ".",
- "t": "source.coffee meta.delimiter.method.period.coffee",
+ "t": "source.coffee meta.method-call.coffee punctuation.separator.method.period.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -760,7 +826,7 @@
},
{
"c": "drive",
- "t": "source.coffee entity.name.function.coffee",
+ "t": "source.coffee meta.method-call.coffee entity.name.function.coffee",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
@@ -770,8 +836,19 @@
}
},
{
- "c": "()",
- "t": "source.coffee meta.brace.round.coffee",
+ "c": "(",
+ "t": "source.coffee meta.method-call.coffee meta.arguments.coffee punctuation.definition.arguments.begin.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
+ }
+ },
+ {
+ "c": ")",
+ "t": "source.coffee meta.method-call.coffee meta.arguments.coffee punctuation.definition.arguments.end.bracket.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -804,7 +881,7 @@
},
{
"c": "=",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -837,7 +914,7 @@
},
{
"c": "new",
- "t": "source.coffee meta.class.instance.constructor keyword.operator.new.coffee",
+ "t": "source.coffee meta.class.instance.constructor.coffee keyword.operator.new.coffee",
"r": {
"dark_plus": "keyword.operator.new: #569CD6",
"light_plus": "keyword.operator.new: #0000FF",
@@ -848,7 +925,7 @@
},
{
"c": " ",
- "t": "source.coffee meta.class.instance.constructor",
+ "t": "source.coffee meta.class.instance.constructor.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -859,7 +936,7 @@
},
{
"c": "Car",
- "t": "source.coffee meta.class.instance.constructor entity.name.type.instance.coffee",
+ "t": "source.coffee meta.class.instance.constructor.coffee entity.name.type.instance.coffee",
"r": {
"dark_plus": "entity.name.type: #4EC9B0",
"light_plus": "entity.name.type: #267F99",
@@ -925,7 +1002,7 @@
},
{
"c": "[",
- "t": "source.coffee meta.brace.square.coffee",
+ "t": "source.coffee punctuation.definition.array.begin.bracket.square.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -936,7 +1013,7 @@
},
{
"c": "1",
- "t": "source.coffee constant.numeric.coffee",
+ "t": "source.coffee constant.numeric.decimal.coffee",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -947,7 +1024,7 @@
},
{
"c": "..",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee keyword.operator.slice.inclusive.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -958,7 +1035,7 @@
},
{
"c": "100",
- "t": "source.coffee constant.numeric.coffee",
+ "t": "source.coffee constant.numeric.decimal.coffee",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -969,7 +1046,7 @@
},
{
"c": "]",
- "t": "source.coffee meta.brace.square.coffee",
+ "t": "source.coffee punctuation.definition.array.end.bracket.square.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1013,7 +1090,7 @@
},
{
"c": "=",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee meta.function.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -1024,7 +1101,7 @@
},
{
"c": " ",
- "t": "source.coffee",
+ "t": "source.coffee meta.function.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1034,8 +1111,19 @@
}
},
{
- "c": "(vehicles)",
- "t": "source.coffee meta.inline.function.coffee variable.parameter.function.coffee",
+ "c": "(",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee punctuation.definition.parameters.begin.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
+ }
+ },
+ {
+ "c": "vehicles",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee variable.parameter.function.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
@@ -1044,9 +1132,20 @@
"hc_black": "variable: #9CDCFE"
}
},
+ {
+ "c": ")",
+ "t": "source.coffee meta.function.coffee meta.parameters.coffee punctuation.definition.parameters.end.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
+ }
+ },
{
"c": " ",
- "t": "source.coffee meta.inline.function.coffee",
+ "t": "source.coffee meta.function.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1057,7 +1156,7 @@
},
{
"c": "->",
- "t": "source.coffee meta.inline.function.coffee storage.type.function.coffee",
+ "t": "source.coffee meta.function.coffee storage.type.function.coffee",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
@@ -1079,7 +1178,7 @@
},
{
"c": "[",
- "t": "source.coffee meta.brace.square.coffee",
+ "t": "source.coffee punctuation.definition.array.begin.bracket.square.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1090,18 +1189,18 @@
},
{
"c": "vehicle",
- "t": "source.coffee",
+ "t": "source.coffee variable.other.object.coffee",
"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"
}
},
{
"c": ".",
- "t": "source.coffee meta.delimiter.method.period.coffee",
+ "t": "source.coffee meta.method-call.coffee punctuation.separator.method.period.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1112,7 +1211,7 @@
},
{
"c": "drive",
- "t": "source.coffee entity.name.function.coffee",
+ "t": "source.coffee meta.method-call.coffee entity.name.function.coffee",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
@@ -1122,8 +1221,19 @@
}
},
{
- "c": "()",
- "t": "source.coffee meta.brace.round.coffee",
+ "c": "(",
+ "t": "source.coffee meta.method-call.coffee meta.arguments.coffee punctuation.definition.arguments.begin.bracket.round.coffee",
+ "r": {
+ "dark_plus": "default: #D4D4D4",
+ "light_plus": "default: #000000",
+ "dark_vs": "default: #D4D4D4",
+ "light_vs": "default: #000000",
+ "hc_black": "default: #FFFFFF"
+ }
+ },
+ {
+ "c": ")",
+ "t": "source.coffee meta.method-call.coffee meta.arguments.coffee punctuation.definition.arguments.end.bracket.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1189,7 +1299,7 @@
},
{
"c": "]",
- "t": "source.coffee meta.brace.square.coffee",
+ "t": "source.coffee punctuation.definition.array.end.bracket.square.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
@@ -1222,7 +1332,7 @@
},
{
"c": "=",
- "t": "source.coffee keyword.operator.coffee",
+ "t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
@@ -1244,7 +1354,7 @@
},
{
"c": "///",
- "t": "source.coffee string.regexp.coffee punctuation.definition.string.begin.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1255,7 +1365,7 @@
},
{
"c": "\t",
- "t": "source.coffee string.regexp.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1266,10 +1376,10 @@
},
{
"c": "(",
- "t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
- "dark_plus": "string.regexp: #D16969",
- "light_plus": "string.regexp: #811F3F",
+ "dark_plus": "punctuation.definition.group.regexp: #CE9178",
+ "light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1277,21 +1387,21 @@
},
{
"c": "\\d",
- "t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp constant.character.character-class.regexp",
"r": {
- "dark_plus": "string.regexp: #D16969",
- "light_plus": "string.regexp: #811F3F",
+ "dark_plus": "constant.character.character-class.regexp: #D16969",
+ "light_plus": "constant.character.character-class.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
- "hc_black": "string.regexp: #D16969"
+ "hc_black": "constant.character: #569CD6"
}
},
{
"c": "+",
- "t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp keyword.operator.quantifier.regexp",
"r": {
- "dark_plus": "keyword.operator: #D4D4D4",
- "light_plus": "keyword.operator: #000000",
+ "dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
+ "light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -1299,10 +1409,10 @@
},
{
"c": ")",
- "t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
- "dark_plus": "string.regexp: #D16969",
- "light_plus": "string.regexp: #811F3F",
+ "dark_plus": "punctuation.definition.group.regexp: #CE9178",
+ "light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1310,7 +1420,7 @@
},
{
"c": "\t",
- "t": "source.coffee string.regexp.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1321,7 +1431,7 @@
},
{
"c": "#",
- "t": "source.coffee string.regexp.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
@@ -1332,7 +1442,7 @@
},
{
"c": " numbers",
- "t": "source.coffee string.regexp.coffee comment.line.number-sign.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee comment.line.number-sign.coffee",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
@@ -1343,7 +1453,7 @@
},
{
"c": "\t",
- "t": "source.coffee string.regexp.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1354,10 +1464,10 @@
},
{
"c": "(",
- "t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
- "dark_plus": "string.regexp: #D16969",
- "light_plus": "string.regexp: #811F3F",
+ "dark_plus": "punctuation.definition.group.regexp: #CE9178",
+ "light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1365,21 +1475,21 @@
},
{
"c": "\\w",
- "t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp constant.character.character-class.regexp",
"r": {
- "dark_plus": "string.regexp: #D16969",
- "light_plus": "string.regexp: #811F3F",
+ "dark_plus": "constant.character.character-class.regexp: #D16969",
+ "light_plus": "constant.character.character-class.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
- "hc_black": "string.regexp: #D16969"
+ "hc_black": "constant.character: #569CD6"
}
},
{
"c": "*",
- "t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp keyword.operator.quantifier.regexp",
"r": {
- "dark_plus": "keyword.operator: #D4D4D4",
- "light_plus": "keyword.operator: #000000",
+ "dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
+ "light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
@@ -1387,10 +1497,10 @@
},
{
"c": ")",
- "t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
- "dark_plus": "string.regexp: #D16969",
- "light_plus": "string.regexp: #811F3F",
+ "dark_plus": "punctuation.definition.group.regexp: #CE9178",
+ "light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
@@ -1398,7 +1508,7 @@
},
{
"c": "\t",
- "t": "source.coffee string.regexp.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1409,7 +1519,7 @@
},
{
"c": "#",
- "t": "source.coffee string.regexp.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
@@ -1420,7 +1530,7 @@
},
{
"c": " letters",
- "t": "source.coffee string.regexp.coffee comment.line.number-sign.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee comment.line.number-sign.coffee",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
@@ -1431,7 +1541,7 @@
},
{
"c": "\t",
- "t": "source.coffee string.regexp.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1442,10 +1552,10 @@
},
{
"c": "$",
- "t": "source.coffee string.regexp.coffee keyword.control.anchor.regexp",
+ "t": "source.coffee string.regexp.multiline.coffee keyword.control.anchor.regexp",
"r": {
- "dark_plus": "keyword.control: #C586C0",
- "light_plus": "keyword.control: #AF00DB",
+ "dark_plus": "keyword.control.anchor.regexp: #DCDCAA",
+ "light_plus": "keyword.control.anchor.regexp: #FF0000",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
@@ -1453,7 +1563,7 @@
},
{
"c": "\t\t",
- "t": "source.coffee string.regexp.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
@@ -1464,7 +1574,7 @@
},
{
"c": "#",
- "t": "source.coffee string.regexp.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
@@ -1475,7 +1585,7 @@
},
{
"c": " the end",
- "t": "source.coffee string.regexp.coffee comment.line.number-sign.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee comment.line.number-sign.coffee",
"r": {
"dark_plus": "comment: #608B4E",
"light_plus": "comment: #008000",
@@ -1486,7 +1596,7 @@
},
{
"c": "///",
- "t": "source.coffee string.regexp.coffee punctuation.definition.string.end.coffee",
+ "t": "source.coffee string.regexp.multiline.coffee punctuation.definition.string.end.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
diff --git a/extensions/configuration-editing/package.json b/extensions/configuration-editing/package.json
index 1fd34c23234..67c6c899c16 100644
--- a/extensions/configuration-editing/package.json
+++ b/extensions/configuration-editing/package.json
@@ -33,19 +33,11 @@
},
{
"fileMatch": "vscode://defaultsettings/settings.json",
- "url": "vscode://schemas/settings"
- },
- {
- "fileMatch": "vscode://defaultsettings/resourceSettings.json",
- "url": "vscode://schemas/settings/resource"
- },
- {
- "fileMatch": "vscode://settings/workspaceSettings.json",
- "url": "vscode://schemas/settings"
+ "url": "vscode://schemas/settings/default"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/settings.json",
- "url": "vscode://schemas/settings"
+ "url": "vscode://schemas/settings/user"
},
{
"fileMatch": "%APP_WORKSPACES_HOME%/*/workspace.json",
@@ -61,7 +53,7 @@
},
{
"fileMatch": "/.vscode/settings.json",
- "url": "vscode://schemas/settings"
+ "url": "vscode://schemas/settings/folder"
},
{
"fileMatch": "/.vscode/launch.json",
@@ -82,6 +74,6 @@
]
},
"devDependencies": {
- "@types/node": "^7.0.4"
+ "@types/node": "7.0.4"
}
-}
\ No newline at end of file
+}
diff --git a/extensions/configuration-editing/src/extension.ts b/extensions/configuration-editing/src/extension.ts
index f18c3fe7c25..75e41fbd0d0 100644
--- a/extensions/configuration-editing/src/extension.ts
+++ b/extensions/configuration-editing/src/extension.ts
@@ -19,7 +19,7 @@ const decoration = vscode.window.createTextEditorDecorationType({
let pendingLaunchJsonDecoration: NodeJS.Timer;
-export function activate(context): void {
+export function activate(context: vscode.ExtensionContext): void {
//keybindings.json command-suggestions
context.subscriptions.push(registerKeybindingsCompletions());
@@ -27,8 +27,8 @@ export function activate(context): void {
//settings.json suggestions
context.subscriptions.push(registerSettingsCompletions());
- //extensions.json suggestions
- context.subscriptions.push(registerExtensionsCompletions());
+ //extensions suggestions
+ context.subscriptions.push(...registerExtensionsCompletions());
// launch.json decorations
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(editor => updateLaunchJsonDecorations(editor), null, context.subscriptions));
@@ -67,43 +67,69 @@ function registerSettingsCompletions(): vscode.Disposable {
});
}
-function registerExtensionsCompletions(): vscode.Disposable {
+interface IExtensionsContent {
+ recommendations: string[];
+}
+
+function registerExtensionsCompletions(): vscode.Disposable[] {
+ return [registerExtensionsCompletionsInExtensionsDocument(), registerExtensionsCompletionsInWorkspaceConfigurationDocument()];
+}
+
+function registerExtensionsCompletionsInExtensionsDocument(): vscode.Disposable {
return vscode.languages.registerCompletionItemProvider({ pattern: '**/extensions.json' }, {
provideCompletionItems(document, position, token) {
const location = getLocation(document.getText(), document.offsetAt(position));
const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
if (location.path[0] === 'recommendations') {
- const config = parse(document.getText());
- const alreadyEnteredExtensions = config && config.recommendations || [];
- if (Array.isArray(alreadyEnteredExtensions)) {
- const knownExtensionProposals = vscode.extensions.all.filter(e =>
- !(e.id.startsWith('vscode.')
- || e.id === 'Microsoft.vscode-markdown'
- || alreadyEnteredExtensions.indexOf(e.id) > -1));
- if (knownExtensionProposals.length) {
- return knownExtensionProposals.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;
- });
- } else {
- const example = new vscode.CompletionItem(localize('exampleExtension', "Example"));
- example.insertText = '"vscode.csharp"';
- example.kind = vscode.CompletionItemKind.Value;
- example.range = range;
- return [example];
- }
- }
+ const extensionsContent = parse(document.getText());
+ return provideInstalledExtensionProposals(extensionsContent, range);
}
return [];
}
});
}
+function registerExtensionsCompletionsInWorkspaceConfigurationDocument(): vscode.Disposable {
+ return vscode.languages.registerCompletionItemProvider({ pattern: '**/*.code-workspace' }, {
+ provideCompletionItems(document, position, token) {
+ const location = getLocation(document.getText(), document.offsetAt(position));
+ const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
+ if (location.path[0] === 'extensions' && location.path[1] === 'recommendations') {
+ const extensionsContent = parse(document.getText())['extensions'];
+ return provideInstalledExtensionProposals(extensionsContent, range);
+ }
+ return [];
+ }
+ });
+}
+
+function provideInstalledExtensionProposals(extensionsContent: IExtensionsContent, range: vscode.Range): vscode.ProviderResult {
+ const alreadyEnteredExtensions = extensionsContent && extensionsContent.recommendations || [];
+ if (Array.isArray(alreadyEnteredExtensions)) {
+ const knownExtensionProposals = vscode.extensions.all.filter(e =>
+ !(e.id.startsWith('vscode.')
+ || e.id === 'Microsoft.vscode-markdown'
+ || alreadyEnteredExtensions.indexOf(e.id) > -1));
+ if (knownExtensionProposals.length) {
+ return knownExtensionProposals.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;
+ });
+ } else {
+ const example = new vscode.CompletionItem(localize('exampleExtension', "Example"));
+ example.insertText = '"vscode.csharp"';
+ example.kind = vscode.CompletionItemKind.Value;
+ example.range = range;
+ return [example];
+ }
+ }
+}
+
function newSimpleCompletionItem(label: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem {
const item = new vscode.CompletionItem(label);
item.kind = vscode.CompletionItemKind.Value;
diff --git a/extensions/configuration-editing/src/settingsDocumentHelper.ts b/extensions/configuration-editing/src/settingsDocumentHelper.ts
index dc4c47ac129..9bdfe486b35 100644
--- a/extensions/configuration-editing/src/settingsDocumentHelper.ts
+++ b/extensions/configuration-editing/src/settingsDocumentHelper.ts
@@ -43,13 +43,13 @@ export class SettingsDocument {
private provideWindowTitleCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult {
const completions: vscode.CompletionItem[] = [];
- 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. 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('${activeEditorShort}', range, localize('activeEditorShort', "the file name (e.g. myFile.txt)")));
+ completions.push(this.newSimpleCompletionItem('${activeEditorMedium}', range, localize('activeEditorMedium', "the path of the file relative to the workspace folder (e.g. myFolder/myFile.txt)")));
+ completions.push(this.newSimpleCompletionItem('${activeEditorLong}', range, localize('activeEditorLong', "the full path of the file (e.g. /Users/Development/myProject/myFolder/myFile.txt)")));
+ completions.push(this.newSimpleCompletionItem('${rootName}', range, localize('rootName', "name of the workspace (e.g. myFolder or myWorkspace)")));
+ completions.push(this.newSimpleCompletionItem('${rootPath}', range, localize('rootPath', "file path of the workspace (e.g. /Users/Development/myWorkspace)")));
+ completions.push(this.newSimpleCompletionItem('${folderName}', range, localize('folderName', "name of the workspace folder the file is contained in (e.g. myFolder)")));
+ completions.push(this.newSimpleCompletionItem('${folderPath}', range, localize('folderPath', "file path of the workspace folder the file is contained in (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")));
@@ -149,7 +149,7 @@ export class SettingsDocument {
return Promise.resolve(completions);
}
- private provideLanguageCompletionItems(location: Location, range: vscode.Range, formatFunc: (string) => string = (l) => JSON.stringify(l)): vscode.ProviderResult {
+ private provideLanguageCompletionItems(location: Location, range: vscode.Range, formatFunc: (string: string) => string = (l) => JSON.stringify(l)): vscode.ProviderResult {
return vscode.languages.getLanguages().then(languages => {
return languages.map(l => {
return this.newSimpleCompletionItem(formatFunc(l), range);
diff --git a/extensions/configuration-editing/tsconfig.json b/extensions/configuration-editing/tsconfig.json
index 6971f531b11..23392904dee 100644
--- a/extensions/configuration-editing/tsconfig.json
+++ b/extensions/configuration-editing/tsconfig.json
@@ -6,7 +6,7 @@
"lib": [
"es2015"
],
- "strictNullChecks": true
+ "strict": true
},
"include": [
"src/**/*"
diff --git a/extensions/cpp/language-configuration.json b/extensions/cpp/language-configuration.json
index a8782a61e3c..a4f6c85aeab 100644
--- a/extensions/cpp/language-configuration.json
+++ b/extensions/cpp/language-configuration.json
@@ -25,5 +25,11 @@
"indentationRules": {
"increaseIndentPattern": "^.*\\{[^}\"\\']*$|^.*\\([^\\)\"\\']*$|^\\s*(public|private|protected):\\s*$|^\\s*@(public|private|protected)\\s*$|^\\s*\\{\\}$",
"decreaseIndentPattern": "^\\s*(\\s*/[*].*[*]/\\s*)*\\}|^\\s*(\\s*/[*].*[*]/\\s*)*\\)|^\\s*(public|private|protected):\\s*$|^\\s*@(public|private|protected)\\s*$"
+ },
+ "folding": {
+ "markers": {
+ "start": "^\\s*#pragma\\s+region\\b",
+ "end": "^\\s*#pragma\\s+endregion\\b"
+ }
}
}
\ No newline at end of file
diff --git a/extensions/cpp/package.json b/extensions/cpp/package.json
index ce8f3d711a6..169cabff934 100644
--- a/extensions/cpp/package.json
+++ b/extensions/cpp/package.json
@@ -32,6 +32,14 @@
{
"scopeName": "source.c.platform",
"path": "./syntaxes/Platform.tmLanguage"
+ }],
+ "snippets": [{
+ "language": "c",
+ "path": "./snippets/c.json"
+ },
+ {
+ "language": "cpp",
+ "path": "./snippets/cpp.json"
}]
}
}
\ No newline at end of file
diff --git a/extensions/cpp/snippets/c.json b/extensions/cpp/snippets/c.json
new file mode 100644
index 00000000000..d9628dfe42c
--- /dev/null
+++ b/extensions/cpp/snippets/c.json
@@ -0,0 +1,16 @@
+{
+ "Region Start": {
+ "prefix": "#region",
+ "body": [
+ "#pragma region $0"
+ ],
+ "description": "Folding Region Start"
+ },
+ "Region End": {
+ "prefix": "#endregion",
+ "body": [
+ "#pragma endregion"
+ ],
+ "description": "Folding Region End"
+ }
+}
diff --git a/extensions/cpp/snippets/cpp.json b/extensions/cpp/snippets/cpp.json
new file mode 100644
index 00000000000..d9628dfe42c
--- /dev/null
+++ b/extensions/cpp/snippets/cpp.json
@@ -0,0 +1,16 @@
+{
+ "Region Start": {
+ "prefix": "#region",
+ "body": [
+ "#pragma region $0"
+ ],
+ "description": "Folding Region Start"
+ },
+ "Region End": {
+ "prefix": "#endregion",
+ "body": [
+ "#pragma endregion"
+ ],
+ "description": "Folding Region End"
+ }
+}
diff --git a/extensions/cpp/syntaxes/c.json b/extensions/cpp/syntaxes/c.json
index c81bd51eadc..d5143bd4901 100644
--- a/extensions/cpp/syntaxes/c.json
+++ b/extensions/cpp/syntaxes/c.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/atom/language-c/commit/0a57fd7ee32bd14e3ee8291434263d744a8ecf1e",
+ "version": "https://github.com/atom/language-c/commit/9c0c5f202741a5647025db8d5df5fefba47b036c",
"scopeName": "source.c",
"fileTypes": [
"c",
@@ -780,7 +780,7 @@
},
"patterns": [
{
- "begin": "\\G",
+ "begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?"],
["'", "'"],
["\"", "\""]
- ]
+ ],
+ "folding": {
+ "markers": {
+ "start": "^\\s*#region\\b",
+ "end": "^\\s*#endregion\\b"
+ }
+ }
}
\ No newline at end of file
diff --git a/extensions/csharp/package.json b/extensions/csharp/package.json
index 8bdbb161080..137ce2656d6 100644
--- a/extensions/csharp/package.json
+++ b/extensions/csharp/package.json
@@ -31,6 +31,10 @@
"scopeName": "source.cs",
"path": "./syntaxes/csharp.tmLanguage.json"
}
- ]
+ ],
+ "snippets": [{
+ "language": "csharp",
+ "path": "./snippets/csharp.json"
+ }]
}
}
\ No newline at end of file
diff --git a/extensions/csharp/snippets/csharp.json b/extensions/csharp/snippets/csharp.json
new file mode 100644
index 00000000000..5ad4bfca6c1
--- /dev/null
+++ b/extensions/csharp/snippets/csharp.json
@@ -0,0 +1,16 @@
+{
+ "Region Start": {
+ "prefix": "#region",
+ "body": [
+ "#region $0"
+ ],
+ "description": "Folding Region Start"
+ },
+ "Region End": {
+ "prefix": "#endregion",
+ "body": [
+ "#endregion"
+ ],
+ "description": "Folding Region End"
+ }
+}
diff --git a/extensions/csharp/syntaxes/csharp.tmLanguage.json b/extensions/csharp/syntaxes/csharp.tmLanguage.json
index 11d402b5e4c..9a96c9bbbee 100644
--- a/extensions/csharp/syntaxes/csharp.tmLanguage.json
+++ b/extensions/csharp/syntaxes/csharp.tmLanguage.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/dotnet/csharp-tmLanguage/commit/2f2152632650d427e99e261f093d52b807abc72d",
+ "version": "https://github.com/dotnet/csharp-tmLanguage/commit/436456ee5ce44e29cb1752c3b29f493b1de08c42",
"name": "C#",
"scopeName": "source.cs",
"fileTypes": [
@@ -229,6 +229,9 @@
{
"include": "#yield-statement"
},
+ {
+ "include": "#await-statement"
+ },
{
"include": "#try-statement"
},
@@ -1606,6 +1609,20 @@
}
}
},
+ "await-statement": {
+ "begin": "(? {
// register color provider
context.subscriptions.push(languages.registerColorProvider(documentSelector, {
- provideDocumentColors(document: TextDocument): Thenable {
- let params = client.code2ProtocolConverter.asDocumentSymbolParams(document);
+ provideDocumentColors(document: TextDocument): Thenable {
+ let params: DocumentColorParams = {
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)
+ };
return client.sendRequest(DocumentColorRequest.type, params).then(symbols => {
return symbols.map(symbol => {
let range = client.protocol2CodeConverter.asRange(symbol.range);
- let color = new Color(symbol.color.red * 255, symbol.color.green * 255, symbol.color.blue * 255, symbol.color.alpha);
- return new ColorRange(range, color, [CSSColorFormats.Hex, CSSColorFormats.RGB, CSSColorFormats.HSL]);
+ let color = new Color(symbol.color.red, symbol.color.green, symbol.color.blue, symbol.color.alpha);
+ return new ColorInformation(range, color);
+ });
+ });
+ },
+ provideColorPresentations(color: Color, context): ColorPresentation[] | Thenable {
+ let params: ColorPresentationParams = {
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(context.document),
+ color,
+ range: client.code2ProtocolConverter.asRange(context.range)
+ };
+ return client.sendRequest(ColorPresentationRequest.type, params).then(presentations => {
+ return presentations.map(p => {
+ let presentation = new ColorPresentation(p.label);
+ presentation.textEdit = p.textEdit && client.protocol2CodeConverter.asTextEdit(p.textEdit);
+ presentation.additionalTextEdits = p.additionalTextEdits && client.protocol2CodeConverter.asTextEdits(p.additionalTextEdits);
+ return presentation;
});
});
}
diff --git a/extensions/css/client/src/typings/color-convert.d.ts b/extensions/css/client/src/typings/color-convert.d.ts
new file mode 100644
index 00000000000..a88de674d2d
--- /dev/null
+++ b/extensions/css/client/src/typings/color-convert.d.ts
@@ -0,0 +1,11 @@
+declare module "color-convert" {
+ module convert {
+ module rgb {
+ function hex(r: number, g: number, b: number);
+ function hsl(r: number, g: number, b: number);
+ function hvs(r: number, g: number, b: number);
+ }
+ }
+
+ export = convert;
+}
\ No newline at end of file
diff --git a/extensions/css/client/tsconfig.json b/extensions/css/client/tsconfig.json
index e87d1a805a1..dc12dad6cf0 100644
--- a/extensions/css/client/tsconfig.json
+++ b/extensions/css/client/tsconfig.json
@@ -3,6 +3,7 @@
"target": "es5",
"module": "commonjs",
"outDir": "./out",
+ "noUnusedLocals": true,
"lib": [
"es5", "es2015.promise"
]
diff --git a/extensions/css/language-configuration.json b/extensions/css/language-configuration.json
index ae86befcd2a..bd3151ea17e 100644
--- a/extensions/css/language-configuration.json
+++ b/extensions/css/language-configuration.json
@@ -20,5 +20,11 @@
["(", ")"],
["\"", "\""],
["'", "'"]
- ]
-}
\ No newline at end of file
+ ],
+ "folding": {
+ "markers": {
+ "start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/",
+ "end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"
+ }
+ }
+}
diff --git a/extensions/css/npm-shrinkwrap.json b/extensions/css/npm-shrinkwrap.json
index d645e03b53f..05ef43dfbe8 100644
--- a/extensions/css/npm-shrinkwrap.json
+++ b/extensions/css/npm-shrinkwrap.json
@@ -3,24 +3,24 @@
"version": "0.1.0",
"dependencies": {
"vscode-jsonrpc": {
- "version": "3.3.1",
- "from": "vscode-jsonrpc@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.3.1.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-jsonrpc@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0-next.2.tgz"
},
"vscode-languageclient": {
- "version": "3.4.0-next.17",
- "from": "vscode-languageclient@next",
- "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.4.0-next.17.tgz"
+ "version": "3.5.0-next.4",
+ "from": "vscode-languageclient@3.5.0-next.4",
+ "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.5.0-next.4.tgz"
},
"vscode-languageserver-protocol": {
- "version": "3.1.1",
- "from": "vscode-languageserver-protocol@>=3.1.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.1.1.tgz"
+ "version": "3.5.0-next.5",
+ "from": "vscode-languageserver-protocol@3.5.0-next.5",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0-next.5.tgz"
},
"vscode-languageserver-types": {
- "version": "3.3.0",
- "from": "vscode-languageserver-types@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.3.0.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-languageserver-types@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0-next.2.tgz"
},
"vscode-nls": {
"version": "2.0.2",
diff --git a/extensions/css/package.json b/extensions/css/package.json
index 686dd900e0b..ccd73a979dd 100644
--- a/extensions/css/package.json
+++ b/extensions/css/package.json
@@ -50,698 +50,680 @@
"path": "./snippets/css.json"
}
],
- "configuration": {
- "order": 20,
- "allOf": [
- {
- "id": "css",
- "title": "CSS",
- "allOf": [
- {
- "title": "%css.validate.title%",
- "properties": {
- "css.validate": {
- "type": "boolean",
- "scope": "resource",
- "default": true,
- "description": "%css.validate.desc%"
- },
- "css.colorDecorators.enable": {
- "type": "boolean",
- "scope": "window",
- "default": true,
- "description": "%css.colorDecorators.enable.desc%",
- "deprecationMessage": "%css.colorDecorators.enable.deprecationMessage%"
- },
- "css.lint.compatibleVendorPrefixes": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.compatibleVendorPrefixes.desc%"
- },
- "css.lint.vendorPrefix": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%css.lint.vendorPrefix.desc%"
- },
- "css.lint.duplicateProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.duplicateProperties.desc%"
- },
- "css.lint.emptyRules": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%css.lint.emptyRules.desc%"
- },
- "css.lint.importStatement": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.importStatement.desc%"
- },
- "css.lint.boxModel": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.boxModel.desc%"
- },
- "css.lint.universalSelector": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.universalSelector.desc%"
- },
- "css.lint.zeroUnits": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.zeroUnits.desc%"
- },
- "css.lint.fontFaceProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%css.lint.fontFaceProperties.desc%"
- },
- "css.lint.hexColorLength": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "error",
- "description": "%css.lint.hexColorLength.desc%"
- },
- "css.lint.argumentsInColorFunction": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "error",
- "description": "%css.lint.argumentsInColorFunction.desc%"
- },
- "css.lint.unknownProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%css.lint.unknownProperties.desc%"
- },
- "css.lint.ieHack": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.ieHack.desc%"
- },
- "css.lint.unknownVendorSpecificProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.unknownVendorSpecificProperties.desc%"
- },
- "css.lint.propertyIgnoredDueToDisplay": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%css.lint.propertyIgnoredDueToDisplay.desc%"
- },
- "css.lint.important": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.important.desc%"
- },
- "css.lint.float": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.float.desc%"
- },
- "css.lint.idSelector": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%css.lint.idSelector.desc%"
- },
- "css.trace.server": {
- "type": "string",
- "scope": "window",
- "enum": [
- "off",
- "messages",
- "verbose"
- ],
- "default": "off",
- "description": "%css.trace.server.desc%"
- }
- }
- }
- ]
- },
- {
- "id": "scss",
- "order": 24,
- "title": "SCSS (Sass)",
- "allOf": [
- {
- "title": "%scss.validate.title%",
- "properties": {
- "scss.validate": {
- "type": "boolean",
- "scope": "resource",
- "default": true,
- "description": "%scss.validate.desc%"
- },
- "scss.colorDecorators.enable": {
- "type": "boolean",
- "scope": "window",
- "default": true,
- "description": "%scss.colorDecorators.enable.desc%",
- "deprecationMessage": "%scss.colorDecorators.enable.deprecationMessage%"
- },
- "scss.lint.compatibleVendorPrefixes": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.compatibleVendorPrefixes.desc%"
- },
- "scss.lint.vendorPrefix": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%scss.lint.vendorPrefix.desc%"
- },
- "scss.lint.duplicateProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.duplicateProperties.desc%"
- },
- "scss.lint.emptyRules": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%scss.lint.emptyRules.desc%"
- },
- "scss.lint.importStatement": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.importStatement.desc%"
- },
- "scss.lint.boxModel": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.boxModel.desc%"
- },
- "scss.lint.universalSelector": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.universalSelector.desc%"
- },
- "scss.lint.zeroUnits": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.zeroUnits.desc%"
- },
- "scss.lint.fontFaceProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%scss.lint.fontFaceProperties.desc%"
- },
- "scss.lint.hexColorLength": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "error",
- "description": "%scss.lint.hexColorLength.desc%"
- },
- "scss.lint.argumentsInColorFunction": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "error",
- "description": "%scss.lint.argumentsInColorFunction.desc%"
- },
- "scss.lint.unknownProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%scss.lint.unknownProperties.desc%"
- },
- "scss.lint.ieHack": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.ieHack.desc%"
- },
- "scss.lint.unknownVendorSpecificProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.unknownVendorSpecificProperties.desc%"
- },
- "scss.lint.propertyIgnoredDueToDisplay": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%scss.lint.propertyIgnoredDueToDisplay.desc%"
- },
- "scss.lint.important": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.important.desc%"
- },
- "scss.lint.float": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.float.desc%"
- },
- "scss.lint.idSelector": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%scss.lint.idSelector.desc%"
- }
- }
- }
- ]
- },
- {
- "id": "less",
- "order": 22,
- "type": "object",
- "title": "LESS",
- "allOf": [
- {
- "title": "%less.validate.title%",
- "properties": {
- "less.validate": {
- "type": "boolean",
- "scope": "resource",
- "default": true,
- "description": "%less.validate.desc%"
- },
- "less.colorDecorators.enable": {
- "type": "boolean",
- "scope": "window",
- "default": true,
- "description": "%less.colorDecorators.enable.desc%",
- "deprecationMessage": "%less.colorDecorators.enable.deprecationMessage%"
- },
- "less.lint.compatibleVendorPrefixes": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.compatibleVendorPrefixes.desc%"
- },
- "less.lint.vendorPrefix": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%less.lint.vendorPrefix.desc%"
- },
- "less.lint.duplicateProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.duplicateProperties.desc%"
- },
- "less.lint.emptyRules": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%less.lint.emptyRules.desc%"
- },
- "less.lint.importStatement": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.importStatement.desc%"
- },
- "less.lint.boxModel": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.boxModel.desc%"
- },
- "less.lint.universalSelector": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.universalSelector.desc%"
- },
- "less.lint.zeroUnits": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.zeroUnits.desc%"
- },
- "less.lint.fontFaceProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%less.lint.fontFaceProperties.desc%"
- },
- "less.lint.hexColorLength": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "error",
- "description": "%less.lint.hexColorLength.desc%"
- },
- "less.lint.argumentsInColorFunction": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "error",
- "description": "%less.lint.argumentsInColorFunction.desc%"
- },
- "less.lint.unknownProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%less.lint.unknownProperties.desc%"
- },
- "less.lint.ieHack": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.ieHack.desc%"
- },
- "less.lint.unknownVendorSpecificProperties": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.unknownVendorSpecificProperties.desc%"
- },
- "less.lint.propertyIgnoredDueToDisplay": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "warning",
- "description": "%less.lint.propertyIgnoredDueToDisplay.desc%"
- },
- "less.lint.important": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.important.desc%"
- },
- "less.lint.float": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.float.desc%"
- },
- "less.lint.idSelector": {
- "type": "string",
- "scope": "resource",
- "enum": [
- "ignore",
- "warning",
- "error"
- ],
- "default": "ignore",
- "description": "%less.lint.idSelector.desc%"
- }
- }
- }
- ]
+ "configuration": [
+ {
+ "order": 22,
+ "id": "css",
+ "title": "%css.title%",
+ "properties": {
+ "css.validate": {
+ "type": "boolean",
+ "scope": "resource",
+ "default": true,
+ "description": "%css.validate.desc%"
+ },
+ "css.colorDecorators.enable": {
+ "type": "boolean",
+ "scope": "window",
+ "default": true,
+ "description": "%css.colorDecorators.enable.desc%",
+ "deprecationMessage": "%css.colorDecorators.enable.deprecationMessage%"
+ },
+ "css.lint.compatibleVendorPrefixes": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.compatibleVendorPrefixes.desc%"
+ },
+ "css.lint.vendorPrefix": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%css.lint.vendorPrefix.desc%"
+ },
+ "css.lint.duplicateProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.duplicateProperties.desc%"
+ },
+ "css.lint.emptyRules": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%css.lint.emptyRules.desc%"
+ },
+ "css.lint.importStatement": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.importStatement.desc%"
+ },
+ "css.lint.boxModel": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.boxModel.desc%"
+ },
+ "css.lint.universalSelector": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.universalSelector.desc%"
+ },
+ "css.lint.zeroUnits": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.zeroUnits.desc%"
+ },
+ "css.lint.fontFaceProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%css.lint.fontFaceProperties.desc%"
+ },
+ "css.lint.hexColorLength": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "error",
+ "description": "%css.lint.hexColorLength.desc%"
+ },
+ "css.lint.argumentsInColorFunction": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "error",
+ "description": "%css.lint.argumentsInColorFunction.desc%"
+ },
+ "css.lint.unknownProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%css.lint.unknownProperties.desc%"
+ },
+ "css.lint.ieHack": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.ieHack.desc%"
+ },
+ "css.lint.unknownVendorSpecificProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.unknownVendorSpecificProperties.desc%"
+ },
+ "css.lint.propertyIgnoredDueToDisplay": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%css.lint.propertyIgnoredDueToDisplay.desc%"
+ },
+ "css.lint.important": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.important.desc%"
+ },
+ "css.lint.float": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.float.desc%"
+ },
+ "css.lint.idSelector": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%css.lint.idSelector.desc%"
+ },
+ "css.trace.server": {
+ "type": "string",
+ "scope": "window",
+ "enum": [
+ "off",
+ "messages",
+ "verbose"
+ ],
+ "default": "off",
+ "description": "%css.trace.server.desc%"
+ }
}
- ]
- }
+ },
+ {
+ "id": "scss",
+ "order": 24,
+ "title": "%scss.title%",
+ "properties": {
+ "scss.validate": {
+ "type": "boolean",
+ "scope": "resource",
+ "default": true,
+ "description": "%scss.validate.desc%"
+ },
+ "scss.colorDecorators.enable": {
+ "type": "boolean",
+ "scope": "window",
+ "default": true,
+ "description": "%scss.colorDecorators.enable.desc%",
+ "deprecationMessage": "%scss.colorDecorators.enable.deprecationMessage%"
+ },
+ "scss.lint.compatibleVendorPrefixes": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.compatibleVendorPrefixes.desc%"
+ },
+ "scss.lint.vendorPrefix": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%scss.lint.vendorPrefix.desc%"
+ },
+ "scss.lint.duplicateProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.duplicateProperties.desc%"
+ },
+ "scss.lint.emptyRules": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%scss.lint.emptyRules.desc%"
+ },
+ "scss.lint.importStatement": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.importStatement.desc%"
+ },
+ "scss.lint.boxModel": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.boxModel.desc%"
+ },
+ "scss.lint.universalSelector": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.universalSelector.desc%"
+ },
+ "scss.lint.zeroUnits": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.zeroUnits.desc%"
+ },
+ "scss.lint.fontFaceProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%scss.lint.fontFaceProperties.desc%"
+ },
+ "scss.lint.hexColorLength": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "error",
+ "description": "%scss.lint.hexColorLength.desc%"
+ },
+ "scss.lint.argumentsInColorFunction": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "error",
+ "description": "%scss.lint.argumentsInColorFunction.desc%"
+ },
+ "scss.lint.unknownProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%scss.lint.unknownProperties.desc%"
+ },
+ "scss.lint.ieHack": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.ieHack.desc%"
+ },
+ "scss.lint.unknownVendorSpecificProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.unknownVendorSpecificProperties.desc%"
+ },
+ "scss.lint.propertyIgnoredDueToDisplay": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%scss.lint.propertyIgnoredDueToDisplay.desc%"
+ },
+ "scss.lint.important": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.important.desc%"
+ },
+ "scss.lint.float": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.float.desc%"
+ },
+ "scss.lint.idSelector": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%scss.lint.idSelector.desc%"
+ }
+ }
+ },
+ {
+ "id": "less",
+ "order": 23,
+ "type": "object",
+ "title": "%less.title%",
+ "properties": {
+ "less.validate": {
+ "type": "boolean",
+ "scope": "resource",
+ "default": true,
+ "description": "%less.validate.desc%"
+ },
+ "less.colorDecorators.enable": {
+ "type": "boolean",
+ "scope": "window",
+ "default": true,
+ "description": "%less.colorDecorators.enable.desc%",
+ "deprecationMessage": "%less.colorDecorators.enable.deprecationMessage%"
+ },
+ "less.lint.compatibleVendorPrefixes": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.compatibleVendorPrefixes.desc%"
+ },
+ "less.lint.vendorPrefix": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%less.lint.vendorPrefix.desc%"
+ },
+ "less.lint.duplicateProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.duplicateProperties.desc%"
+ },
+ "less.lint.emptyRules": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%less.lint.emptyRules.desc%"
+ },
+ "less.lint.importStatement": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.importStatement.desc%"
+ },
+ "less.lint.boxModel": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.boxModel.desc%"
+ },
+ "less.lint.universalSelector": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.universalSelector.desc%"
+ },
+ "less.lint.zeroUnits": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.zeroUnits.desc%"
+ },
+ "less.lint.fontFaceProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%less.lint.fontFaceProperties.desc%"
+ },
+ "less.lint.hexColorLength": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "error",
+ "description": "%less.lint.hexColorLength.desc%"
+ },
+ "less.lint.argumentsInColorFunction": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "error",
+ "description": "%less.lint.argumentsInColorFunction.desc%"
+ },
+ "less.lint.unknownProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%less.lint.unknownProperties.desc%"
+ },
+ "less.lint.ieHack": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.ieHack.desc%"
+ },
+ "less.lint.unknownVendorSpecificProperties": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.unknownVendorSpecificProperties.desc%"
+ },
+ "less.lint.propertyIgnoredDueToDisplay": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "warning",
+ "description": "%less.lint.propertyIgnoredDueToDisplay.desc%"
+ },
+ "less.lint.important": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.important.desc%"
+ },
+ "less.lint.float": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.float.desc%"
+ },
+ "less.lint.idSelector": {
+ "type": "string",
+ "scope": "resource",
+ "enum": [
+ "ignore",
+ "warning",
+ "error"
+ ],
+ "default": "ignore",
+ "description": "%less.lint.idSelector.desc%"
+ }
+ }
+ }
+ ]
},
"dependencies": {
- "vscode-languageclient": "3.4.0-next.17",
- "vscode-languageserver-protocol": "^3.1.1",
+ "vscode-languageclient": "3.5.0-next.4",
"vscode-nls": "^2.0.2"
},
"devDependencies": {
- "@types/node": "^6.0.51"
+ "@types/node": "7.0.43"
}
}
diff --git a/extensions/css/package.nls.json b/extensions/css/package.nls.json
index b2a7126c30d..33fbf6d5c28 100644
--- a/extensions/css/package.nls.json
+++ b/extensions/css/package.nls.json
@@ -1,4 +1,5 @@
{
+ "css.title": "CSS",
"css.lint.argumentsInColorFunction.desc": "Invalid number of parameters",
"css.lint.boxModel.desc": "Do not use width or height when using padding or border",
"css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties",
@@ -20,6 +21,7 @@
"css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.",
"css.validate.title": "Controls CSS validation and problem severities.",
"css.validate.desc": "Enables or disables all validations",
+ "less.title": "LESS",
"less.lint.argumentsInColorFunction.desc": "Invalid number of parameters",
"less.lint.boxModel.desc": "Do not use width or height when using padding or border",
"less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties",
@@ -40,6 +42,7 @@
"less.lint.zeroUnits.desc": "No unit for zero needed",
"less.validate.title": "Controls LESS validation and problem severities.",
"less.validate.desc": "Enables or disables all validations",
+ "scss.title": "SCSS (Sass)",
"scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters",
"scss.lint.boxModel.desc": "Do not use width or height when using padding or border",
"scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties",
diff --git a/extensions/css/server/.vscode/launch.json b/extensions/css/server/.vscode/launch.json
index a09436fd912..764c1456f17 100644
--- a/extensions/css/server/.vscode/launch.json
+++ b/extensions/css/server/.vscode/launch.json
@@ -8,25 +8,25 @@
"request": "attach",
"port": 6004,
"sourceMaps": true,
- "outDir": "${workspaceRoot}/out"
+ "outDir": "${workspaceFolder}/out"
},
{
"name": "Unit Tests",
"type": "node",
"request": "launch",
- "program": "${workspaceRoot}/../../../node_modules/mocha/bin/_mocha",
+ "program": "${workspaceFolder}/../../../node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--timeout",
"999999",
"--colors"
],
- "cwd": "${workspaceRoot}",
+ "cwd": "${workspaceFolder}",
"runtimeExecutable": null,
"runtimeArgs": [],
"env": {},
"sourceMaps": true,
- "outDir": "${workspaceRoot}/out"
+ "outDir": "${workspaceFolder}/out"
}
]
}
\ No newline at end of file
diff --git a/extensions/css/server/npm-shrinkwrap.json b/extensions/css/server/npm-shrinkwrap.json
index eeafae21433..9c575943a3e 100644
--- a/extensions/css/server/npm-shrinkwrap.json
+++ b/extensions/css/server/npm-shrinkwrap.json
@@ -3,29 +3,29 @@
"version": "1.0.0",
"dependencies": {
"vscode-css-languageservice": {
- "version": "2.1.4",
- "from": "vscode-css-languageservice@next",
- "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.4.tgz"
+ "version": "3.0.0",
+ "from": "vscode-css-languageservice@3.0.0",
+ "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-3.0.0.tgz"
},
"vscode-jsonrpc": {
- "version": "3.3.1",
- "from": "vscode-jsonrpc@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.3.1.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-jsonrpc@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0-next.2.tgz"
},
"vscode-languageserver": {
- "version": "3.4.0-next.6",
- "from": "vscode-languageserver@next",
- "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.4.0-next.6.tgz"
+ "version": "3.5.0-next.6",
+ "from": "vscode-languageserver@3.5.0-next.6",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.5.0-next.6.tgz"
},
"vscode-languageserver-protocol": {
- "version": "3.1.1",
- "from": "vscode-languageserver-protocol@>=3.1.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.1.1.tgz"
+ "version": "3.5.0-next.5",
+ "from": "vscode-languageserver-protocol@3.5.0-next.5",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0-next.5.tgz"
},
"vscode-languageserver-types": {
- "version": "3.3.0",
- "from": "vscode-languageserver-types@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.3.0.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-languageserver-types@3.5.0-next.2d",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0-next.2.tgz"
},
"vscode-nls": {
"version": "2.0.2",
diff --git a/extensions/css/server/package.json b/extensions/css/server/package.json
index ad6c972e571..f937b8a10fd 100644
--- a/extensions/css/server/package.json
+++ b/extensions/css/server/package.json
@@ -8,12 +8,11 @@
"node": "*"
},
"dependencies": {
- "vscode-css-languageservice": "^2.1.4",
- "vscode-languageserver": "3.4.0-next.6",
- "vscode-languageserver-protocol": "^3.1.1"
+ "vscode-css-languageservice": "3.0.0",
+ "vscode-languageserver": "3.5.0-next.6"
},
"devDependencies": {
- "@types/node": "^6.0.51"
+ "@types/node": "7.0.43"
},
"scripts": {
"compile": "gulp compile-extension:css-server",
diff --git a/extensions/css/server/src/cssServerMain.ts b/extensions/css/server/src/cssServerMain.ts
index 0f4e8873e98..28837487764 100644
--- a/extensions/css/server/src/cssServerMain.ts
+++ b/extensions/css/server/src/cssServerMain.ts
@@ -5,11 +5,13 @@
'use strict';
import {
- createConnection, IConnection, TextDocuments, TextDocument, InitializeParams, InitializeResult, ServerCapabilities
+ createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult, ServerCapabilities
} from 'vscode-languageserver';
-import { GetConfigurationRequest } from 'vscode-languageserver-protocol/lib/protocol.configuration.proposed';
-import { DocumentColorRequest, ServerCapabilities as CPServerCapabilities } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
+import { TextDocument } from 'vscode-languageserver-types';
+
+import { ConfigurationRequest } from 'vscode-languageserver-protocol/lib/protocol.configuration.proposed';
+import { DocumentColorRequest, ServerCapabilities as CPServerCapabilities, ColorPresentationRequest } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
import { getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, LanguageSettings, LanguageService, Stylesheet } from 'vscode-css-languageservice';
import { getLanguageModelCache } from './languageModelCache';
@@ -96,7 +98,7 @@ function getDocumentSettings(textDocument: TextDocument): Thenable s[0]);
+ promise = connection.sendRequest(ConfigurationRequest.type, configRequestParam).then(s => s[0]);
documentSettings[textDocument.uri] = promise;
}
return promise;
@@ -211,6 +213,15 @@ connection.onRequest(DocumentColorRequest.type, params => {
return [];
});
+connection.onRequest(ColorPresentationRequest.type, params => {
+ let document = documents.get(params.textDocument.uri);
+ if (document) {
+ let stylesheet = stylesheets.get(document);
+ return getLanguageService(document).getColorPresentations(document, stylesheet, params.color, params.range);
+ }
+ return [];
+});
+
connection.onRenameRequest(renameParameters => {
let document = documents.get(renameParameters.textDocument.uri);
let stylesheet = stylesheets.get(document);
diff --git a/extensions/css/server/tsconfig.json b/extensions/css/server/tsconfig.json
index 8e862f02646..6092871c85b 100644
--- a/extensions/css/server/tsconfig.json
+++ b/extensions/css/server/tsconfig.json
@@ -3,6 +3,7 @@
"target": "es5",
"module": "commonjs",
"outDir": "./out",
+ "noUnusedLocals": true,
"lib": [
"es5"
]
diff --git a/extensions/css/syntaxes/css.tmLanguage.json b/extensions/css/syntaxes/css.tmLanguage.json
index 52c5eec1308..95caf371210 100644
--- a/extensions/css/syntaxes/css.tmLanguage.json
+++ b/extensions/css/syntaxes/css.tmLanguage.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/atom/language-css/commit/02c1eb4e0d45f021694cf1825f6e2040872f3599",
+ "version": "https://github.com/atom/language-css/commit/ec289867164a34fce48a69776b7f8dc380e3dc37",
"scopeName": "source.css",
"name": "CSS",
"fileTypes": [
@@ -670,7 +670,8 @@
"name": "constant.character.escape.codepoint.css"
},
{
- "match": "\\\\$\\n?",
+ "begin": "\\\\$\\s*",
+ "end": "^(?=1.0.17 <2.0.0",
- "resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-1.1.7.tgz"
+ "version": "1.1.17",
+ "from": "vscode-emmet-helper@>=1.1.17 <2.0.0",
+ "resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-1.1.17.tgz"
},
"vscode-languageserver-types": {
"version": "3.3.0",
@@ -53,4 +53,4 @@
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz"
}
}
-}
+}
\ No newline at end of file
diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json
index 31de43eb8bf..8dd6947b175 100644
--- a/extensions/emmet/package.json
+++ b/extensions/emmet/package.json
@@ -15,7 +15,12 @@
"url": "https://github.com/Microsoft/vscode-emmet"
},
"activationEvents": [
- "*"
+ "*",
+ "onCommand:emmet.expandAbbreviation",
+ "onLanguage:html",
+ "onLanguage:css",
+ "onLanguage:scss",
+ "onLanguage:less"
],
"main": "./out/extension",
"contributes": {
@@ -126,6 +131,34 @@
"type": "string",
"default": " ",
"description": "%emmetPreferencesStylusBetween%"
+ },
+ "bem.elementSeparator": {
+ "type": "string",
+ "default": "__",
+ "description": "%emmetPreferencesBemElementSeparator%"
+ },
+ "bem.modifierSeparator": {
+ "type": "string",
+ "default": "_",
+ "description": "%emmetPreferencesBemModifierSeparator%"
+ },
+ "filter.commentBefore": {
+ "type": "string",
+ "default": "",
+ "description": "%emmetPreferencesFilterCommentBefore%"
+ },
+ "filter.commentAfter": {
+ "type": "string",
+ "default": "\n",
+ "description": "%emmetPreferencesFilterCommentAfter%"
+ },
+ "filter.commentTrigger": {
+ "type": "array",
+ "default": [
+ "id",
+ "class"
+ ],
+ "description": "%emmetPreferencesFilterCommentTrigger%"
}
}
},
@@ -258,16 +291,16 @@
"compile": "gulp compile-extension:emmet"
},
"devDependencies": {
- "@types/node": "^7.0.4",
+ "@types/node": "7.0.43",
"vscode": "1.0.1"
},
"dependencies": {
"@emmetio/html-matcher": "^0.3.1",
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
"@emmetio/math-expression": "^0.1.1",
- "vscode-emmet-helper": "^1.1.7",
+ "vscode-emmet-helper": "^1.1.17",
"vscode-languageserver-types": "^3.0.3",
"image-size": "^0.5.2",
"vscode-nls": "2.0.2"
}
-}
\ No newline at end of file
+}
diff --git a/extensions/emmet/package.nls.json b/extensions/emmet/package.nls.json
index 4d63301d0ac..07ffacf4b44 100644
--- a/extensions/emmet/package.nls.json
+++ b/extensions/emmet/package.nls.json
@@ -23,13 +23,13 @@
"command.incrementNumberByTen": "Increment by 10",
"command.decrementNumberByTen": "Decrement by 10",
"emmetSyntaxProfiles": "Define profile for specified syntax or use your own profile with specific rules.",
- "emmetExclude": "An array of languages where emmet abbreviations should not be expanded.",
- "emmetExtensionsPath": "Path to a folder containing emmet profiles and snippets.'",
- "emmetShowExpandedAbbreviation": "Shows expanded emmet abbreviations as suggestions.\nThe option \"inMarkupAndStylesheetFilesOnly\" applies to html, haml, jade, slim, xml, xsl, css, scss, sass, less and stylus.\nThe option \"always\" applies to all parts of the file regardless of markup/css.",
- "emmetShowAbbreviationSuggestions": "Shows possible emmet abbreviations as suggestions. Not applicable in stylesheets or when emmet.showExpandedAbbreviation is set to \"never\".",
- "emmetIncludeLanguages": "Enable emmet abbreviations in languages that are not supported by default. Add a mapping here between the language and emmet supported language.\n Eg: {\"vue-html\": \"html\", \"javascript\": \"javascriptreact\"}",
- "emmetVariables": "Variables to be used in emmet snippets",
- "emmetTriggerExpansionOnTab": "When enabled, emmet abbreviations are expanded when pressing TAB.",
+ "emmetExclude": "An array of languages where Emmet abbreviations should not be expanded.",
+ "emmetExtensionsPath": "Path to a folder containing Emmet profiles and snippets.'",
+ "emmetShowExpandedAbbreviation": "Shows expanded Emmet abbreviations as suggestions.\nThe option \"inMarkupAndStylesheetFilesOnly\" applies to html, haml, jade, slim, xml, xsl, css, scss, sass, less and stylus.\nThe option \"always\" applies to all parts of the file regardless of markup/css.",
+ "emmetShowAbbreviationSuggestions": "Shows possible Emmet abbreviations as suggestions. Not applicable in stylesheets or when emmet.showExpandedAbbreviation is set to \"never\".",
+ "emmetIncludeLanguages": "Enable Emmet abbreviations in languages that are not supported by default. Add a mapping here between the language and emmet supported language.\n Eg: {\"vue-html\": \"html\", \"javascript\": \"javascriptreact\"}",
+ "emmetVariables": "Variables to be used in Emmet snippets",
+ "emmetTriggerExpansionOnTab": "When enabled, Emmet abbreviations are expanded when pressing TAB.",
"emmetPreferences": "Preferences used to modify behavior of some actions and resolvers of Emmet.",
"emmetPreferencesIntUnit": "Default unit for integer values",
"emmetPreferencesFloatUnit": "Default unit for float values",
@@ -39,5 +39,10 @@
"emmetPreferencesCssBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations",
"emmetPreferencesSassBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations in Sass files",
"emmetPreferencesStylusBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations in Stylus files",
- "emmetShowSuggestionsAsSnippets": "If true, then emmet suggestions will show up as snippets allowing you to order them as per editor.snippetSuggestions setting."
-}
\ No newline at end of file
+ "emmetShowSuggestionsAsSnippets": "If true, then Emmet suggestions will show up as snippets allowing you to order them as per editor.snippetSuggestions setting.",
+ "emmetPreferencesBemElementSeparator": "Element separator used for classes when using the BEM filter",
+ "emmetPreferencesBemModifierSeparator": "Modifier separator used for classes when using the BEM filter",
+ "emmetPreferencesFilterCommentBefore": "A definition of comment that should be placed before matched element when comment filter is applied.",
+ "emmetPreferencesFilterCommentAfter": "A definition of comment that should be placed after matched element when comment filter is applied.",
+ "emmetPreferencesFilterCommentTrigger": "A comma-separated list of attribute names that should exist in abbreviation for the comment filter to be applied"
+}
diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts
index 5d341c2c636..0224594a33e 100644
--- a/extensions/emmet/src/abbreviationActions.ts
+++ b/extensions/emmet/src/abbreviationActions.ts
@@ -5,8 +5,7 @@
import * as vscode from 'vscode';
import { Node, HtmlNode, Rule } from 'EmmetNode';
-import { getNode, getInnerRange, getMappingForIncludedLanguages, parseDocument, validate, getEmmetConfiguration } from './util';
-import { getExpandOptions, extractAbbreviation, extractAbbreviationFromText, isStyleSheet, isAbbreviationValid, getEmmetMode, expandAbbreviation } from 'vscode-emmet-helper';
+import { getEmmetHelper, getNode, getInnerRange, getMappingForIncludedLanguages, parseDocument, validate, getEmmetConfiguration, isStyleSheet, getEmmetMode } from './util';
const trimRegex = /[\u00a0]*[\d|#|\-|\*|\u2022]+\.?/;
@@ -18,17 +17,18 @@ interface ExpandAbbreviationInput {
filter?: string;
}
-export function wrapWithAbbreviation(args) {
- if (!validate(false)) {
+export function wrapWithAbbreviation(args: any) {
+ if (!validate(false) || !vscode.window.activeTextEditor) {
return;
}
const editor = vscode.window.activeTextEditor;
const abbreviationPromise = (args && args['abbreviation']) ? Promise.resolve(args['abbreviation']) : vscode.window.showInputBox({ prompt: 'Enter Abbreviation' });
const syntax = getSyntaxFromArgs({ language: editor.document.languageId });
+ const helper = getEmmetHelper();
return abbreviationPromise.then(abbreviation => {
- if (!abbreviation || !abbreviation.trim() || !isAbbreviationValid(syntax, abbreviation)) { return; }
+ if (!abbreviation || !abbreviation.trim() || !helper.isAbbreviationValid(syntax, abbreviation)) { return; }
let expandAbbrList: ExpandAbbreviationInput[] = [];
@@ -50,8 +50,8 @@ export function wrapWithAbbreviation(args) {
});
}
-export function wrapIndividualLinesWithAbbreviation(args) {
- if (!validate(false)) {
+export function wrapIndividualLinesWithAbbreviation(args: any) {
+ if (!validate(false) || !vscode.window.activeTextEditor) {
return;
}
@@ -64,11 +64,12 @@ export function wrapIndividualLinesWithAbbreviation(args) {
const abbreviationPromise = (args && args['abbreviation']) ? Promise.resolve(args['abbreviation']) : vscode.window.showInputBox({ prompt: 'Enter Abbreviation' });
const syntax = getSyntaxFromArgs({ language: editor.document.languageId });
const lines = editor.document.getText(editor.selection).split('\n').map(x => x.trim());
+ const helper = getEmmetHelper();
return abbreviationPromise.then(inputAbbreviation => {
- if (!inputAbbreviation || !inputAbbreviation.trim() || !isAbbreviationValid(syntax, inputAbbreviation)) { return; }
+ if (!inputAbbreviation || !inputAbbreviation.trim() || !helper.isAbbreviationValid(syntax, inputAbbreviation)) { return; }
- let extractedResults = extractAbbreviationFromText(inputAbbreviation);
+ let extractedResults = helper.extractAbbreviationFromText(inputAbbreviation);
if (!extractedResults) {
return;
}
@@ -87,7 +88,7 @@ export function wrapIndividualLinesWithAbbreviation(args) {
}
-export function expandEmmetAbbreviation(args): Thenable {
+export function expandEmmetAbbreviation(args: any): Thenable {
const syntax = getSyntaxFromArgs(args);
if (!syntax || !validate()) {
return fallbackTab();
@@ -105,12 +106,13 @@ export function expandEmmetAbbreviation(args): Thenable {
let abbreviationList: ExpandAbbreviationInput[] = [];
let firstAbbreviation: string;
let allAbbreviationsSame: boolean = true;
+ const helper = getEmmetHelper();
let getAbbreviation = (document: vscode.TextDocument, selection: vscode.Selection, position: vscode.Position, syntax: string): [vscode.Range, string, string] => {
let rangeToReplace: vscode.Range = selection;
let abbr = document.getText(rangeToReplace);
if (!rangeToReplace.isEmpty) {
- let extractedResults = extractAbbreviationFromText(abbr);
+ let extractedResults = helper.extractAbbreviationFromText(abbr);
if (extractedResults) {
return [rangeToReplace, extractedResults.abbreviation, extractedResults.filter];
}
@@ -130,7 +132,7 @@ export function expandEmmetAbbreviation(args): Thenable {
return [rangeToReplace, abbr, ''];
}
}
- let extractedResults = extractAbbreviation(editor.document, position, false);
+ let extractedResults = helper.extractAbbreviation(editor.document, position, false);
if (!extractedResults) {
return [null, '', ''];
}
@@ -139,17 +141,24 @@ export function expandEmmetAbbreviation(args): Thenable {
return [new vscode.Range(abbreviationRange.start.line, abbreviationRange.start.character, abbreviationRange.end.line, abbreviationRange.end.character), abbreviation, filter];
};
- editor.selections.forEach(selection => {
+ let selectionsInReverseOrder = editor.selections.slice(0);
+ selectionsInReverseOrder.sort((a, b) => {
+ var posA = a.isReversed ? a.anchor : a.active;
+ var posB = b.isReversed ? b.anchor : b.active;
+ return posA.compareTo(posB) * -1;
+ });
+
+ selectionsInReverseOrder.forEach(selection => {
let position = selection.isReversed ? selection.anchor : selection.active;
let [rangeToReplace, abbreviation, filter] = getAbbreviation(editor.document, selection, position, syntax);
if (!rangeToReplace) {
return;
}
- if (!isAbbreviationValid(syntax, abbreviation)) {
+ if (!helper.isAbbreviationValid(syntax, abbreviation)) {
return;
}
- let currentNode = getNode(rootNode, position);
+ let currentNode = getNode(rootNode, position, true);
if (!isValidLocationForEmmetAbbreviation(currentNode, syntax, position)) {
return;
}
@@ -170,7 +179,7 @@ export function expandEmmetAbbreviation(args): Thenable {
});
}
-function fallbackTab(): Thenable {
+function fallbackTab(): Thenable | undefined {
if (vscode.workspace.getConfiguration('emmet')['triggerExpansionOnTab'] === true) {
return vscode.commands.executeCommand('tab');
}
@@ -189,7 +198,6 @@ export function isValidLocationForEmmetAbbreviation(currentNode: Node, syntax: s
}
if (isStyleSheet(syntax)) {
-
// If current node is a rule or at-rule, then perform additional checks to ensure
// emmet suggestions are not provided in the rule selector
if (currentNode.type !== 'rule' && currentNode.type !== 'at-rule') {
@@ -218,7 +226,8 @@ export function isValidLocationForEmmetAbbreviation(currentNode: Node, syntax: s
const currentHtmlNode = currentNode;
if (currentHtmlNode.close) {
- return getInnerRange(currentHtmlNode).contains(position);
+ const innerRange = getInnerRange(currentHtmlNode);
+ return !!innerRange && innerRange.contains(position);
}
return false;
@@ -239,7 +248,7 @@ function expandAbbreviationInRange(editor: vscode.TextEditor, expandAbbrList: Ex
// 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
- let insertPromises = [];
+ let insertPromises: Thenable[] = [];
if (!insertSameSnippet) {
expandAbbrList.forEach((expandAbbrInput: ExpandAbbreviationInput) => {
let expandedText = expandAbbr(expandAbbrInput);
@@ -270,8 +279,9 @@ function expandAbbreviationInRange(editor: vscode.TextEditor, expandAbbrList: Ex
/**
* Expands abbreviation as detailed in given input.
*/
-function expandAbbr(input: ExpandAbbreviationInput): string {
- const expandOptions = getExpandOptions(input.syntax, getEmmetConfiguration(input.syntax), input.filter);
+function expandAbbr(input: ExpandAbbreviationInput): string | undefined {
+ const helper = getEmmetHelper();
+ const expandOptions = helper.getExpandOptions(input.syntax, getEmmetConfiguration(input.syntax), input.filter);
if (input.textToWrap) {
if (input.filter && input.filter.indexOf('t') > -1) {
@@ -291,7 +301,7 @@ function expandAbbr(input: ExpandAbbreviationInput): string {
try {
// Expand the abbreviation
- let expandedText = expandAbbreviation(input.abbreviation, expandOptions);
+ let expandedText = helper.expandAbbreviation(input.abbreviation, expandOptions);
if (input.textToWrap) {
// All $anyword would have been escaped by the emmet helper.
@@ -313,7 +323,7 @@ function expandAbbr(input: ExpandAbbreviationInput): string {
}
-function getSyntaxFromArgs(args: any): string {
+function getSyntaxFromArgs(args: any): string | undefined {
let editor = vscode.window.activeTextEditor;
if (!editor) {
vscode.window.showInformationMessage('No editor is active.');
diff --git a/extensions/emmet/src/balance.ts b/extensions/emmet/src/balance.ts
index 22474be22dd..2d4917994ae 100644
--- a/extensions/emmet/src/balance.ts
+++ b/extensions/emmet/src/balance.ts
@@ -16,11 +16,10 @@ export function balanceIn() {
}
function balance(out: boolean) {
- let editor = vscode.window.activeTextEditor;
- if (!validate(false)) {
+ if (!validate(false) || !vscode.window.activeTextEditor) {
return;
}
-
+ const editor = vscode.window.activeTextEditor;
let rootNode = parseDocument(editor.document);
if (!rootNode) {
return;
@@ -30,7 +29,7 @@ function balance(out: boolean) {
let newSelections: vscode.Selection[] = [];
editor.selections.forEach(selection => {
let range = getRangeFunction(editor.document, selection, rootNode);
- newSelections.push(range ? range : selection);
+ newSelections.push(range);
});
editor.selection = newSelections[0];
@@ -40,7 +39,7 @@ function balance(out: boolean) {
function getRangeToBalanceOut(document: vscode.TextDocument, selection: vscode.Selection, rootNode: HtmlNode): vscode.Selection {
let nodeToBalance = getNode(rootNode, selection.start);
if (!nodeToBalance) {
- return;
+ return selection;
}
if (!nodeToBalance.close) {
return new vscode.Selection(nodeToBalance.start, nodeToBalance.end);
@@ -55,13 +54,13 @@ function getRangeToBalanceOut(document: vscode.TextDocument, selection: vscode.S
if (outerSelection.contains(selection) && !outerSelection.isEqual(selection)) {
return outerSelection;
}
- return;
+ return selection;
}
function getRangeToBalanceIn(document: vscode.TextDocument, selection: vscode.Selection, rootNode: HtmlNode): vscode.Selection {
let nodeToBalance = getNode(rootNode, selection.start, true);
if (!nodeToBalance) {
- return;
+ return selection;
}
if (selection.start.isEqual(nodeToBalance.start)
@@ -71,7 +70,7 @@ function getRangeToBalanceIn(document: vscode.TextDocument, selection: vscode.Se
}
if (!nodeToBalance.firstChild) {
- return;
+ return selection;
}
if (selection.start.isEqual(nodeToBalance.firstChild.start)
diff --git a/extensions/emmet/src/bufferStream.ts b/extensions/emmet/src/bufferStream.ts
index a7a6cd5a0d2..3ab9d9c2eab 100644
--- a/extensions/emmet/src/bufferStream.ts
+++ b/extensions/emmet/src/bufferStream.ts
@@ -43,20 +43,16 @@ export class DocumentStreamReader {
/**
* 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) {
+ limit(start: Position, end: Position): DocumentStreamReader {
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() {
+ peek(): number {
if (this.eof()) {
return NaN;
}
@@ -67,9 +63,8 @@ export class DocumentStreamReader {
/**
* Returns the next character in the stream and advances it.
* Also returns NaN when no more characters are available.
- * @returns {Number}
*/
- next() {
+ next(): number {
if (this.eof()) {
return NaN;
}
@@ -95,9 +90,8 @@ export class DocumentStreamReader {
/**
* 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) {
+ backUp(n: number) {
let row = this.pos.line;
let column = this.pos.character;
column -= (n || 1);
@@ -117,28 +111,22 @@ export class DocumentStreamReader {
/**
* Get the string between the start of the current token and the
* current stream position.
- * @returns {String}
*/
- current() {
+ current(): string {
return this.substring(this.start, this.pos);
}
/**
* Returns contents for given range
- * @param {Position} from
- * @param {Position} to
- * @return {String}
*/
- substring(from, to) {
+ substring(from: Position, to: Position): string {
return this.document.getText(new Range(from, to));
}
/**
* Creates error object with current stream state
- * @param {String} message
- * @return {Error}
*/
- error(message) {
+ error(message: string): Error {
const err = new Error(`${message} at row ${this.pos.line}, column ${this.pos.character}`);
return err;
@@ -146,10 +134,8 @@ export class DocumentStreamReader {
/**
* Returns line length of given row, including line ending
- * @param {Number} row
- * @return {Number}
*/
- _lineLength(row) {
+ _lineLength(row: number): number {
if (row === this.document.lineCount - 1) {
return this.document.lineAt(row).text.length;
}
@@ -161,10 +147,8 @@ export class DocumentStreamReader {
* 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) {
+ eat(match: number | Function): boolean {
const ch = this.peek();
const ok = typeof match === 'function' ? match(ch) : ch === match;
@@ -178,10 +162,8 @@ export class DocumentStreamReader {
/**
* Repeatedly calls eat with the given argument, until it
* fails. Returns true if any characters were eaten.
- * @param {Object} match
- * @returns {Boolean}
*/
- eatWhile(match) {
+ eatWhile(match: number | Function): boolean {
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
index 5c78aea06a0..ad6f548bd9f 100644
--- a/extensions/emmet/src/defaultCompletionProvider.ts
+++ b/extensions/emmet/src/defaultCompletionProvider.ts
@@ -5,13 +5,14 @@
import * as vscode from 'vscode';
import { HtmlNode } from 'EmmetNode';
-import { doComplete, isStyleSheet, getEmmetMode, extractAbbreviation } from 'vscode-emmet-helper';
import { isValidLocationForEmmetAbbreviation } from './abbreviationActions';
-import { getNode, getInnerRange, getMappingForIncludedLanguages, parseDocument, getEmmetConfiguration } from './util';
+import { getEmmetHelper, getNode, getInnerRange, getMappingForIncludedLanguages, parseDocument, getEmmetConfiguration, getEmmetMode, isStyleSheet } from './util';
+
+const allowedMimeTypesInScriptTag = ['text/html', 'text/plain', 'text/x-template', 'text/template'];
export class DefaultCompletionItemProvider implements vscode.CompletionItemProvider {
- public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable {
+ public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable | undefined {
const mappedLanguages = getMappingForIncludedLanguages();
const emmetConfig = vscode.workspace.getConfiguration('emmet');
@@ -31,20 +32,21 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
return;
}
+ const helper = getEmmetHelper();
let noiseCheckPromise: Thenable = Promise.resolve();
// Fix for https://github.com/Microsoft/vscode/issues/32647
// Check for document symbols in js/ts/jsx/tsx and avoid triggering emmet for abbreviations of the form symbolName.sometext
// Presence of > or * or + in the abbreviation denotes valid abbreviation that should trigger emmet
if (!isStyleSheet(syntax) && (document.languageId === 'javascript' || document.languageId === 'javascriptreact' || document.languageId === 'typescript' || document.languageId === 'typescriptreact')) {
- let extractAbbreviationResults = extractAbbreviation(document, position);
+ let extractAbbreviationResults = helper.extractAbbreviation(document, position);
if (extractAbbreviationResults) {
let abbreviation: string = extractAbbreviationResults.abbreviation;
if (abbreviation.startsWith('this.')) {
noiseCheckPromise = Promise.resolve(true);
} else {
- noiseCheckPromise = vscode.commands.executeCommand('vscode.executeDocumentSymbolProvider', document.uri).then((symbols: vscode.SymbolInformation[]) => {
- return symbols.find(x => abbreviation === x.name || (abbreviation.startsWith(x.name + '.') && !/>|\*|\+/.test(abbreviation)));
+ noiseCheckPromise = vscode.commands.executeCommand('vscode.executeDocumentSymbolProvider', document.uri).then((symbols: vscode.SymbolInformation[] | undefined) => {
+ return symbols && symbols.find(x => abbreviation === x.name || (abbreviation.startsWith(x.name + '.') && !/>|\*|\+/.test(abbreviation)));
});
}
}
@@ -55,7 +57,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
return;
}
- let result: vscode.CompletionList = doComplete(document, position, syntax, getEmmetConfiguration(syntax));
+ let result = helper.doComplete(document, position, syntax, getEmmetConfiguration(syntax));
let newItems: vscode.CompletionItem[] = [];
if (result && result.items) {
result.items.forEach(item => {
@@ -86,7 +88,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
* @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 {
+ private syntaxHelper(syntax: string | undefined, document: vscode.TextDocument, position: vscode.Position): string | undefined {
if (!syntax) {
return syntax;
}
@@ -95,7 +97,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
return;
}
- let currentNode = getNode(rootNode, position);
+ let currentNode = getNode(rootNode, position, true);
if (!isStyleSheet(syntax)) {
const currentHtmlNode = currentNode;
@@ -106,6 +108,10 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
return 'css';
}
if (currentHtmlNode.name === 'script') {
+ if (currentHtmlNode.attributes
+ && currentHtmlNode.attributes.some(x => x.name.toString() === 'type' && allowedMimeTypesInScriptTag.indexOf(x.value.toString()) > -1)) {
+ return syntax;
+ }
return;
}
}
diff --git a/extensions/emmet/src/editPoint.ts b/extensions/emmet/src/editPoint.ts
index 2028d3295b3..afd73a4ddcb 100644
--- a/extensions/emmet/src/editPoint.ts
+++ b/extensions/emmet/src/editPoint.ts
@@ -7,40 +7,42 @@ import * as vscode from 'vscode';
import { validate } from './util';
export function fetchEditPoint(direction: string): void {
- let editor = vscode.window.activeTextEditor;
- if (!validate()) {
+ if (!validate() || !vscode.window.activeTextEditor) {
return;
}
+ const editor = vscode.window.activeTextEditor;
let newSelections: vscode.Selection[] = [];
editor.selections.forEach(selection => {
- let updatedSelection = direction === 'next' ? nextEditPoint(selection.anchor, editor) : prevEditPoint(selection.anchor, editor);
- newSelections.push(updatedSelection ? updatedSelection : selection);
+ let updatedSelection = direction === 'next' ? nextEditPoint(selection, editor) : prevEditPoint(selection, editor);
+ newSelections.push(updatedSelection);
});
editor.selections = newSelections;
editor.revealRange(editor.selections[editor.selections.length - 1]);
}
-function nextEditPoint(position: vscode.Position, editor: vscode.TextEditor): vscode.Selection {
- for (let lineNum = position.line; lineNum < editor.document.lineCount; lineNum++) {
- let updatedSelection = findEditPoint(lineNum, editor, position, 'next');
+function nextEditPoint(selection: vscode.Selection, editor: vscode.TextEditor): vscode.Selection {
+ for (let lineNum = selection.anchor.line; lineNum < editor.document.lineCount; lineNum++) {
+ let updatedSelection = findEditPoint(lineNum, editor, selection.anchor, 'next');
if (updatedSelection) {
return updatedSelection;
}
}
+ return selection;
}
-function prevEditPoint(position: vscode.Position, editor: vscode.TextEditor): vscode.Selection {
- for (let lineNum = position.line; lineNum >= 0; lineNum--) {
- let updatedSelection = findEditPoint(lineNum, editor, position, 'prev');
+function prevEditPoint(selection: vscode.Selection, editor: vscode.TextEditor): vscode.Selection {
+ for (let lineNum = selection.anchor.line; lineNum >= 0; lineNum--) {
+ let updatedSelection = findEditPoint(lineNum, editor, selection.anchor, 'prev');
if (updatedSelection) {
return updatedSelection;
}
}
+ return selection;
}
-function findEditPoint(lineNum: number, editor: vscode.TextEditor, position: vscode.Position, direction: string): vscode.Selection {
+function findEditPoint(lineNum: number, editor: vscode.TextEditor, position: vscode.Position, direction: string): vscode.Selection | undefined {
let line = editor.document.lineAt(lineNum);
let lineContent = line.text;
diff --git a/extensions/emmet/src/evaluateMathExpression.ts b/extensions/emmet/src/evaluateMathExpression.ts
index cf7b84d41cc..8a7de6ca423 100644
--- a/extensions/emmet/src/evaluateMathExpression.ts
+++ b/extensions/emmet/src/evaluateMathExpression.ts
@@ -10,11 +10,11 @@ import evaluate from '@emmetio/math-expression';
import { DocumentStreamReader } from './bufferStream';
export function evaluateMathExpression() {
- let editor = vscode.window.activeTextEditor;
- if (!editor) {
+ if (!vscode.window.activeTextEditor) {
vscode.window.showInformationMessage('No editor is active');
return;
}
+ const editor = vscode.window.activeTextEditor;
const stream = new DocumentStreamReader(editor.document);
editor.edit(editBuilder => {
editor.selections.forEach(selection => {
diff --git a/extensions/emmet/src/extension.ts b/extensions/emmet/src/extension.ts
index 060654c5fa6..4acbf5dfa7b 100644
--- a/extensions/emmet/src/extension.ts
+++ b/extensions/emmet/src/extension.ts
@@ -17,13 +17,10 @@ import { fetchEditPoint } from './editPoint';
import { fetchSelectItem } from './selectItem';
import { evaluateMathExpression } from './evaluateMathExpression';
import { incrementDecrement } from './incrementDecrement';
-import { LANGUAGE_MODES, getMappingForIncludedLanguages } from './util';
-import { updateExtensionsPath } from 'vscode-emmet-helper';
+import { LANGUAGE_MODES, getMappingForIncludedLanguages, resolveUpdateExtensionsPath } from './util';
import { updateImageSize } from './updateImageSize';
import { reflectCssValue } from './reflectCssValue';
-import * as path from 'path';
-
export function activate(context: vscode.ExtensionContext) {
registerCompletionProviders(context);
@@ -128,18 +125,6 @@ export function activate(context: vscode.ExtensionContext) {
return reflectCssValue();
}));
- let currentExtensionsPath = undefined;
- let resolveUpdateExtensionsPath = () => {
- let extensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
- if (extensionsPath && !path.isAbsolute(extensionsPath)) {
- extensionsPath = path.join(vscode.workspace.rootPath, extensionsPath);
- }
- if (currentExtensionsPath !== extensionsPath) {
- currentExtensionsPath = extensionsPath;
- updateExtensionsPath(currentExtensionsPath).then(null, err => vscode.window.showErrorMessage(err));
- }
- };
-
resolveUpdateExtensionsPath();
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
diff --git a/extensions/emmet/src/imageSizeHelper.ts b/extensions/emmet/src/imageSizeHelper.ts
index 2c8f1de5945..1a88f35c110 100644
--- a/extensions/emmet/src/imageSizeHelper.ts
+++ b/extensions/emmet/src/imageSizeHelper.ts
@@ -19,20 +19,16 @@ const reUrl = /^https?:/;
/**
* Get size of given image file. Supports files from local filesystem,
* as well as URLs
- * @param {String} file Path to local file or URL
- * @return {Promise}
*/
-export function getImageSize(file) {
+export function getImageSize(file: string) {
file = file.replace(/^file:\/\//, '');
return reUrl.test(file) ? getImageSizeFromURL(file) : getImageSizeFromFile(file);
}
/**
* Get image size from file on local file system
- * @param {String} file
- * @return {Promise}
*/
-function getImageSizeFromFile(file) {
+function getImageSizeFromFile(file: string) {
return new Promise((resolve, reject) => {
const isDataUrl = file.match(/^data:.+?;base64,/);
@@ -46,7 +42,7 @@ function getImageSizeFromFile(file) {
}
}
- sizeOf(file, (err, size) => {
+ sizeOf(file, (err: any, size: any) => {
if (err) {
reject(err);
} else {
@@ -58,15 +54,13 @@ function getImageSizeFromFile(file) {
/**
* Get image size from given remove URL
- * @param {String} url
- * @return {Promise}
*/
-function getImageSizeFromURL(url) {
+function getImageSizeFromURL(urlStr: string) {
return new Promise((resolve, reject) => {
- url = parseUrl(url);
+ const url = parseUrl(urlStr);
const getTransport = url.protocol === 'https:' ? https.get : http.get;
- getTransport(url, resp => {
+ getTransport(url as any, resp => {
const chunks = [];
let bufSize = 0;
@@ -102,11 +96,8 @@ function getImageSizeFromURL(url) {
/**
* Returns size object for given file name. If file name contains `@Nx` token,
* the final dimentions will be downscaled by N
- * @param {String} fileName
- * @param {Object} size
- * @return {Object}
*/
-function sizeForFileName(fileName, size) {
+function sizeForFileName(fileName: string, size: any) {
const m = fileName.match(/@(\d+)x\./);
const scale = m ? +m[1] : 1;
diff --git a/extensions/emmet/src/selectItem.ts b/extensions/emmet/src/selectItem.ts
index 25b918231bd..bd82d2d1bed 100644
--- a/extensions/emmet/src/selectItem.ts
+++ b/extensions/emmet/src/selectItem.ts
@@ -4,11 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
-import { validate, parseDocument } from './util';
+import { validate, parseDocument, isStyleSheet } from './util';
import { nextItemHTML, prevItemHTML } from './selectItemHTML';
import { nextItemStylesheet, prevItemStylesheet } from './selectItemStylesheet';
-import { isStyleSheet } from 'vscode-emmet-helper';
-
export function fetchSelectItem(direction: string): void {
let editor = vscode.window.activeTextEditor;
diff --git a/extensions/emmet/src/selectItemHTML.ts b/extensions/emmet/src/selectItemHTML.ts
index 1b234e2f349..23647722bcc 100644
--- a/extensions/emmet/src/selectItemHTML.ts
+++ b/extensions/emmet/src/selectItemHTML.ts
@@ -7,9 +7,9 @@ import * as vscode from 'vscode';
import { getDeepestNode, findNextWord, findPrevWord, getNode } from './util';
import { HtmlNode } from 'EmmetNode';
-export function nextItemHTML(selectionStart: vscode.Position, selectionEnd: vscode.Position, editor: vscode.TextEditor, rootNode: HtmlNode): vscode.Selection {
+export function nextItemHTML(selectionStart: vscode.Position, selectionEnd: vscode.Position, editor: vscode.TextEditor, rootNode: HtmlNode): vscode.Selection | undefined {
let currentNode = getNode(rootNode, selectionEnd);
- let nextNode: HtmlNode;
+ let nextNode: HtmlNode | undefined = undefined;
if (!currentNode) {
return;
@@ -50,12 +50,12 @@ export function nextItemHTML(selectionStart: vscode.Position, selectionEnd: vsco
}
}
- return getSelectionFromNode(nextNode, editor.document);
+ return nextNode && getSelectionFromNode(nextNode, editor.document);
}
-export function prevItemHTML(selectionStart: vscode.Position, selectionEnd: vscode.Position, editor: vscode.TextEditor, rootNode: HtmlNode): vscode.Selection {
+export function prevItemHTML(selectionStart: vscode.Position, selectionEnd: vscode.Position, editor: vscode.TextEditor, rootNode: HtmlNode): vscode.Selection | undefined {
let currentNode = getNode(rootNode, selectionStart);
- let prevNode: HtmlNode;
+ let prevNode: HtmlNode | undefined = undefined;
if (!currentNode) {
return;
@@ -68,7 +68,7 @@ export function prevItemHTML(selectionStart: vscode.Position, selectionEnd: vsco
} else {
// Select the child that appears just before the cursor and is not a comment
prevNode = currentNode.firstChild;
- let oldOption: HtmlNode;
+ let oldOption: HtmlNode | undefined = undefined;
while (prevNode.nextSibling && selectionStart.isAfterOrEqual(prevNode.nextSibling.end)) {
if (prevNode && prevNode.type !== 'comment') {
oldOption = prevNode;
@@ -94,20 +94,25 @@ export function prevItemHTML(selectionStart: vscode.Position, selectionEnd: vsco
}
+ if (!prevNode) {
+ return undefined;
+ }
+
let attrSelection = getPrevAttribute(selectionStart, selectionEnd, editor.document, prevNode);
return attrSelection ? attrSelection : getSelectionFromNode(prevNode, editor.document);
}
-function getSelectionFromNode(node: HtmlNode, document: vscode.TextDocument): vscode.Selection {
+function getSelectionFromNode(node: HtmlNode, document: vscode.TextDocument): vscode.Selection | undefined {
if (node && node.open) {
let selectionStart = (node.open.start).translate(0, 1);
let selectionEnd = selectionStart.translate(0, node.name.length);
return new vscode.Selection(selectionStart, selectionEnd);
}
+ return undefined;
}
-function getNextAttribute(selectionStart: vscode.Position, selectionEnd: vscode.Position, document: vscode.TextDocument, node: HtmlNode): vscode.Selection {
+function getNextAttribute(selectionStart: vscode.Position, selectionEnd: vscode.Position, document: vscode.TextDocument, node: HtmlNode): vscode.Selection | undefined {
if (!node.attributes || node.attributes.length === 0 || node.type === 'comment') {
return;
@@ -158,7 +163,7 @@ function getNextAttribute(selectionStart: vscode.Position, selectionEnd: vscode.
}
}
-function getPrevAttribute(selectionStart: vscode.Position, selectionEnd: vscode.Position, document: vscode.TextDocument, node: HtmlNode): vscode.Selection {
+function getPrevAttribute(selectionStart: vscode.Position, selectionEnd: vscode.Position, document: vscode.TextDocument, node: HtmlNode): vscode.Selection | undefined {
if (!node.attributes || node.attributes.length === 0 || node.type === 'comment') {
return;
diff --git a/extensions/emmet/src/selectItemStylesheet.ts b/extensions/emmet/src/selectItemStylesheet.ts
index 09f0d6103a9..367e0320837 100644
--- a/extensions/emmet/src/selectItemStylesheet.ts
+++ b/extensions/emmet/src/selectItemStylesheet.ts
@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
import { getDeepestNode, findNextWord, findPrevWord, getNode } from './util';
import { Node, CssNode, Rule, Property } from 'EmmetNode';
-export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vscode.Position, editor: vscode.TextEditor, rootNode: Node): vscode.Selection {
+export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vscode.Position, editor: vscode.TextEditor, rootNode: Node): vscode.Selection | undefined {
let currentNode = getNode(rootNode, endOffset, true);
if (!currentNode) {
currentNode = rootNode;
@@ -50,7 +50,7 @@ export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vsco
}
-export function prevItemStylesheet(startOffset: vscode.Position, endOffset: vscode.Position, editor: vscode.TextEditor, rootNode: CssNode): vscode.Selection {
+export function prevItemStylesheet(startOffset: vscode.Position, endOffset: vscode.Position, editor: vscode.TextEditor, rootNode: CssNode): vscode.Selection | undefined {
let currentNode = getNode(rootNode, startOffset);
if (!currentNode) {
currentNode = rootNode;
@@ -88,7 +88,7 @@ export function prevItemStylesheet(startOffset: vscode.Position, endOffset: vsco
}
-function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode.Selection {
+function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode.Selection | undefined {
if (!node) {
return;
}
@@ -98,7 +98,7 @@ function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode
}
-function getSelectionFromProperty(node: Node, document: vscode.TextDocument, selectionStart: vscode.Position, selectionEnd: vscode.Position, selectFullValue: boolean, direction: string): vscode.Selection {
+function getSelectionFromProperty(node: Node, document: vscode.TextDocument, selectionStart: vscode.Position, selectionEnd: vscode.Position, selectFullValue: boolean, direction: string): vscode.Selection | undefined {
if (!node || node.type !== 'property') {
return;
}
diff --git a/extensions/emmet/src/splitJoinTag.ts b/extensions/emmet/src/splitJoinTag.ts
index 382bd1841b0..67a403bce29 100644
--- a/extensions/emmet/src/splitJoinTag.ts
+++ b/extensions/emmet/src/splitJoinTag.ts
@@ -8,11 +8,11 @@ import { HtmlNode } from 'EmmetNode';
import { getNode, parseDocument, validate } from './util';
export function splitJoinTag() {
- let editor = vscode.window.activeTextEditor;
- if (!validate(false)) {
+ if (!validate(false) || !vscode.window.activeTextEditor) {
return;
}
+ const editor = vscode.window.activeTextEditor;
let rootNode = parseDocument(editor.document);
if (!rootNode) {
return;
@@ -20,23 +20,19 @@ export function splitJoinTag() {
return editor.edit(editBuilder => {
editor.selections.reverse().forEach(selection => {
- let textEdit = getRangesToReplace(editor.document, selection, rootNode);
- if (textEdit) {
+ let nodeToUpdate = getNode(rootNode, selection.start);
+ if (nodeToUpdate) {
+ let textEdit = getRangesToReplace(editor.document, nodeToUpdate);
editBuilder.replace(textEdit.range, textEdit.newText);
}
});
});
}
-function getRangesToReplace(document: vscode.TextDocument, selection: vscode.Selection, rootNode: HtmlNode): vscode.TextEdit {
- let nodeToUpdate = getNode(rootNode, selection.start);
+function getRangesToReplace(document: vscode.TextDocument, nodeToUpdate: HtmlNode): vscode.TextEdit {
let rangeToReplace: vscode.Range;
let textToReplaceWith: string;
- if (!nodeToUpdate) {
- return;
- }
-
if (!nodeToUpdate.close) {
// Split Tag
let nodeText = document.getText(new vscode.Range(nodeToUpdate.start, nodeToUpdate.end));
diff --git a/extensions/emmet/src/test/abbreviationAction.test.ts b/extensions/emmet/src/test/abbreviationAction.test.ts
index 4dd97f7a7e1..0f599e37b86 100644
--- a/extensions/emmet/src/test/abbreviationAction.test.ts
+++ b/extensions/emmet/src/test/abbreviationAction.test.ts
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
import { Selection, workspace } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
@@ -11,6 +12,7 @@ import { expandEmmetAbbreviation, wrapWithAbbreviation, wrapIndividualLinesWithA
const cssContents = `
.boo {
margin: 20px 10px;
+ m10
background-image: url('tryme.png');
m10
}
@@ -189,9 +191,9 @@ suite('Tests for Expand Abbreviations (CSS)', () => {
test('Expand abbreviation (CSS)', () => {
return withRandomFileEditor(cssContents, 'css', (editor, doc) => {
- editor.selection = new Selection(4, 1, 4, 4);
+ editor.selections = [new Selection(3, 1, 3, 4), new Selection(5, 1, 5, 4)];
return expandEmmetAbbreviation(null).then(() => {
- assert.equal(editor.document.getText(), cssContents.replace('m10', 'margin: 10px;'));
+ assert.equal(editor.document.getText(), cssContents.replace(/m10/g, 'margin: 10px;'));
return Promise.resolve();
});
});
@@ -211,6 +213,29 @@ suite('Tests for Expand Abbreviations (CSS)', () => {
});
});
});
+
+ test('Invalid locations for abbreviations in css', () => {
+ const scssContentsNoExpand = `
+m10
+ .boo {
+ margin: 10px;
+ .hoo {
+ background:
+ }
+ }
+ `
+
+ return withRandomFileEditor(scssContentsNoExpand, 'scss', (editor, doc) => {
+ editor.selections = [
+ new Selection(1, 3, 1, 3), // outside rule
+ new Selection(5, 15, 5, 15) // in the value part of property value
+ ];
+ return expandEmmetAbbreviation(null).then(() => {
+ assert.equal(editor.document.getText(), scssContentsNoExpand);
+ return Promise.resolve();
+ });
+ });
+ });
});
suite('Tests for Wrap with Abbreviations', () => {
@@ -320,7 +345,7 @@ suite('Tests for Wrap with Abbreviations', () => {
suite('Tests for jsx, xml and xsl', () => {
teardown(closeAllEditors);
-
+
test('Expand abbreviation with className instead of class in jsx', () => {
return withRandomFileEditor('ul.nav', 'javascriptreact', (editor, doc) => {
editor.selection = new Selection(0, 6, 0, 6);
diff --git a/extensions/emmet/src/test/editPointSelectItemBalance.test.ts b/extensions/emmet/src/test/editPointSelectItemBalance.test.ts
index 427ee166f95..3393fdddc24 100644
--- a/extensions/emmet/src/test/editPointSelectItemBalance.test.ts
+++ b/extensions/emmet/src/test/editPointSelectItemBalance.test.ts
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
diff --git a/extensions/emmet/src/test/incrementDecrement.test.ts b/extensions/emmet/src/test/incrementDecrement.test.ts
index a846bc6b782..e1c039dffca 100644
--- a/extensions/emmet/src/test/incrementDecrement.test.ts
+++ b/extensions/emmet/src/test/incrementDecrement.test.ts
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
diff --git a/extensions/emmet/src/test/reflectCssValue.test.ts b/extensions/emmet/src/test/reflectCssValue.test.ts
index 228c62ed960..3967503b676 100644
--- a/extensions/emmet/src/test/reflectCssValue.test.ts
+++ b/extensions/emmet/src/test/reflectCssValue.test.ts
@@ -3,8 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
-import { Selection, commands } from 'vscode';
+import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
import { reflectCssValue } from '../reflectCssValue';
diff --git a/extensions/emmet/src/test/tagActions.test.ts b/extensions/emmet/src/test/tagActions.test.ts
index 7d13c98fd84..c95bf8064bc 100644
--- a/extensions/emmet/src/test/tagActions.test.ts
+++ b/extensions/emmet/src/test/tagActions.test.ts
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
diff --git a/extensions/emmet/src/test/toggleComment.test.ts b/extensions/emmet/src/test/toggleComment.test.ts
index 225fbeb8074..7423a028d4b 100644
--- a/extensions/emmet/src/test/toggleComment.test.ts
+++ b/extensions/emmet/src/test/toggleComment.test.ts
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
diff --git a/extensions/emmet/src/test/updateImageSize.test.ts b/extensions/emmet/src/test/updateImageSize.test.ts
index 2fadbe94d58..cc23e3f6651 100644
--- a/extensions/emmet/src/test/updateImageSize.test.ts
+++ b/extensions/emmet/src/test/updateImageSize.test.ts
@@ -3,15 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'mocha';
import * as assert from 'assert';
import { Selection } from 'vscode';
import { withRandomFileEditor, closeAllEditors } from './testUtils';
import { updateImageSize } from '../updateImageSize';
-import * as path from 'path';
suite('Tests for Emmet actions on html tags', () => {
teardown(closeAllEditors);
- const filePath = path.join(__dirname, '../../../../resources/linux/code.png');
test('update image css with multiple cursors in css file', () => {
const cssContents = `
diff --git a/extensions/emmet/src/toggleComment.ts b/extensions/emmet/src/toggleComment.ts
index 4de5b7e007b..e15dbd0c984 100644
--- a/extensions/emmet/src/toggleComment.ts
+++ b/extensions/emmet/src/toggleComment.ts
@@ -4,9 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
-import { getNodesInBetween, getNode, parseDocument, sameNodes } from './util';
+import { getNodesInBetween, getNode, parseDocument, sameNodes, isStyleSheet, validate } from './util';
import { Node, Stylesheet, Rule, HtmlNode } from 'EmmetNode';
-import { isStyleSheet } from 'vscode-emmet-helper';
import parseStylesheet from '@emmetio/css-parser';
import { DocumentStreamReader } from './bufferStream';
@@ -15,14 +14,12 @@ const endCommentStylesheet = '*/';
const startCommentHTML = '';
-export function toggleComment(): Thenable {
- let editor = vscode.window.activeTextEditor;
- if (!editor) {
- vscode.window.showInformationMessage('No editor is active');
+export function toggleComment(): Thenable | undefined {
+ if (!validate() || !vscode.window.activeTextEditor) {
return;
}
-
- let toggleCommentInternal;
+ const editor = vscode.window.activeTextEditor;
+ let toggleCommentInternal: (document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node) => vscode.TextEdit[];
if (isStyleSheet(editor.document.languageId)) {
toggleCommentInternal = toggleCommentStylesheet;
diff --git a/extensions/emmet/src/typings/EmmetNode.d.ts b/extensions/emmet/src/typings/EmmetNode.d.ts
index bf27b63ca91..476af0ed931 100644
--- a/extensions/emmet/src/typings/EmmetNode.d.ts
+++ b/extensions/emmet/src/typings/EmmetNode.d.ts
@@ -35,7 +35,7 @@ declare module 'EmmetNode' {
}
export interface Attribute extends Token {
- name: string
+ name: Token
value: Token
}
diff --git a/extensions/emmet/src/typings/refs.d.ts b/extensions/emmet/src/typings/refs.d.ts
index 0188b6f9ffc..bc057c55878 100644
--- a/extensions/emmet/src/typings/refs.d.ts
+++ b/extensions/emmet/src/typings/refs.d.ts
@@ -5,4 +5,3 @@
///
///
-///
diff --git a/extensions/emmet/src/updateImageSize.ts b/extensions/emmet/src/updateImageSize.ts
index 352cdd2e046..06fbd45a15b 100644
--- a/extensions/emmet/src/updateImageSize.ts
+++ b/extensions/emmet/src/updateImageSize.ts
@@ -10,8 +10,7 @@
import { TextEditor, Range, Position, window, TextEdit } from 'vscode';
import * as path from 'path';
import { getImageSize } from './imageSizeHelper';
-import { isStyleSheet } from 'vscode-emmet-helper';
-import { parseDocument, getNode, iterateCSSToken, getCssPropertyFromRule } from './util';
+import { parseDocument, getNode, iterateCSSToken, getCssPropertyFromRule, isStyleSheet, validate } from './util';
import { HtmlNode, CssToken, HtmlToken, Attribute, Property } from 'EmmetNode';
import { locateFile } from './locateFile';
import parseStylesheet from '@emmetio/css-parser';
@@ -21,11 +20,10 @@ import { DocumentStreamReader } from './bufferStream';
* Updates size of context image in given editor
*/
export function updateImageSize() {
- let editor = window.activeTextEditor;
- if (!editor) {
- window.showInformationMessage('No editor is active.');
+ if (!validate() || !window.activeTextEditor) {
return;
}
+ const editor = window.activeTextEditor;
let allUpdatesPromise = editor.selections.reverse().map(selection => {
let position = selection.isReversed ? selection.active : selection.anchor;
@@ -50,7 +48,7 @@ export function updateImageSize() {
/**
* Updates image size of context tag of HTML model
*/
-function updateImageSizeHTML(editor: TextEditor, position: Position): Promise {
+function updateImageSizeHTML(editor: TextEditor, position: Position): Promise {
const src = getImageSrcHTML(getImageHTMLNode(editor, position));
if (!src) {
@@ -71,7 +69,7 @@ function updateImageSizeHTML(editor: TextEditor, position: Position): Promise {
- let getPropertyInsiderStyleTag = (editor) => {
+ const getPropertyInsiderStyleTag = (editor: TextEditor): Property | undefined => {
const rootNode = parseDocument(editor.document);
const currentNode = getNode(rootNode, position);
if (currentNode && currentNode.name === 'style'
@@ -80,7 +78,7 @@ function updateImageSizeStyleTag(editor: TextEditor, position: Position): Promis
let buffer = new DocumentStreamReader(editor.document, currentNode.open.end, new Range(currentNode.open.end, currentNode.close.start));
let rootNode = parseStylesheet(buffer);
const node = getNode(rootNode, position);
- return (node && node.type === 'property') ? node : null;
+ return (node && node.type === 'property') ? node : undefined;
}
};
@@ -94,7 +92,7 @@ function updateImageSizeCSSFile(editor: TextEditor, position: Position): Promise
/**
* Updates image size of context rule of stylesheet model
*/
-function updateImageSizeCSS(editor: TextEditor, position: Position, fetchNode: (editor, position) => Property): Promise {
+function updateImageSizeCSS(editor: TextEditor, position: Position, fetchNode: (editor: TextEditor, position: Position) => Property | undefined): Promise {
const src = getImageSrcCSS(fetchNode(editor, position), position);
@@ -142,10 +140,8 @@ function getImageCSSNode(editor: TextEditor, position: Position): Property {
/**
* Returns image source from given
node
- * @param {HtmlNode} node
- * @return {string}
*/
-function getImageSrcHTML(node: HtmlNode): string {
+function getImageSrcHTML(node: HtmlNode): string | undefined {
const srcAttr = getAttribute(node, 'src');
if (!srcAttr) {
return;
@@ -156,11 +152,8 @@ function getImageSrcHTML(node: HtmlNode): string {
/**
* Returns image source from given `url()` token
- * @param {Property} node
- * @param {Position}
- * @return {string}
*/
-function getImageSrcCSS(node: Property, position: Position): string {
+function getImageSrcCSS(node: Property | undefined, position: Position): string | undefined {
if (!node) {
return;
}
@@ -214,10 +207,6 @@ function updateHTMLTag(editor: TextEditor, node: HtmlNode, width: number, height
/**
* Updates size of given CSS rule
- * @param {TextEditor} editor
- * @param {Property} srcProp
- * @param {number} width
- * @param {number} height
*/
function updateCSSNode(editor: TextEditor, srcProp: Property, width: number, height: number): TextEdit[] {
const rule = srcProp.parent;
@@ -253,36 +242,28 @@ function updateCSSNode(editor: TextEditor, srcProp: Property, width: number, hei
/**
* Returns attribute object with `attrName` name from given HTML node
- * @param {Node} node
- * @param {String} attrName
- * @return {Object}
*/
-function getAttribute(node, attrName): Attribute {
+function getAttribute(node: HtmlNode, attrName: string): Attribute {
attrName = attrName.toLowerCase();
- return node && node.open.attributes.find(attr => attr.name.value.toLowerCase() === attrName);
+ return node && (node.open as any).attributes.find(attr => attr.name.value.toLowerCase() === attrName);
}
/**
* Returns quote character, used for value of given attribute. May return empty
* string if attribute wasnāt quoted
- * @param {TextEditor} editor
- * @param {Object} attr
- * @return {String}
+
*/
-function getAttributeQuote(editor, attr) {
+function getAttributeQuote(editor: TextEditor, attr: any): string {
const range = new Range(attr.value ? attr.value.end : attr.end, attr.end);
return range.isEmpty ? '' : editor.document.getText(range);
}
/**
* Finds 'url' token for given `pos` point in given CSS property `node`
- * @param {Node} node
- * @param {Position} pos
- * @return {Token}
*/
-function findUrlToken(node, pos: Position) {
- for (let i = 0, il = node.parsedValue.length, url; i < il; i++) {
- iterateCSSToken(node.parsedValue[i], (token: CssToken) => {
+function findUrlToken(node: Property, pos: Position): CssToken | undefined {
+ for (let i = 0, il = (node as any).parsedValue.length, url; i < il; i++) {
+ iterateCSSToken((node as any).parsedValue[i], (token: CssToken) => {
if (token.type === 'url' && token.start.isBeforeOrEqual(pos) && token.end.isAfterOrEqual(pos)) {
url = token;
return false;
@@ -297,11 +278,8 @@ function findUrlToken(node, pos: Position) {
/**
* Returns a string that is used to delimit properties in current nodeās rule
- * @param {TextEditor} editor
- * @param {Property} node
- * @return {String}
*/
-function getPropertyDelimitor(editor: TextEditor, node: Property) {
+function getPropertyDelimitor(editor: TextEditor, node: Property): string {
let anchor;
if (anchor = (node.previousSibling || node.parent.contentStartToken)) {
return editor.document.getText(new Range(anchor.end, node.start));
diff --git a/extensions/emmet/src/updateTag.ts b/extensions/emmet/src/updateTag.ts
index 66a23e074b6..b62f167d70a 100644
--- a/extensions/emmet/src/updateTag.ts
+++ b/extensions/emmet/src/updateTag.ts
@@ -7,17 +7,17 @@ import * as vscode from 'vscode';
import { HtmlNode } from 'EmmetNode';
import { getNode, parseDocument, validate } from './util';
-export function updateTag(tagName: string): Thenable {
- let editor = vscode.window.activeTextEditor;
- if (!validate(false)) {
+export function updateTag(tagName: string): Thenable | undefined {
+ if (!validate(false) || !vscode.window.activeTextEditor) {
return;
}
+ let editor = vscode.window.activeTextEditor;
let rootNode = parseDocument(editor.document);
if (!rootNode) {
return;
}
- let rangesToUpdate = [];
+ let rangesToUpdate: vscode.Range[] = [];
editor.selections.reverse().forEach(selection => {
rangesToUpdate = rangesToUpdate.concat(getRangesToUpdate(editor, selection, rootNode));
});
diff --git a/extensions/emmet/src/util.ts b/extensions/emmet/src/util.ts
index 66f8ba03fc8..450aa136143 100644
--- a/extensions/emmet/src/util.ts
+++ b/extensions/emmet/src/util.ts
@@ -6,26 +6,53 @@
import * as vscode from 'vscode';
import parse from '@emmetio/html-matcher';
import parseStylesheet from '@emmetio/css-parser';
-import { Node, HtmlNode, CssToken, Property } from 'EmmetNode';
+import { Node, HtmlNode, CssToken, Property, Rule } from 'EmmetNode';
import { DocumentStreamReader } from './bufferStream';
-import { isStyleSheet } from 'vscode-emmet-helper';
+import * as path from 'path';
-export const LANGUAGE_MODES: Object = {
+let _emmetHelper: any;
+let _currentExtensionsPath: string | undefined = undefined;
+
+export function getEmmetHelper() {
+ if (!_emmetHelper) {
+ _emmetHelper = require('vscode-emmet-helper');
+ }
+ resolveUpdateExtensionsPath();
+ return _emmetHelper;
+}
+
+export function resolveUpdateExtensionsPath() {
+ if (!_emmetHelper) {
+ return;
+ }
+ let extensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
+ if (extensionsPath && !path.isAbsolute(extensionsPath)) {
+ extensionsPath = path.join(vscode.workspace.rootPath || '', extensionsPath);
+ }
+ if (_currentExtensionsPath !== extensionsPath) {
+ _currentExtensionsPath = extensionsPath;
+ _emmetHelper.updateExtensionsPath(_currentExtensionsPath).then(null, (err: string) => vscode.window.showErrorMessage(err));
+ }
+}
+
+export const LANGUAGE_MODES: any = {
'html': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'jade': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'slim': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'haml': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'xml': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'xsl': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
- 'css': [':', ';'],
- 'scss': [':', ';'],
- 'sass': [':'],
- 'less': [':', ';'],
- 'stylus': [':'],
+ 'css': [':', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
+ 'scss': [':', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
+ 'sass': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
+ 'less': [':', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
+ 'stylus': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'javascriptreact': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
'typescriptreact': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
};
+const emmetModes = ['html', 'pug', 'slim', 'haml', 'xml', 'xsl', 'jsx', 'css', 'scss', 'sass', 'less', 'stylus'];
+
// Explicitly map languages that have built-in grammar in VS Code to their parent language
// to get emmet completion support
// For other languages, users will have to use `emmet.includeLanguages` or
@@ -35,6 +62,11 @@ export const MAPPED_MODES: Object = {
'php': 'html'
};
+export function isStyleSheet(syntax: string): boolean {
+ let stylesheetSyntaxes = ['css', 'scss', 'sass', 'less', 'stylus'];
+ return (stylesheetSyntaxes.indexOf(syntax) > -1);
+}
+
export function validate(allowStylesheet: boolean = true): boolean {
let editor = vscode.window.activeTextEditor;
if (!editor) {
@@ -48,7 +80,7 @@ export function validate(allowStylesheet: boolean = true): boolean {
}
export function getMappingForIncludedLanguages(): any {
- let finalMappedModes = {};
+ const finalMappedModes = Object.create(null);
let includeLanguagesConfig = vscode.workspace.getConfiguration('emmet')['includeLanguages'];
let includeLanguages = Object.assign({}, MAPPED_MODES, includeLanguagesConfig ? includeLanguagesConfig : {});
Object.keys(includeLanguages).forEach(syntax => {
@@ -59,36 +91,58 @@ export function getMappingForIncludedLanguages(): any {
return finalMappedModes;
}
+/**
+* Get the corresponding emmet mode for given vscode language mode
+* Eg: jsx for typescriptreact/javascriptreact or pug for jade
+* If the language is not supported by emmet or has been exlcuded via `exlcudeLanguages` setting,
+* then nothing is returned
+*
+* @param language
+* @param exlcudedLanguages Array of language ids that user has chosen to exlcude for emmet
+*/
+export function getEmmetMode(language: string, excludedLanguages: string[]): string | undefined {
+ if (!language || excludedLanguages.indexOf(language) > -1) {
+ return;
+ }
+ if (/\b(typescriptreact|javascriptreact|jsx-tags)\b/.test(language)) { // treat tsx like jsx
+ return 'jsx';
+ }
+ if (language === 'sass-indented') { // map sass-indented to sass
+ return 'sass';
+ }
+ if (language === 'jade') {
+ return 'pug';
+ }
+ if (emmetModes.indexOf(language) > -1) {
+ return language;
+ }
+}
+
/**
* Parses the given document using emmet parsing modules
- * @param document
*/
-export function parseDocument(document: vscode.TextDocument, showError: boolean = true): Node {
+export function parseDocument(document: vscode.TextDocument, showError: boolean = true): Node | undefined {
let parseContent = isStyleSheet(document.languageId) ? parseStylesheet : parse;
- let rootNode: Node;
try {
- rootNode = parseContent(new DocumentStreamReader(document));
+ return parseContent(new DocumentStreamReader(document));
} catch (e) {
if (showError) {
vscode.window.showErrorMessage('Emmet: Failed to parse the file');
}
}
- return rootNode;
+ return undefined;
}
/**
* 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) {
+export function getNode(root: Node | undefined, position: vscode.Position, includeNodeBoundary: boolean = false) {
if (!root) {
return null;
}
let currentNode = root.firstChild;
- let foundNode: Node = null;
+ let foundNode: Node | null = null;
while (currentNode) {
const nodeStart: vscode.Position = currentNode.start;
@@ -111,14 +165,14 @@ export function getNode(root: Node, position: vscode.Position, includeNodeBounda
* Returns inner range of an html node.
* @param currentNode
*/
-export function getInnerRange(currentNode: HtmlNode): vscode.Range {
+export function getInnerRange(currentNode: HtmlNode): vscode.Range | undefined {
if (!currentNode.close) {
- return;
+ return undefined;
}
return new vscode.Range(currentNode.open.end, currentNode.close.start);
}
-export function getDeepestNode(node: Node): Node {
+export function getDeepestNode(node: Node | undefined): Node | undefined {
if (!node || !node.children || node.children.length === 0 || !node.children.find(x => x.type !== 'comment')) {
return node;
}
@@ -127,6 +181,7 @@ export function getDeepestNode(node: Node): Node {
return getDeepestNode(node.children[i]);
}
}
+ return undefined;
}
export function findNextWord(propertyValue: string, pos: number): [number, number] {
@@ -283,10 +338,8 @@ export function getEmmetConfiguration(syntax: string) {
/**
* Itereates by each child, as well as nested childā children, in their order
* and invokes `fn` for each. If `fn` function returns `false`, iteration stops
- * @param {Token} token
- * @param {Function} fn
*/
-export function iterateCSSToken(token: CssToken, fn) {
+export function iterateCSSToken(token: CssToken, fn: (x: any) => any) {
for (let i = 0, il = token.size; i < il; i++) {
if (fn(token.item(i)) === false || iterateCSSToken(token.item(i), fn) === false) {
return false;
@@ -296,21 +349,16 @@ export function iterateCSSToken(token: CssToken, fn) {
/**
* Returns `name` CSS property from given `rule`
- * @param {Node} rule
- * @param {String} name
- * @return {Property}
*/
-export function getCssPropertyFromRule(rule, name): Property {
- return rule.children.find(node => node.type === 'property' && node.name === name);
+export function getCssPropertyFromRule(rule: Rule, name: string): Property | undefined {
+ return rule.children.find(node => node.type === 'property' && node.name === name) as Property;
}
/**
* Returns css property under caret in given editor or `null` if such node cannot
* be found
- * @param {TextEditor} editor
- * @return {Property}
*/
-export function getCssPropertyFromDocument(editor: vscode.TextEditor, position: vscode.Position): Property {
+export function getCssPropertyFromDocument(editor: vscode.TextEditor, position: vscode.Position): Property | undefined {
const rootNode = parseDocument(editor.document);
const node = getNode(rootNode, position);
diff --git a/extensions/emmet/tsconfig.json b/extensions/emmet/tsconfig.json
index 06d04868a70..3ac3cd9c298 100644
--- a/extensions/emmet/tsconfig.json
+++ b/extensions/emmet/tsconfig.json
@@ -5,8 +5,8 @@
"es2016"
],
"module": "commonjs",
- "outDir": "./out"
-
+ "outDir": "./out",
+ "noUnusedLocals": true
},
"exclude": [
"node_modules",
diff --git a/extensions/extension-editing/npm-shrinkwrap.json b/extensions/extension-editing/npm-shrinkwrap.json
index c546fa26f89..2cfa863b624 100644
--- a/extensions/extension-editing/npm-shrinkwrap.json
+++ b/extensions/extension-editing/npm-shrinkwrap.json
@@ -5,7 +5,8 @@
"@types/node": {
"version": "6.0.78",
"from": "@types/node@>=6.0.46 <7.0.0",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.78.tgz"
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.78.tgz",
+ "dev": true
},
"argparse": {
"version": "1.0.9",
diff --git a/extensions/extension-editing/package.json b/extensions/extension-editing/package.json
index 36f1ae658ab..8a4c4520f18 100644
--- a/extensions/extension-editing/package.json
+++ b/extensions/extension-editing/package.json
@@ -47,6 +47,6 @@
},
"devDependencies": {
"@types/markdown-it": "0.0.2",
- "@types/node": "^7.0.4"
+ "@types/node": "7.0.43"
}
}
diff --git a/extensions/extension-editing/src/extension.ts b/extensions/extension-editing/src/extension.ts
index e0ab03f256e..474ea4c8a35 100644
--- a/extensions/extension-editing/src/extension.ts
+++ b/extensions/extension-editing/src/extension.ts
@@ -46,7 +46,7 @@ const _linkProvider = new class implements vscode.DocumentLinkProvider {
const offset = lookUp(match[1]);
if (offset === -1) {
- console.warn(match[1]);
+ console.warn(`Could not find symbol for link ${match[1]}`);
continue;
}
diff --git a/extensions/extension-editing/src/extensionLinter.ts b/extensions/extension-editing/src/extensionLinter.ts
index d06332e8221..5d6ec0c4591 100644
--- a/extensions/extension-editing/src/extensionLinter.ts
+++ b/extensions/extension-editing/src/extensionLinter.ts
@@ -8,8 +8,7 @@ import * as path from 'path';
import { parseTree, findNodeAtLocation, Node as JsonNode } from 'jsonc-parser';
import * as nls from 'vscode-nls';
-import * as MarkdownIt from 'markdown-it';
-import * as parse5 from 'parse5';
+import * as MarkdownItType from 'markdown-it';
import { languages, workspace, Disposable, ExtensionContext, TextDocument, Uri, Diagnostic, Range, DiagnosticSeverity, Position } from 'vscode';
@@ -33,7 +32,7 @@ enum Context {
}
interface TokenAndPosition {
- token: MarkdownIt.Token;
+ token: MarkdownItType.Token;
begin: number;
end: number;
}
@@ -53,8 +52,9 @@ export class ExtensionLinter {
private packageJsonQ = new Set();
private readmeQ = new Set();
private timer: NodeJS.Timer;
- private markdownIt = new MarkdownIt();
+ private markdownIt: MarkdownItType.MarkdownIt;
+ // @ts-ignore unused property
constructor(private context: ExtensionContext) {
this.disposables.push(
workspace.onDidOpenTextDocument(document => this.queue(document)),
@@ -148,8 +148,11 @@ export class ExtensionLinter {
}
const text = document.getText();
+ if (!this.markdownIt) {
+ this.markdownIt = new (await import('markdown-it'));
+ }
const tokens = this.markdownIt.parse(text, {});
- const tokensAndPositions = (function toTokensAndPositions(this: ExtensionLinter, tokens: MarkdownIt.Token[], begin = 0, end = text.length): TokenAndPosition[] {
+ const tokensAndPositions = (function toTokensAndPositions(this: ExtensionLinter, tokens: MarkdownItType.Token[], begin = 0, end = text.length): TokenAndPosition[] {
const tokensAndPositions = tokens.map(token => {
if (token.map) {
const tokenBegin = document.offsetAt(new Position(token.map[0], 0));
@@ -192,8 +195,9 @@ export class ExtensionLinter {
});
let svgStart: Diagnostic;
- tokensAndPositions.filter(tnp => tnp.token.type === 'text' && tnp.token.content)
- .map(tnp => {
+ for (const tnp of tokensAndPositions) {
+ if (tnp.token.type === 'text' && tnp.token.content) {
+ const parse5 = await import('parse5');
const parser = new parse5.SAXParser({ locationInfo: true });
parser.on('startTag', (name, attrs, selfClosing, location) => {
if (name === 'img') {
@@ -220,13 +224,14 @@ export class ExtensionLinter {
});
parser.write(tnp.token.content);
parser.end();
- });
+ }
+ }
this.diagnosticsCollection.set(document.uri, diagnostics);
- };
+ }
}
- private locateToken(text: string, begin: number, end: number, token: MarkdownIt.Token, content: string) {
+ private locateToken(text: string, begin: number, end: number, token: MarkdownItType.Token, content: string) {
if (content) {
const tokenBegin = text.indexOf(content, begin);
if (tokenBegin !== -1) {
diff --git a/extensions/extension-editing/tsconfig.json b/extensions/extension-editing/tsconfig.json
index a2b5bcdfddf..6fbf4543c23 100644
--- a/extensions/extension-editing/tsconfig.json
+++ b/extensions/extension-editing/tsconfig.json
@@ -5,6 +5,7 @@
"es2015"
],
"module": "commonjs",
+ "noUnusedLocals": true,
"outDir": "./out"
},
"include": [
diff --git a/extensions/fsharp/language-configuration.json b/extensions/fsharp/language-configuration.json
index 89dc2adb5a8..e4affc8deaa 100644
--- a/extensions/fsharp/language-configuration.json
+++ b/extensions/fsharp/language-configuration.json
@@ -20,5 +20,12 @@
["(", ")"],
["\"", "\""],
["'", "'"]
- ]
+ ],
+ "folding": {
+ "offSide": true,
+ "markers": {
+ "start": "^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)",
+ "end": "^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)"
+ }
+ }
}
diff --git a/extensions/fsharp/package.json b/extensions/fsharp/package.json
index 4426dcbde61..b97779edbf6 100644
--- a/extensions/fsharp/package.json
+++ b/extensions/fsharp/package.json
@@ -17,6 +17,10 @@
"language": "fsharp",
"scopeName": "source.fsharp",
"path": "./syntaxes/fsharp.json"
+ }],
+ "snippets": [{
+ "language": "fsharp",
+ "path": "./snippets/fsharp.json"
}]
}
}
diff --git a/extensions/fsharp/snippets/fsharp.json b/extensions/fsharp/snippets/fsharp.json
new file mode 100644
index 00000000000..f2640f764f4
--- /dev/null
+++ b/extensions/fsharp/snippets/fsharp.json
@@ -0,0 +1,16 @@
+{
+ "Region Start": {
+ "prefix": "#region",
+ "body": [
+ "//#region $0"
+ ],
+ "description": "Folding Region Start"
+ },
+ "Region End": {
+ "prefix": "#endregion",
+ "body": [
+ "//#endregion"
+ ],
+ "description": "Folding Region End"
+ }
+}
diff --git a/extensions/fsharp/syntaxes/fsharp.json b/extensions/fsharp/syntaxes/fsharp.json
index d48f35550e4..ca1fdacfab5 100644
--- a/extensions/fsharp/syntaxes/fsharp.json
+++ b/extensions/fsharp/syntaxes/fsharp.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/ionide/ionide-fsgrammar/commit/f2e3c30f0ebfcc89fb78ad908701159f20516812",
+ "version": "https://github.com/ionide/ionide-fsgrammar/commit/7a24912ecdc886e4d973d6d3ab8df20a0feeda76",
"name": "fsharp",
"scopeName": "source.fsharp",
"fileTypes": [
@@ -145,7 +145,7 @@
"patterns": [
{
"name": "binding.fsharp",
- "begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\([^\\s-]*\\)|[_[:alpha:]]([_[:alpha:]0-9,\\._]|(?<=,)\\s)*)",
+ "begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\([^-]*\\)|\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]|(?<=,)\\s)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]|(?<=,)\\s)*)",
"end": "((``.*``)|(with)|=|$)",
"beginCaptures": {
"1": {
@@ -330,7 +330,12 @@
"1": {
"name": "punctuation.definition.string.end.fsharp"
}
- }
+ },
+ "patterns": [
+ {
+ "include": "#string_formatter"
+ }
+ ]
},
{
"name": "string.quoted.double.fsharp",
@@ -358,11 +363,27 @@
{
"name": "invalid.illeagal.character.string.fsharp",
"match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})."
+ },
+ {
+ "include": "#string_formatter"
}
]
}
]
},
+ "string_formatter": {
+ "patterns": [
+ {
+ "name": "entity.name.type.format.specifier.fsharp",
+ "match": "(%0?-?(\\d+)?((a|t)|(\\.\\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o)|(s|b|O)|(\\+?A)))",
+ "captures": {
+ "1": {
+ "name": "keyword.other.format.specifier.fsharp"
+ }
+ }
+ }
+ ]
+ },
"variables": {
"patterns": [
{
diff --git a/extensions/fsharp/test/colorize-results/test_fs.json b/extensions/fsharp/test/colorize-results/test_fs.json
index 2f161a6fccc..ee0ae2ca9c1 100644
--- a/extensions/fsharp/test/colorize-results/test_fs.json
+++ b/extensions/fsharp/test/colorize-results/test_fs.json
@@ -1026,11 +1026,11 @@
"c": "\\n",
"t": "source.fsharp string.quoted.double.fsharp constant.character.string.escape.fsharp",
"r": {
- "dark_plus": "string: #CE9178",
- "light_plus": "string: #A31515",
+ "dark_plus": "constant.character: #569CD6",
+ "light_plus": "constant.character: #0000FF",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
- "hc_black": "string: #CE9178"
+ "hc_black": "constant.character: #569CD6"
}
},
{
diff --git a/extensions/git/npm-shrinkwrap.json b/extensions/git/npm-shrinkwrap.json
index d757c142e96..9e5bed8584a 100644
--- a/extensions/git/npm-shrinkwrap.json
+++ b/extensions/git/npm-shrinkwrap.json
@@ -7,13 +7,18 @@
"from": "applicationinsights@0.18.0",
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz"
},
+ "byline": {
+ "version": "5.0.0",
+ "from": "byline@latest",
+ "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz"
+ },
"iconv-lite": {
- "version": "0.4.15",
- "from": "iconv-lite@0.4.15",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz"
+ "version": "0.4.19",
+ "from": "iconv-lite@0.4.19",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz"
},
"vscode-extension-telemetry": {
- "version": "0.0.7",
+ "version": "0.0.8",
"from": "vscode-extension-telemetry@>=0.0.8 <0.0.9",
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz"
},
diff --git a/extensions/git/package.json b/extensions/git/package.json
index bd646d7f8a6..cf90adfa2b6 100644
--- a/extensions/git/package.json
+++ b/extensions/git/package.json
@@ -36,6 +36,11 @@
"dark": "resources/icons/dark/git.svg"
}
},
+ {
+ "command": "git.close",
+ "title": "%command.close%",
+ "category": "Git"
+ },
{
"command": "git.refresh",
"title": "%command.refresh%",
@@ -96,6 +101,24 @@
"title": "%command.revertSelectedRanges%",
"category": "Git"
},
+ {
+ "command": "git.stageChange",
+ "title": "%command.stageChange%",
+ "category": "Git",
+ "icon": {
+ "light": "resources/icons/light/stage.svg",
+ "dark": "resources/icons/dark/stage.svg"
+ }
+ },
+ {
+ "command": "git.revertChange",
+ "title": "%command.revertChange%",
+ "category": "Git",
+ "icon": {
+ "light": "resources/icons/light/clean.svg",
+ "dark": "resources/icons/dark/clean.svg"
+ }
+ },
{
"command": "git.unstage",
"title": "%command.unstage%",
@@ -241,6 +264,11 @@
"title": "%command.sync%",
"category": "Git"
},
+ {
+ "command": "git.syncRebase",
+ "title": "%command.syncRebase%",
+ "category": "Git"
+ },
{
"command": "git.publish",
"title": "%command.publish%",
@@ -310,10 +338,18 @@
"command": "git.stageSelectedRanges",
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
},
+ {
+ "command": "git.stageChange",
+ "when": "false"
+ },
{
"command": "git.revertSelectedRanges",
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
},
+ {
+ "command": "git.revertChange",
+ "when": "false"
+ },
{
"command": "git.unstage",
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
@@ -418,6 +454,10 @@
"command": "git.sync",
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
},
+ {
+ "command": "git.syncRebase",
+ "when": "config.git.enabled && gitOpenRepositoryCount != 0"
+ },
{
"command": "git.publish",
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
@@ -464,6 +504,11 @@
"group": "1_sync",
"when": "config.git.enabled && scmProvider == git"
},
+ {
+ "command": "git.syncRebase",
+ "group": "1_sync",
+ "when": "config.git.enabled && scmProvider == git && gitState == idle"
+ },
{
"command": "git.pull",
"group": "1_sync",
@@ -529,6 +574,11 @@
"group": "3_commit",
"when": "config.git.enabled && scmProvider == git"
},
+ {
+ "command": "git.stageAll",
+ "group": "4_stage",
+ "when": "config.git.enabled && scmProvider == git"
+ },
{
"command": "git.unstageAll",
"group": "4_stage",
@@ -560,6 +610,13 @@
"when": "config.git.enabled && scmProvider == git"
}
],
+ "scm/sourceControl": [
+ {
+ "command": "git.close",
+ "group": "navigation",
+ "when": "config.git.enabled && scmProvider == git"
+ }
+ ],
"scm/resourceGroup/context": [
{
"command": "git.stageAll",
@@ -688,7 +745,7 @@
{
"command": "git.openChange",
"group": "navigation",
- "when": "config.git.enabled && gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme != extension"
+ "when": "config.git.enabled && gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
},
{
"command": "git.stageSelectedRanges",
@@ -705,6 +762,16 @@
"group": "2_git@3",
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
}
+ ],
+ "scm/change/title": [
+ {
+ "command": "git.stageChange",
+ "when": "config.git.enabled && originalResourceScheme == git"
+ },
+ {
+ "command": "git.revertChange",
+ "when": "config.git.enabled && originalResourceScheme == git"
+ }
]
},
"configuration": {
@@ -784,18 +851,72 @@
"type": "boolean",
"description": "%config.enableCommitSigning%",
"default": false
+ },
+ "git.decorations.enabled": {
+ "type": "boolean",
+ "default": true,
+ "description": "%config.decorations.enabled%"
}
}
- }
+ },
+ "colors": [
+ {
+ "id": "gitDecoration.modifiedResourceForeground",
+ "description": "%colors.modified%",
+ "defaults": {
+ "light": "#a76e12",
+ "dark": "#E2C08D",
+ "highContrast": "#E2C08D"
+ }
+ },
+ {
+ "id": "gitDecoration.deletedResourceForeground",
+ "description": "%colors.deleted%",
+ "defaults": {
+ "light": "#ad0707",
+ "dark": "#c74e39",
+ "highContrast": "#c74e39"
+ }
+ },
+ {
+ "id": "gitDecoration.untrackedResourceForeground",
+ "description": "%colors.untracked%",
+ "defaults": {
+ "light": "#019001",
+ "dark": "#73C991",
+ "highContrast": "#73C991"
+ }
+ },
+ {
+ "id": "gitDecoration.ignoredResourceForeground",
+ "description": "%colors.ignored%",
+ "defaults": {
+ "light": "#8E8E90",
+ "dark": "#A7A8A9",
+ "highContrast": "#A7A8A9"
+ }
+ },
+ {
+ "id": "gitDecoration.conflictingResourceForeground",
+ "description": "%colors.conflict%",
+ "defaults": {
+ "light": "#6c6cc4",
+ "dark": "#6c6cc4",
+ "highContrast": "#6c6cc4"
+ }
+ }
+ ]
},
"dependencies": {
- "iconv-lite": "0.4.15",
+ "byline": "^5.0.0",
+ "iconv-lite": "0.4.19",
"vscode-extension-telemetry": "0.0.8",
"vscode-nls": "2.0.2"
},
"devDependencies": {
- "@types/mocha": "^2.2.41",
- "@types/node": "^7.0.4",
+ "@types/mocha": "2.2.43",
+ "@types/node": "7.0.43",
+ "@types/byline": "4.2.31",
"mocha": "^3.2.0"
}
}
\ No newline at end of file
diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json
index da2c9210fd1..e001bbcbb20 100644
--- a/extensions/git/package.nls.json
+++ b/extensions/git/package.nls.json
@@ -10,6 +10,8 @@
"command.stageAll": "Stage All Changes",
"command.stageSelectedRanges": "Stage Selected Ranges",
"command.revertSelectedRanges": "Revert Selected Ranges",
+ "command.stageChange": "Stage Change",
+ "command.revertChange": "Revert Change",
"command.unstage": "Unstage Changes",
"command.unstageAll": "Unstage All Changes",
"command.unstageSelectedRanges": "Unstage Selected Ranges",
@@ -35,6 +37,7 @@
"command.pushTo": "Push to...",
"command.pushWithTags": "Push With Tags",
"command.sync": "Sync",
+ "command.syncRebase": "Sync (Rebase)",
"command.publish": "Publish Branch",
"command.showOutput": "Show Git Output",
"command.ignore": "Add File to .gitignore",
@@ -54,5 +57,11 @@
"config.defaultCloneDirectory": "The default location where to clone a git repository",
"config.enableSmartCommit": "Commit all changes when there are no staged changes.",
"config.enableCommitSigning": "Enables commit signing with GPG.",
- "config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run."
-}
\ No newline at end of file
+ "config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run.",
+ "config.decorations.enabled": "Controls if Git contributes colors and badges to the explorer and the open editors view.",
+ "colors.modified": "Color for modified resources.",
+ "colors.deleted": "Color for deleted resources.",
+ "colors.untracked": "Color for untracked resources.",
+ "colors.ignored": "Color for ignored resources.",
+ "colors.conflict": "Color for resources with conflicts."
+}
diff --git a/extensions/git/src/askpass-main.ts b/extensions/git/src/askpass-main.ts
index db1bdeac366..3f2588d1939 100644
--- a/extensions/git/src/askpass-main.ts
+++ b/extensions/git/src/askpass-main.ts
@@ -34,8 +34,8 @@ function main(argv: string[]): void {
return fatal('Skip fetch commands');
}
- const output = process.env['VSCODE_GIT_ASKPASS_PIPE'];
- const socketPath = process.env['VSCODE_GIT_ASKPASS_HANDLE'];
+ const output = process.env['VSCODE_GIT_ASKPASS_PIPE'] as string;
+ const socketPath = process.env['VSCODE_GIT_ASKPASS_HANDLE'] as string;
const request = argv[2];
const host = argv[4].substring(1, argv[4].length - 2);
const opts: http.RequestOptions = {
diff --git a/extensions/git/src/askpass.ts b/extensions/git/src/askpass.ts
index 597cc043d4e..8c6815b8d1d 100644
--- a/extensions/git/src/askpass.ts
+++ b/extensions/git/src/askpass.ts
@@ -28,7 +28,7 @@ function getIPCHandlePath(nonce: string): string {
}
if (process.env['XDG_RUNTIME_DIR']) {
- return path.join(process.env['XDG_RUNTIME_DIR'], `vscode-git-askpass-${nonce}.sock`);
+ return path.join(process.env['XDG_RUNTIME_DIR'] as string, `vscode-git-askpass-${nonce}.sock`);
}
return path.join(os.tmpdir(), `vscode-git-askpass-${nonce}.sock`);
diff --git a/extensions/git/src/autofetch.ts b/extensions/git/src/autofetch.ts
index 930fc2f05f3..a984a20c6b6 100644
--- a/extensions/git/src/autofetch.ts
+++ b/extensions/git/src/autofetch.ts
@@ -5,16 +5,23 @@
'use strict';
-import { workspace, Disposable } from 'vscode';
+import { workspace, Disposable, EventEmitter } from 'vscode';
import { GitErrorCodes } from './git';
import { Repository } from './repository';
-import { throttle } from './decorators';
+import { eventToPromise, filterEvent } from './util';
export class AutoFetcher {
private static Period = 3 * 60 * 1000 /* three minutes */;
+
+ private _onDidChange = new EventEmitter();
+ private onDidChange = this._onDidChange.event;
+
+ private _enabled: boolean = false;
+ get enabled(): boolean { return this._enabled; }
+ set enabled(enabled: boolean) { this._enabled = enabled; this._onDidChange.fire(enabled); }
+
private disposables: Disposable[] = [];
- private timer: NodeJS.Timer;
constructor(private repository: Repository) {
workspace.onDidChangeConfiguration(this.onConfiguration, this, this.disposables);
@@ -32,26 +39,41 @@ export class AutoFetcher {
}
enable(): void {
- if (this.timer) {
+ if (this.enabled) {
return;
}
- this.fetch();
- this.timer = setInterval(() => this.fetch(), AutoFetcher.Period);
+ this.enabled = true;
+ this.run();
}
disable(): void {
- clearInterval(this.timer);
+ this.enabled = false;
}
- @throttle
- private async fetch(): Promise {
- try {
- await this.repository.fetch();
- } catch (err) {
- if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
- this.disable();
+ private async run(): Promise {
+ while (this.enabled) {
+ await this.repository.whenIdleAndFocused();
+
+ if (!this.enabled) {
+ return;
}
+
+ try {
+ await this.repository.fetch();
+ } catch (err) {
+ if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
+ this.disable();
+ }
+ }
+
+ if (!this.enabled) {
+ return;
+ }
+
+ const timeout = new Promise(c => setTimeout(c, AutoFetcher.Period));
+ const whenDisabled = eventToPromise(filterEvent(this.onDidChange, enabled => !enabled));
+ await Promise.race([timeout, whenDisabled]);
}
}
diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts
index abc58d41aae..a78041e69bd 100644
--- a/extensions/git/src/commands.ts
+++ b/extensions/git/src/commands.ts
@@ -5,11 +5,12 @@
'use strict';
-import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation } from 'vscode';
+import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor } from 'vscode';
import { Ref, RefType, Git, GitErrorCodes, Branch } from './git';
import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository';
import { Model } from './model';
import { toGitUri, fromGitUri } from './uri';
+import { grep } from './util';
import { applyLineChanges, intersectDiffWithRange, toLineRanges, invertLineChange } from './staging';
import * as path from 'path';
import * as os from 'os';
@@ -92,11 +93,13 @@ class MergeItem implements QuickPickItem {
class CreateBranchItem implements QuickPickItem {
+ constructor(private cc: CommandCenter) { }
+
get label(): string { return localize('create branch', '$(plus) Create new branch'); }
get description(): string { return ''; }
async run(repository: Repository): Promise {
- await commands.executeCommand('git.branch');
+ await this.cc.branch(repository);
}
}
@@ -169,12 +172,14 @@ export class CommandCenter {
const opts: TextDocumentShowOptions = {
preserveFocus,
preview,
- viewColumn: window.activeTextEditor && window.activeTextEditor.viewColumn || ViewColumn.One
+ viewColumn: ViewColumn.Active
};
const activeTextEditor = window.activeTextEditor;
- if (preserveSelection && activeTextEditor && activeTextEditor.document.uri.fsPath === right.fsPath) {
+ // Check if active text editor has same path as other editor. we cannot compare via
+ // URI.toString() here because the schemas can be different. Instead we just go by path.
+ if (preserveSelection && activeTextEditor && activeTextEditor.document.uri.path === right.path) {
opts.selection = activeTextEditor.selection;
}
@@ -256,13 +261,20 @@ export class CommandCenter {
}
@command('git.clone')
- async clone(): Promise {
- const url = await window.showInputBox({
- prompt: localize('repourl', "Repository URL"),
- ignoreFocusOut: true
- });
+ async clone(url?: string): Promise {
+ if (!url) {
+ url = await window.showInputBox({
+ prompt: localize('repourl', "Repository URL"),
+ ignoreFocusOut: true
+ });
+ }
if (!url) {
+ /* __GDPR__
+ "clone" : {
+ "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
+ }
+ */
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'no_URL' });
return;
}
@@ -277,6 +289,11 @@ export class CommandCenter {
});
if (!parentPath) {
+ /* __GDPR__
+ "clone" : {
+ "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
+ }
+ */
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'no_directory' });
return;
}
@@ -294,14 +311,30 @@ export class CommandCenter {
const result = await window.showInformationMessage(localize('proposeopen', "Would you like to open the cloned repository?"), open);
const openFolder = result === open;
+ /* __GDPR__
+ "clone" : {
+ "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
+ "openFolder": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
+ }
+ */
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'success' }, { openFolder: openFolder ? 1 : 0 });
if (openFolder) {
commands.executeCommand('vscode.openFolder', Uri.file(repositoryPath));
}
} catch (err) {
if (/already exists and is not an empty directory/.test(err && err.stderr || '')) {
+ /* __GDPR__
+ "clone" : {
+ "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
+ }
+ */
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'directory_not_empty' });
} else {
+ /* __GDPR__
+ "clone" : {
+ "outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
+ }
+ */
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'error' });
}
throw err;
@@ -310,25 +343,44 @@ export class CommandCenter {
@command('git.init')
async init(): Promise {
- const value = workspace.workspaceFolders && workspace.workspaceFolders.length > 0
- ? workspace.workspaceFolders[0].uri.fsPath
- : os.homedir();
+ const homeUri = Uri.file(os.homedir());
+ const defaultUri = workspace.workspaceFolders && workspace.workspaceFolders.length > 0
+ ? Uri.file(workspace.workspaceFolders[0].uri.fsPath)
+ : homeUri;
- const path = await window.showInputBox({
- placeHolder: localize('path to init', "Folder path"),
- prompt: localize('provide path', "Please provide a folder path to initialize a Git repository"),
- value,
- ignoreFocusOut: true
+ const result = await window.showOpenDialog({
+ canSelectFiles: false,
+ canSelectFolders: true,
+ canSelectMany: false,
+ defaultUri,
+ openLabel: localize('init repo', "Initialize Repository")
});
- if (!path) {
+ if (!result || result.length === 0) {
return;
}
+ const uri = result[0];
+
+ if (homeUri.toString().startsWith(uri.toString())) {
+ const yes = localize('create repo', "Initialize Repository");
+ const answer = await window.showWarningMessage(localize('are you sure', "This will create a Git repository in '{0}'. Are you sure you want to continue?", uri.fsPath), yes);
+
+ if (answer !== yes) {
+ return;
+ }
+ }
+
+ const path = uri.fsPath;
await this.git.init(path);
await this.model.tryOpenRepository(path);
}
+ @command('git.close', { repository: true })
+ async close(repository: Repository): Promise {
+ this.model.close(repository);
+ }
+
@command('git.openFile')
async openFile(arg?: Resource | Uri, ...resourceStates: SourceControlResourceState[]): Promise {
const preserveFocus = arg instanceof Resource;
@@ -363,11 +415,13 @@ export class CommandCenter {
for (const uri of uris) {
const opts: TextDocumentShowOptions = {
preserveFocus,
- preview: preview,
- viewColumn: activeTextEditor && activeTextEditor.viewColumn || ViewColumn.One
+ preview,
+ viewColumn: ViewColumn.Active
};
- if (activeTextEditor && activeTextEditor.document.uri.fsPath === uri.fsPath) {
+ // Check if active text editor has same path as other editor. we cannot compare via
+ // URI.toString() here because the schemas can be different. Instead we just go by path.
+ if (activeTextEditor && activeTextEditor.document.uri.path === uri.path) {
opts.selection = activeTextEditor.selection;
}
@@ -449,12 +503,20 @@ export class CommandCenter {
}
const selection = resourceStates.filter(s => s instanceof Resource) as Resource[];
- const mergeConflicts = selection.filter(s => s.resourceGroupType === ResourceGroupType.Merge);
+ const merge = selection.filter(s => s.resourceGroupType === ResourceGroupType.Merge);
+ const bothModified = merge.filter(s => s.type === Status.BOTH_MODIFIED);
+ const promises = bothModified.map(s => grep(s.resourceUri.fsPath, /^<{7}|^={7}|^>{7}/));
+ const unresolvedBothModified = await Promise.all(promises);
+ const resolvedConflicts = bothModified.filter((s, i) => !unresolvedBothModified[i]);
+ const unresolvedConflicts = [
+ ...merge.filter(s => s.type !== Status.BOTH_MODIFIED),
+ ...bothModified.filter((s, i) => unresolvedBothModified[i])
+ ];
- if (mergeConflicts.length > 0) {
- const message = mergeConflicts.length > 1
- ? localize('confirm stage files with merge conflicts', "Are you sure you want to stage {0} files with merge conflicts?", mergeConflicts.length)
- : localize('confirm stage file with merge conflicts', "Are you sure you want to stage {0} with merge conflicts?", path.basename(mergeConflicts[0].resourceUri.fsPath));
+ if (unresolvedConflicts.length > 0) {
+ const message = unresolvedConflicts.length > 1
+ ? localize('confirm stage files with merge conflicts', "Are you sure you want to stage {0} files with merge conflicts?", unresolvedConflicts.length)
+ : localize('confirm stage file with merge conflicts', "Are you sure you want to stage {0} with merge conflicts?", path.basename(unresolvedConflicts[0].resourceUri.fsPath));
const yes = localize('yes', "Yes");
const pick = await window.showWarningMessage(message, { modal: true }, yes);
@@ -464,10 +526,8 @@ export class CommandCenter {
}
}
- const workingTree = selection
- .filter(s => s.resourceGroupType === ResourceGroupType.WorkingTree);
-
- const scmResources = [...workingTree, ...mergeConflicts];
+ const workingTree = selection.filter(s => s.resourceGroupType === ResourceGroupType.WorkingTree);
+ const scmResources = [...workingTree, ...resolvedConflicts, ...unresolvedConflicts];
if (!scmResources.length) {
return;
@@ -498,14 +558,39 @@ export class CommandCenter {
await repository.add([]);
}
+ @command('git.stageChange')
+ async stageChange(uri: Uri, changes: LineChange[], index: number): Promise {
+ const textEditor = window.visibleTextEditors.filter(e => e.document.uri.toString() === uri.toString())[0];
+
+ if (!textEditor) {
+ return;
+ }
+
+ await this._stageChanges(textEditor, [changes[index]]);
+ }
+
@command('git.stageSelectedRanges', { diff: true })
- async stageSelectedRanges(diffs: LineChange[]): Promise {
+ async stageSelectedChanges(changes: LineChange[]): Promise {
const textEditor = window.activeTextEditor;
if (!textEditor) {
return;
}
+ const modifiedDocument = textEditor.document;
+ const selectedLines = toLineRanges(textEditor.selections, modifiedDocument);
+ const selectedChanges = changes
+ .map(diff => selectedLines.reduce((result, range) => result || intersectDiffWithRange(modifiedDocument, diff, range), null))
+ .filter(d => !!d) as LineChange[];
+
+ if (!selectedChanges.length) {
+ return;
+ }
+
+ await this._stageChanges(textEditor, selectedChanges);
+ }
+
+ private async _stageChanges(textEditor: TextEditor, changes: LineChange[]): Promise {
const modifiedDocument = textEditor.document;
const modifiedUri = modifiedDocument.uri;
@@ -515,28 +600,48 @@ export class CommandCenter {
const originalUri = toGitUri(modifiedUri, '~');
const originalDocument = await workspace.openTextDocument(originalUri);
- const selectedLines = toLineRanges(textEditor.selections, modifiedDocument);
- const selectedDiffs = diffs
- .map(diff => selectedLines.reduce((result, range) => result || intersectDiffWithRange(modifiedDocument, diff, range), null))
- .filter(d => !!d) as LineChange[];
-
- if (!selectedDiffs.length) {
- return;
- }
-
- const result = applyLineChanges(originalDocument, modifiedDocument, selectedDiffs);
+ const result = applyLineChanges(originalDocument, modifiedDocument, changes);
await this.runByRepository(modifiedUri, async (repository, resource) => await repository.stage(resource, result));
}
+ @command('git.revertChange')
+ async revertChange(uri: Uri, changes: LineChange[], index: number): Promise {
+ const textEditor = window.visibleTextEditors.filter(e => e.document.uri.toString() === uri.toString())[0];
+
+ if (!textEditor) {
+ return;
+ }
+
+ await this._revertChanges(textEditor, [...changes.slice(0, index), ...changes.slice(index + 1)]);
+ }
+
@command('git.revertSelectedRanges', { diff: true })
- async revertSelectedRanges(diffs: LineChange[]): Promise {
+ async revertSelectedRanges(changes: LineChange[]): Promise {
const textEditor = window.activeTextEditor;
if (!textEditor) {
return;
}
+ const modifiedDocument = textEditor.document;
+ const selections = textEditor.selections;
+ const selectedChanges = changes.filter(change => {
+ const modifiedRange = change.modifiedEndLineNumber === 0
+ ? new Range(modifiedDocument.lineAt(change.modifiedStartLineNumber - 1).range.end, modifiedDocument.lineAt(change.modifiedStartLineNumber).range.start)
+ : new Range(modifiedDocument.lineAt(change.modifiedStartLineNumber - 1).range.start, modifiedDocument.lineAt(change.modifiedEndLineNumber - 1).range.end);
+
+ return selections.every(selection => !selection.intersection(modifiedRange));
+ });
+
+ if (selectedChanges.length === changes.length) {
+ return;
+ }
+
+ await this._revertChanges(textEditor, selectedChanges);
+ }
+
+ private async _revertChanges(textEditor: TextEditor, changes: LineChange[]): Promise {
const modifiedDocument = textEditor.document;
const modifiedUri = modifiedDocument.uri;
@@ -546,19 +651,6 @@ export class CommandCenter {
const originalUri = toGitUri(modifiedUri, '~');
const originalDocument = await workspace.openTextDocument(originalUri);
- const selections = textEditor.selections;
- const selectedDiffs = diffs.filter(diff => {
- const modifiedRange = diff.modifiedEndLineNumber === 0
- ? new Range(modifiedDocument.lineAt(diff.modifiedStartLineNumber - 1).range.end, modifiedDocument.lineAt(diff.modifiedStartLineNumber).range.start)
- : new Range(modifiedDocument.lineAt(diff.modifiedStartLineNumber - 1).range.start, modifiedDocument.lineAt(diff.modifiedEndLineNumber - 1).range.end);
-
- return selections.every(selection => !selection.intersection(modifiedRange));
- });
-
- if (selectedDiffs.length === diffs.length) {
- return;
- }
-
const basename = path.basename(modifiedUri.fsPath);
const message = localize('confirm revert', "Are you sure you want to revert the selected changes in {0}?", basename);
const yes = localize('revert', "Revert Changes");
@@ -568,10 +660,11 @@ export class CommandCenter {
return;
}
- const result = applyLineChanges(originalDocument, modifiedDocument, selectedDiffs);
+ const result = applyLineChanges(originalDocument, modifiedDocument, changes);
const edit = new WorkspaceEdit();
edit.replace(modifiedUri, new Range(new Position(0, 0), modifiedDocument.lineAt(modifiedDocument.lineCount - 1).range.end), result);
workspace.applyEdit(edit);
+ await modifiedDocument.save();
}
@command('git.unstage')
@@ -907,7 +1000,7 @@ export class CommandCenter {
const includeTags = checkoutType === 'all' || checkoutType === 'tags';
const includeRemotes = checkoutType === 'all' || checkoutType === 'remote';
- const createBranch = new CreateBranchItem();
+ const createBranch = new CreateBranchItem(this);
const heads = repository.refs.filter(ref => ref.type === RefType.Head)
.map(ref => new CheckoutItem(ref));
@@ -1145,8 +1238,7 @@ export class CommandCenter {
repository.pushTo(pick.label, branchName);
}
- @command('git.sync', { repository: true })
- async sync(repository: Repository): Promise {
+ private async _sync(repository: Repository, rebase: boolean): Promise {
const HEAD = repository.HEAD;
if (!HEAD || !HEAD.upstream) {
@@ -1169,7 +1261,34 @@ export class CommandCenter {
}
}
- await repository.sync();
+ if (rebase) {
+ await repository.syncRebase();
+ } else {
+ await repository.sync();
+ }
+ }
+
+ @command('git.sync', { repository: true })
+ sync(repository: Repository): Promise {
+ return this._sync(repository, false);
+ }
+
+ @command('git._syncAll')
+ async syncAll(): Promise {
+ await Promise.all(this.model.repositories.map(async repository => {
+ const HEAD = repository.HEAD;
+
+ if (!HEAD || !HEAD.upstream) {
+ return;
+ }
+
+ await repository.sync();
+ }));
+ }
+
+ @command('git.syncRebase', { repository: true })
+ syncRebase(repository: Repository): Promise {
+ return this._sync(repository, true);
}
@command('git.publish', { repository: true })
@@ -1182,9 +1301,12 @@ export class CommandCenter {
}
const branchName = repository.HEAD && repository.HEAD.name || '';
- const picks = repository.remotes.map(r => r.name);
- const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
- const choice = await window.showQuickPick(picks, { placeHolder });
+ const selectRemote = async () => {
+ const picks = repository.remotes.map(r => r.name);
+ const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
+ return await window.showQuickPick(picks, { placeHolder });
+ };
+ const choice = remotes.length === 1 ? remotes[0].name : await selectRemote();
if (!choice) {
return;
@@ -1198,27 +1320,27 @@ export class CommandCenter {
this.outputChannel.show();
}
- @command('git.ignore', { repository: true })
- async ignore(repository: Repository, ...resourceStates: SourceControlResourceState[]): Promise {
+ @command('git.ignore')
+ async ignore(...resourceStates: SourceControlResourceState[]): Promise {
if (resourceStates.length === 0 || !(resourceStates[0].resourceUri instanceof Uri)) {
- const uri = window.activeTextEditor && window.activeTextEditor.document.uri;
+ const resource = this.getSCMResource();
- if (!uri) {
+ if (!resource) {
return;
}
- return await repository.ignore([uri]);
+ resourceStates = [resource];
}
- const uris = resourceStates
+ const resources = resourceStates
.filter(s => s instanceof Resource)
.map(r => r.resourceUri);
- if (!uris.length) {
+ if (!resources.length) {
return;
}
- await repository.ignore(uris);
+ await this.runByRepository(resources, async (repository, resources) => repository.ignore(resources));
}
@command('git.stash', { repository: true })
@@ -1273,7 +1395,7 @@ export class CommandCenter {
}
private createCommand(id: string, key: string, method: Function, options: CommandOptions): (...args: any[]) => any {
- const result = (...args) => {
+ const result = (...args: any[]) => {
let result: Promise;
if (!options.repository) {
@@ -1300,6 +1422,11 @@ export class CommandCenter {
});
}
+ /* __GDPR__
+ "git.command" : {
+ "command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
+ }
+ */
this.telemetryReporter.sendTelemetryEvent('git.command', { command: id });
return result.catch(async err => {
@@ -1317,7 +1444,7 @@ export class CommandCenter {
.replace(/^error: /mi, '')
.replace(/^> husky.*$/mi, '')
.split(/[\r\n]/)
- .filter(line => !!line)
+ .filter((line: string) => !!line)
[0];
message = hint
@@ -1343,7 +1470,7 @@ export class CommandCenter {
};
// patch this object, so people can call methods directly
- this[key] = result;
+ (this as any)[key] = result;
return result;
}
@@ -1387,7 +1514,7 @@ export class CommandCenter {
return result;
}
- const tuple = result.filter(p => p[0] === repository)[0];
+ const tuple = result.filter(p => p.repository === repository)[0];
if (tuple) {
tuple.resources.push(resource);
@@ -1407,4 +1534,4 @@ export class CommandCenter {
dispose(): void {
this.disposables.forEach(d => d.dispose());
}
-}
\ No newline at end of file
+}
diff --git a/extensions/git/src/contentProvider.ts b/extensions/git/src/contentProvider.ts
index f47765c484e..4363c80af8e 100644
--- a/extensions/git/src/contentProvider.ts
+++ b/extensions/git/src/contentProvider.ts
@@ -6,9 +6,10 @@
'use strict';
import { workspace, Uri, Disposable, Event, EventEmitter, window } from 'vscode';
-import { debounce } from './decorators';
-import { fromGitUri } from './uri';
-import { Model, ModelChangeEvent } from './model';
+import { debounce, throttle } from './decorators';
+import { fromGitUri, toGitUri } from './uri';
+import { Model, ModelChangeEvent, OriginalResourceChangeEvent } from './model';
+import { filterEvent, eventToPromise } from './util';
interface CacheRow {
uri: Uri;
@@ -24,8 +25,8 @@ const FIVE_MINUTES = 1000 * 60 * 5;
export class GitContentProvider {
- private onDidChangeEmitter = new EventEmitter();
- get onDidChange(): Event { return this.onDidChangeEmitter.event; }
+ private _onDidChange = new EventEmitter();
+ get onDidChange(): Event { return this._onDidChange.event; }
private changedRepositoryRoots = new Set();
private cache: Cache = Object.create(null);
@@ -34,6 +35,7 @@ export class GitContentProvider {
constructor(private model: Model) {
this.disposables.push(
model.onDidChangeRepository(this.onDidChangeRepository, this),
+ model.onDidChangeOriginalResource(this.onDidChangeOriginalResource, this),
workspace.registerTextDocumentContentProvider('git', this)
);
@@ -45,19 +47,33 @@ export class GitContentProvider {
this.eventuallyFireChangeEvents();
}
+ private onDidChangeOriginalResource({ uri }: OriginalResourceChangeEvent): void {
+ if (uri.scheme !== 'file') {
+ return;
+ }
+
+ this._onDidChange.fire(toGitUri(uri, '', true));
+ }
+
@debounce(1100)
private eventuallyFireChangeEvents(): void {
this.fireChangeEvents();
}
- private fireChangeEvents(): void {
+ @throttle
+ private async fireChangeEvents(): Promise {
+ if (!window.state.focused) {
+ const onDidFocusWindow = filterEvent(window.onDidChangeWindowState, e => e.focused);
+ await eventToPromise(onDidFocusWindow);
+ }
+
Object.keys(this.cache).forEach(key => {
const uri = this.cache[key].uri;
const fsPath = uri.fsPath;
for (const root of this.changedRepositoryRoots) {
if (fsPath.startsWith(root)) {
- this.onDidChangeEmitter.fire(uri);
+ this._onDidChange.fire(uri);
return;
}
}
@@ -75,7 +91,7 @@ export class GitContentProvider {
const cacheKey = uri.toString();
const timestamp = new Date().getTime();
- const cacheValue = { uri, timestamp };
+ const cacheValue: CacheRow = { uri, timestamp };
this.cache[cacheKey] = cacheValue;
@@ -101,7 +117,10 @@ export class GitContentProvider {
Object.keys(this.cache).forEach(key => {
const row = this.cache[key];
- const isOpen = window.visibleTextEditors.some(e => e.document.uri.fsPath === row.uri.fsPath);
+ const { path } = fromGitUri(row.uri);
+ const isOpen = workspace.textDocuments
+ .filter(d => d.uri.scheme === 'file')
+ .some(d => d.uri.fsPath === path);
if (isOpen || now - row.timestamp < THREE_MINUTES) {
cache[row.uri.toString()] = row;
diff --git a/extensions/git/src/decorationProvider.ts b/extensions/git/src/decorationProvider.ts
new file mode 100644
index 00000000000..dcd1077819e
--- /dev/null
+++ b/extensions/git/src/decorationProvider.ts
@@ -0,0 +1,173 @@
+/*---------------------------------------------------------------------------------------------
+ * 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 { window, workspace, Uri, Disposable, Event, EventEmitter, DecorationData, DecorationProvider, ThemeColor } from 'vscode';
+import { Repository, GitResourceGroup } from './repository';
+import { Model } from './model';
+import { debounce } from './decorators';
+import { filterEvent } from './util';
+
+class GitIgnoreDecorationProvider implements DecorationProvider {
+
+ private readonly _onDidChangeDecorations = new EventEmitter();
+ readonly onDidChangeDecorations: Event = this._onDidChangeDecorations.event;
+
+ private checkIgnoreQueue = new Map void, reject: (err: any) => void }>();
+ private disposables: Disposable[] = [];
+
+ constructor(private repository: Repository) {
+ this.disposables.push(
+ window.registerDecorationProvider(this),
+ filterEvent(workspace.onDidSaveTextDocument, e => e.fileName.endsWith('.gitignore'))(_ => this._onDidChangeDecorations.fire())
+ //todo@joh -> events when the ignore status actually changes, not only when the file changes
+ );
+ }
+
+ dispose(): void {
+ this.disposables.forEach(d => d.dispose());
+ this.checkIgnoreQueue.clear();
+ }
+
+ provideDecoration(uri: Uri): Promise {
+ return new Promise((resolve, reject) => {
+ this.checkIgnoreQueue.set(uri.fsPath, { resolve, reject });
+ this.checkIgnoreSoon();
+ }).then(ignored => {
+ if (ignored) {
+ return {
+ priority: 3,
+ color: new ThemeColor('gitDecoration.ignoredResourceForeground')
+ };
+ }
+ });
+ }
+
+ @debounce(500)
+ private checkIgnoreSoon(): void {
+ const queue = new Map(this.checkIgnoreQueue.entries());
+ this.checkIgnoreQueue.clear();
+ this.repository.checkIgnore([...queue.keys()]).then(ignoreSet => {
+ for (const [key, value] of queue.entries()) {
+ value.resolve(ignoreSet.has(key));
+ }
+ }, err => {
+ console.error(err);
+ for (const [, value] of queue.entries()) {
+ value.reject(err);
+ }
+ });
+ }
+}
+
+class GitDecorationProvider implements DecorationProvider {
+
+ private readonly _onDidChangeDecorations = new EventEmitter();
+ readonly onDidChangeDecorations: Event = this._onDidChangeDecorations.event;
+
+ private disposables: Disposable[] = [];
+ private decorations = new Map();
+
+ constructor(private repository: Repository) {
+ this.disposables.push(
+ window.registerDecorationProvider(this),
+ repository.onDidRunOperation(this.onDidRunOperation, this)
+ );
+ }
+
+ private onDidRunOperation(): void {
+ let newDecorations = new Map();
+ this.collectDecorationData(this.repository.indexGroup, newDecorations);
+ this.collectDecorationData(this.repository.workingTreeGroup, newDecorations);
+ this.collectDecorationData(this.repository.mergeGroup, newDecorations);
+
+ let uris: Uri[] = [];
+ newDecorations.forEach((value, uriString) => {
+ if (this.decorations.has(uriString)) {
+ this.decorations.delete(uriString);
+ } else {
+ uris.push(Uri.parse(uriString));
+ }
+ });
+ this.decorations.forEach((value, uriString) => {
+ uris.push(Uri.parse(uriString));
+ });
+ this.decorations = newDecorations;
+ this._onDidChangeDecorations.fire(uris);
+ }
+
+ private collectDecorationData(group: GitResourceGroup, bucket: Map): void {
+ group.resourceStates.forEach(r => {
+ if (r.resourceDecoration) {
+ bucket.set(r.original.toString(), r.resourceDecoration);
+ }
+ });
+ }
+
+ provideDecoration(uri: Uri): DecorationData | undefined {
+ return this.decorations.get(uri.toString());
+ }
+
+ dispose(): void {
+ this.disposables.forEach(d => d.dispose());
+ }
+}
+
+
+export class GitDecorations {
+
+ private configListener: Disposable;
+ private modelListener: Disposable[] = [];
+ private providers = new Map();
+
+ constructor(private model: Model) {
+ this.configListener = workspace.onDidChangeConfiguration(e => e.affectsConfiguration('git.decorations.enabled') && this.update());
+ this.update();
+ }
+
+ private update(): void {
+ const enabled = workspace.getConfiguration('git').get('decorations.enabled');
+ if (enabled) {
+ this.enable();
+ } else {
+ this.disable();
+ }
+ }
+
+ private enable(): void {
+ this.modelListener = [];
+ this.model.onDidOpenRepository(this.onDidOpenRepository, this, this.modelListener);
+ this.model.onDidCloseRepository(this.onDidCloseRepository, this, this.modelListener);
+ this.model.repositories.forEach(this.onDidOpenRepository, this);
+ }
+
+ private disable(): void {
+ this.modelListener.forEach(d => d.dispose());
+ this.providers.forEach(value => value.dispose());
+ this.providers.clear();
+ }
+
+ private onDidOpenRepository(repository: Repository): void {
+ const provider = new GitDecorationProvider(repository);
+ const ignoreProvider = new GitIgnoreDecorationProvider(repository);
+ this.providers.set(repository, Disposable.from(provider, ignoreProvider));
+ }
+
+ private onDidCloseRepository(repository: Repository): void {
+ const provider = this.providers.get(repository);
+ if (provider) {
+ provider.dispose();
+ this.providers.delete(repository);
+ }
+ }
+
+ dispose(): void {
+ this.configListener.dispose();
+ this.modelListener.forEach(d => d.dispose());
+ this.providers.forEach(value => value.dispose);
+ this.providers.clear();
+ }
+}
diff --git a/extensions/git/src/decorators.ts b/extensions/git/src/decorators.ts
index 905d9e8501b..83ee04b17ad 100644
--- a/extensions/git/src/decorators.ts
+++ b/extensions/git/src/decorators.ts
@@ -31,7 +31,7 @@ function decorate(decorator: (fn: Function, key: string) => Function): Function
function _memoize(fn: Function, key: string): Function {
const memoizeKey = `$memoize$${key}`;
- return function (...args: any[]) {
+ return function (this: any, ...args: any[]) {
if (!this.hasOwnProperty(memoizeKey)) {
Object.defineProperty(this, memoizeKey, {
configurable: false,
@@ -51,7 +51,7 @@ function _throttle(fn: Function, key: string): Function {
const currentKey = `$throttle$current$${key}`;
const nextKey = `$throttle$next$${key}`;
- const trigger = function (...args: any[]) {
+ const trigger = function (this: any, ...args: any[]) {
if (this[nextKey]) {
return this[nextKey];
}
@@ -81,7 +81,7 @@ export const throttle = decorate(_throttle);
function _sequentialize(fn: Function, key: string): Function {
const currentKey = `__$sequence$${key}`;
- return function (...args: any[]) {
+ return function (this: any, ...args: any[]) {
const currentPromise = this[currentKey] as Promise || Promise.resolve(null);
const run = async () => await fn.apply(this, args);
this[currentKey] = currentPromise.then(run, run);
@@ -95,7 +95,7 @@ export function debounce(delay: number): Function {
return decorate((fn, key) => {
const timerKey = `$debounce$${key}`;
- return function (...args: any[]) {
+ return function (this: any, ...args: any[]) {
clearTimeout(this[timerKey]);
this[timerKey] = setTimeout(() => fn.apply(this, args), delay);
};
diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts
index 10de8149121..f758d845d2c 100644
--- a/extensions/git/src/git.ts
+++ b/extensions/git/src/git.ts
@@ -13,7 +13,6 @@ import { EventEmitter } from 'events';
import iconv = require('iconv-lite');
import { assign, uniqBy, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp } from './util';
-const readdir = denodeify(fs.readdir);
const readfile = denodeify(fs.readFile);
export interface IGit {
@@ -66,7 +65,7 @@ function findSpecificGit(path: string): Promise {
const buffers: Buffer[] = [];
const child = cp.spawn(path, ['--version']);
child.stdout.on('data', (b: Buffer) => buffers.push(b));
- child.on('error', e);
+ child.on('error', cpErrorHandler(e));
child.on('exit', code => code ? e(new Error('Not found')) : c({ path, version: parseVersion(Buffer.concat(buffers).toString('utf8').trim()) }));
});
}
@@ -118,48 +117,54 @@ function findSystemGitWin32(base: string): Promise {
return findSpecificGit(path.join(base, 'Git', 'cmd', 'git.exe'));
}
-function findGitHubGitWin32(): Promise {
- const github = path.join(process.env['LOCALAPPDATA'], 'GitHub');
-
- return readdir(github).then(children => {
- const git = children.filter(child => /^PortableGit/.test(child))[0];
-
- if (!git) {
- return Promise.reject('Not found');
- }
-
- return findSpecificGit(path.join(github, git, 'cmd', 'git.exe'));
- });
-}
-
function findGitWin32(): Promise {
- return findSystemGitWin32(process.env['ProgramW6432'])
- .then(void 0, () => findSystemGitWin32(process.env['ProgramFiles(x86)']))
- .then(void 0, () => findSystemGitWin32(process.env['ProgramFiles']))
- .then(void 0, () => findSpecificGit('git'))
- .then(void 0, () => findGitHubGitWin32());
+ return findSystemGitWin32(process.env['ProgramW6432'] as string)
+ .then(void 0, () => findSystemGitWin32(process.env['ProgramFiles(x86)'] as string))
+ .then(void 0, () => findSystemGitWin32(process.env['ProgramFiles'] as string))
+ .then(void 0, () => findSpecificGit('git'));
}
export function findGit(hint: string | undefined): Promise {
var first = hint ? findSpecificGit(hint) : Promise.reject(null);
- return first.then(void 0, () => {
- switch (process.platform) {
- case 'darwin': return findGitDarwin();
- case 'win32': return findGitWin32();
- default: return findSpecificGit('git');
- }
- });
+ return first
+ .then(void 0, () => {
+ switch (process.platform) {
+ case 'darwin': return findGitDarwin();
+ case 'win32': return findGitWin32();
+ default: return findSpecificGit('git');
+ }
+ })
+ .then(null, () => Promise.reject(new Error('Git installation not found.')));
}
-
export interface IExecutionResult {
exitCode: number;
stdout: string;
stderr: string;
}
-async function exec(child: cp.ChildProcess, options: any = {}): Promise {
+function cpErrorHandler(cb: (reason?: any) => void): (reason?: any) => void {
+ return err => {
+ if (/ENOENT/.test(err.message)) {
+ err = new GitError({
+ error: err,
+ message: 'Failed to execute git (ENOENT)',
+ gitErrorCode: GitErrorCodes.NotAGitRepository
+ });
+ }
+
+ cb(err);
+ };
+}
+
+export interface SpawnOptions extends cp.SpawnOptions {
+ input?: string;
+ encoding?: string;
+ log?: boolean;
+}
+
+async function exec(child: cp.ChildProcess, options: SpawnOptions = {}): Promise {
if (!child.stdout || !child.stderr) {
throw new GitError({
message: 'Failed to get stdout or stderr from git process.'
@@ -168,12 +173,12 @@ async function exec(child: cp.ChildProcess, options: any = {}): Promise {
+ const once = (ee: NodeJS.EventEmitter, name: string, fn: (...args: any[]) => void) => {
ee.once(name, fn);
disposables.push(toDisposable(() => ee.removeListener(name, fn)));
};
- const on = (ee: NodeJS.EventEmitter, name: string, fn: Function) => {
+ const on = (ee: NodeJS.EventEmitter, name: string, fn: (...args: any[]) => void) => {
ee.on(name, fn);
disposables.push(toDisposable(() => ee.removeListener(name, fn)));
};
@@ -183,17 +188,17 @@ async function exec(child: cp.ChildProcess, options: any = {}): Promise([
new Promise((c, e) => {
- once(child, 'error', e);
+ once(child, 'error', cpErrorHandler(e));
once(child, 'exit', c);
}),
new Promise(c => {
const buffers: Buffer[] = [];
- on(child.stdout, 'data', b => buffers.push(b));
+ on(child.stdout, 'data', (b: Buffer) => buffers.push(b));
once(child.stdout, 'close', () => c(iconv.decode(Buffer.concat(buffers), encoding)));
}),
new Promise(c => {
const buffers: Buffer[] = [];
- on(child.stderr, 'data', b => buffers.push(b));
+ on(child.stderr, 'data', (b: Buffer) => buffers.push(b));
once(child.stderr, 'close', () => c(Buffer.concat(buffers).toString('utf8')));
})
]);
@@ -246,7 +251,7 @@ export class GitError {
gitCommand: this.gitCommand,
stdout: this.stdout,
stderr: this.stderr
- }, [], 2);
+ }, null, 2);
if (this.error) {
result += (this.error).stack;
@@ -345,22 +350,22 @@ export class Git {
return folderPath;
}
- async getRepositoryRoot(path: string): Promise {
- const result = await this.exec(path, ['rev-parse', '--show-toplevel']);
- return result.stdout.trim();
+ async getRepositoryRoot(repositoryPath: string): Promise {
+ const result = await this.exec(repositoryPath, ['rev-parse', '--show-toplevel']);
+ return path.normalize(result.stdout.trim());
}
- async exec(cwd: string, args: string[], options: any = {}): Promise {
+ async exec(cwd: string, args: string[], options: SpawnOptions = {}): Promise {
options = assign({ cwd }, options || {});
return await this._exec(args, options);
}
- stream(cwd: string, args: string[], options: any = {}): cp.ChildProcess {
+ stream(cwd: string, args: string[], options: SpawnOptions = {}): cp.ChildProcess {
options = assign({ cwd }, options || {});
return this.spawn(args, options);
}
- private async _exec(args: string[], options: any = {}): Promise {
+ private async _exec(args: string[], options: SpawnOptions = {}): Promise {
const child = this.spawn(args, options);
if (options.input) {
@@ -387,7 +392,7 @@ export class Git {
return result;
}
- spawn(args: string[], options: any = {}): cp.ChildProcess {
+ spawn(args: string[], options: SpawnOptions = {}): cp.ChildProcess {
if (!this.gitPath) {
throw new Error('git could not be found in the system.');
}
@@ -505,19 +510,19 @@ export class Repository {
}
// TODO@Joao: rename to exec
- async run(args: string[], options: any = {}): Promise {
+ async run(args: string[], options: SpawnOptions = {}): Promise {
return await this.git.exec(this.repositoryRoot, args, options);
}
- stream(args: string[], options: any = {}): cp.ChildProcess {
+ stream(args: string[], options: SpawnOptions = {}): cp.ChildProcess {
return this.git.stream(this.repositoryRoot, args, options);
}
- spawn(args: string[], options: any = {}): cp.ChildProcess {
+ spawn(args: string[], options: SpawnOptions = {}): cp.ChildProcess {
return this.git.spawn(args, options);
}
- async config(scope: string, key: string, value: any, options: any): Promise {
+ async config(scope: string, key: string, value: any, options: SpawnOptions): Promise {
const args = ['config'];
if (scope) {
@@ -883,9 +888,10 @@ export class Repository {
getStatus(limit = 5000): Promise<{ status: IFileStatus[]; didHitLimit: boolean; }> {
return new Promise<{ status: IFileStatus[]; didHitLimit: boolean; }>((c, e) => {
const parser = new GitStatusParser();
- const child = this.stream(['status', '-z', '-u']);
+ const env = { GIT_OPTIONAL_LOCKS: '0' };
+ const child = this.stream(['status', '-z', '-u'], { env });
- const onExit = exitCode => {
+ const onExit = (exitCode: number) => {
if (exitCode !== 0) {
const stderr = stderrData.join('');
return e(new GitError({
@@ -919,7 +925,7 @@ export class Repository {
child.stderr.setEncoding('utf8');
child.stderr.on('data', raw => stderrData.push(raw as string));
- child.on('error', e);
+ child.on('error', cpErrorHandler(e));
child.on('exit', onExit);
});
}
@@ -947,7 +953,7 @@ export class Repository {
async getRefs(): Promise[ {
const result = await this.run(['for-each-ref', '--format', '%(refname) %(objectname)']);
- const fn = (line): Ref | null => {
+ const fn = (line: string): Ref | null => {
let match: RegExpExecArray | null;
if (match = /^refs\/heads\/([^ ]+) ([0-9a-f]{40})$/.exec(line)) {
@@ -972,7 +978,7 @@ export class Repository {
const regex = /^stash@{(\d+)}:(.+)$/;
const rawStashes = result.stdout.trim().split('\n')
.filter(b => !!b)
- .map(line => regex.exec(line))
+ .map(line => regex.exec(line) as RegExpExecArray)
.filter(g => !!g)
.map(([, index, description]: RegExpExecArray) => ({ index: parseInt(index), description }));
@@ -984,7 +990,7 @@ export class Repository {
const regex = /^([^\s]+)\s+([^\s]+)\s/;
const rawRemotes = result.stdout.trim().split('\n')
.filter(b => !!b)
- .map(line => regex.exec(line))
+ .map(line => regex.exec(line) as RegExpExecArray)
.filter(g => !!g)
.map((groups: RegExpExecArray) => ({ name: groups[1], url: groups[2] }));
diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts
index acc30eeb81d..bd9393ca52a 100644
--- a/extensions/git/src/main.ts
+++ b/extensions/git/src/main.ts
@@ -12,6 +12,7 @@ import { findGit, Git, IGit } from './git';
import { Model } from './model';
import { CommandCenter } from './commands';
import { GitContentProvider } from './contentProvider';
+import { GitDecorations } from './decorationProvider';
import { Askpass } from './askpass';
import { toDisposable } from './util';
import TelemetryReporter from 'vscode-extension-telemetry';
@@ -47,13 +48,14 @@ async function init(context: ExtensionContext, disposables: Disposable[]): Promi
outputChannel.appendLine(localize('using git', "Using git {0} from {1}", info.version, info.path));
- const onOutput = str => outputChannel.append(str);
+ const onOutput = (str: string) => outputChannel.append(str);
git.onOutput.addListener('log', onOutput);
disposables.push(toDisposable(() => git.onOutput.removeListener('log', onOutput)));
disposables.push(
new CommandCenter(git, model, outputChannel, telemetryReporter),
new GitContentProvider(model),
+ new GitDecorations(model)
);
await checkGitVersion(info);
@@ -93,4 +95,4 @@ async function checkGitVersion(info: IGit): Promise {
} else if (choice === neverShowAgain) {
await config.update('ignoreLegacyWarning', true, true);
}
-}
\ No newline at end of file
+}
diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts
index bfd746a427d..be87561ae9a 100644
--- a/extensions/git/src/model.ts
+++ b/extensions/git/src/model.ts
@@ -17,8 +17,16 @@ import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
class RepositoryPick implements QuickPickItem {
- @memoize get label(): string { return path.basename(this.repository.root); }
- @memoize get description(): string { return path.dirname(this.repository.root); }
+ @memoize get label(): string {
+ return path.basename(this.repository.root);
+ }
+
+ @memoize get description(): string {
+ return [this.repository.headLabel, this.repository.syncLabel]
+ .filter(l => !!l)
+ .join(' ');
+ }
+
constructor(public readonly repository: Repository) { }
}
@@ -27,10 +35,19 @@ export interface ModelChangeEvent {
uri: Uri;
}
+export interface OriginalResourceChangeEvent {
+ repository: Repository;
+ uri: Uri;
+}
+
interface OpenRepository extends Disposable {
repository: Repository;
}
+function isParent(parent: string, child: string): boolean {
+ return child.startsWith(parent);
+}
+
export class Model {
private _onDidOpenRepository = new EventEmitter();
@@ -42,6 +59,9 @@ export class Model {
private _onDidChangeRepository = new EventEmitter();
readonly onDidChangeRepository: Event = this._onDidChangeRepository.event;
+ private _onDidChangeOriginalResource = new EventEmitter();
+ readonly onDidChangeOriginalResource: Event = this._onDidChangeOriginalResource.event;
+
private openRepositories: OpenRepository[] = [];
get repositories(): Repository[] { return this.openRepositories.map(r => r.repository); }
@@ -147,7 +167,9 @@ export class Model {
const activeRepositories = new Set(activeRepositoriesList);
const openRepositoriesToDispose = removed
.map(folder => this.getOpenRepository(folder.uri))
- .filter(r => !!r && !activeRepositories.has(r.repository)) as OpenRepository[];
+ .filter(r => !!r)
+ .filter(r => !activeRepositories.has(r!.repository))
+ .filter(r => !(workspace.workspaceFolders || []).some(f => isParent(f.uri.fsPath, r!.repository.root))) as OpenRepository[];
possibleRepositoryFolders.forEach(p => this.tryOpenRepository(p.uri.fsPath));
openRepositoriesToDispose.forEach(r => r.dispose());
@@ -203,10 +225,14 @@ export class Model {
const onDidDisappearRepository = filterEvent(repository.onDidChangeState, state => state === RepositoryState.Disposed);
const disappearListener = onDidDisappearRepository(() => dispose());
const changeListener = repository.onDidChangeRepository(uri => this._onDidChangeRepository.fire({ repository, uri }));
+ const originalResourceChangeListener = repository.onDidChangeOriginalResource(uri => this._onDidChangeOriginalResource.fire({ repository, uri }));
+
const dispose = () => {
disappearListener.dispose();
changeListener.dispose();
+ originalResourceChangeListener.dispose();
repository.dispose();
+
this.openRepositories = this.openRepositories.filter(e => e !== openRepository);
this._onDidCloseRepository.fire(repository);
};
@@ -216,6 +242,16 @@ export class Model {
this._onDidOpenRepository.fire(repository);
}
+ close(repository: Repository): void {
+ const openRepository = this.getOpenRepository(repository);
+
+ if (!openRepository) {
+ return;
+ }
+
+ openRepository.dispose();
+ }
+
async pickRepository(): Promise {
if (this.openRepositories.length === 0) {
throw new Error(localize('no repositories', "There are no available repositories"));
diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts
index af4361dfa7d..58fd4a540fb 100644
--- a/extensions/git/src/repository.ts
+++ b/extensions/git/src/repository.ts
@@ -5,8 +5,8 @@
'use strict';
-import { Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, Disposable, ProgressLocation, window, workspace, WorkspaceEdit } from 'vscode';
-import { Repository as BaseRepository, Ref, Branch, Remote, Commit, GitErrorCodes, Stash } from './git';
+import { Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, DecorationData } from 'vscode';
+import { Repository as BaseRepository, Ref, Branch, Remote, Commit, GitErrorCodes, Stash, RefType, GitError } from './git';
import { anyEvent, filterEvent, eventToPromise, dispose, find } from './util';
import { memoize, throttle, debounce } from './decorators';
import { toGitUri } from './uri';
@@ -82,7 +82,7 @@ export class Resource implements SourceControlResourceState {
get original(): Uri { return this._resourceUri; }
get renameResourceUri(): Uri | undefined { return this._renameResourceUri; }
- private static Icons = {
+ private static Icons: any = {
light: {
Modified: getIconUri('status-modified', 'light'),
Added: getIconUri('status-added', 'light'),
@@ -171,13 +171,104 @@ export class Resource implements SourceControlResourceState {
}
get decorations(): SourceControlResourceDecorations {
- const light = { iconPath: this.getIconPath('light') };
- const dark = { iconPath: this.getIconPath('dark') };
+ // TODO@joh, still requires restart/redraw in the SCM viewlet
+ const decorations = workspace.getConfiguration().get('git.decorations.enabled');
+ const light = !decorations ? { iconPath: this.getIconPath('light') } : undefined;
+ const dark = !decorations ? { iconPath: this.getIconPath('dark') } : undefined;
const tooltip = this.tooltip;
const strikeThrough = this.strikeThrough;
const faded = this.faded;
+ const letter = this.letter;
+ const color = this.color;
- return { strikeThrough, faded, tooltip, light, dark };
+ return { strikeThrough, faded, tooltip, light, dark, letter, color, source: 'git.resource' /*todo@joh*/ };
+ }
+
+ get letter(): string | undefined {
+ switch (this.type) {
+ case Status.INDEX_MODIFIED:
+ case Status.MODIFIED:
+ return 'M';
+ case Status.INDEX_ADDED:
+ return 'A';
+ case Status.INDEX_DELETED:
+ case Status.DELETED:
+ return 'D';
+ case Status.INDEX_RENAMED:
+ return 'R';
+ case Status.UNTRACKED:
+ return 'U';
+ case Status.IGNORED:
+ return 'I';
+ case Status.INDEX_COPIED:
+ case Status.BOTH_DELETED:
+ case Status.ADDED_BY_US:
+ case Status.DELETED_BY_THEM:
+ case Status.ADDED_BY_THEM:
+ case Status.DELETED_BY_US:
+ case Status.BOTH_ADDED:
+ case Status.BOTH_MODIFIED:
+ return 'C';
+ default:
+ return undefined;
+ }
+ }
+
+ get color(): ThemeColor | undefined {
+ switch (this.type) {
+ case Status.INDEX_MODIFIED:
+ case Status.MODIFIED:
+ return new ThemeColor('gitDecoration.modifiedResourceForeground');
+ case Status.INDEX_DELETED:
+ case Status.DELETED:
+ return new ThemeColor('gitDecoration.deletedResourceForeground');
+ case Status.INDEX_ADDED: // todo@joh - special color?
+ case Status.INDEX_RENAMED: // todo@joh - special color?
+ case Status.UNTRACKED:
+ return new ThemeColor('gitDecoration.untrackedResourceForeground');
+ case Status.IGNORED:
+ return new ThemeColor('gitDecoration.ignoredResourceForeground');
+ case Status.INDEX_COPIED:
+ case Status.BOTH_DELETED:
+ case Status.ADDED_BY_US:
+ case Status.DELETED_BY_THEM:
+ case Status.ADDED_BY_THEM:
+ case Status.DELETED_BY_US:
+ case Status.BOTH_ADDED:
+ case Status.BOTH_MODIFIED:
+ return new ThemeColor('gitDecoration.conflictingResourceForeground');
+ default:
+ return undefined;
+ }
+ }
+
+ get priority(): number {
+ switch (this.type) {
+ case Status.INDEX_MODIFIED:
+ case Status.MODIFIED:
+ return 2;
+ case Status.IGNORED:
+ return 3;
+ case Status.INDEX_COPIED:
+ case Status.BOTH_DELETED:
+ case Status.ADDED_BY_US:
+ case Status.DELETED_BY_THEM:
+ case Status.ADDED_BY_THEM:
+ case Status.DELETED_BY_US:
+ case Status.BOTH_ADDED:
+ case Status.BOTH_MODIFIED:
+ return 4;
+ default:
+ return 1;
+ }
+ }
+
+ get resourceDecoration(): DecorationData | undefined {
+ const title = this.tooltip;
+ const abbreviation = this.letter;
+ const color = this.color;
+ const priority = this.priority;
+ return { bubble: true, source: 'git.resource', title, abbreviation, color, priority };
}
constructor(
@@ -189,54 +280,34 @@ export class Resource implements SourceControlResourceState {
}
export enum Operation {
- Status = 1 << 0,
- Add = 1 << 1,
- RevertFiles = 1 << 2,
- Commit = 1 << 3,
- Clean = 1 << 4,
- Branch = 1 << 5,
- Checkout = 1 << 6,
- Reset = 1 << 7,
- Fetch = 1 << 8,
- Pull = 1 << 9,
- Push = 1 << 10,
- Sync = 1 << 11,
- Show = 1 << 12,
- Stage = 1 << 13,
- GetCommitTemplate = 1 << 14,
- DeleteBranch = 1 << 15,
- Merge = 1 << 16,
- Ignore = 1 << 17,
- Tag = 1 << 18,
- Stash = 1 << 19
+ Status = 'Status',
+ Add = 'Add',
+ RevertFiles = 'RevertFiles',
+ Commit = 'Commit',
+ Clean = 'Clean',
+ Branch = 'Branch',
+ Checkout = 'Checkout',
+ Reset = 'Reset',
+ Fetch = 'Fetch',
+ Pull = 'Pull',
+ Push = 'Push',
+ Sync = 'Sync',
+ Show = 'Show',
+ Stage = 'Stage',
+ GetCommitTemplate = 'GetCommitTemplate',
+ DeleteBranch = 'DeleteBranch',
+ Merge = 'Merge',
+ Ignore = 'Ignore',
+ Tag = 'Tag',
+ Stash = 'Stash',
+ CheckIgnore = 'CheckIgnore'
}
-// function getOperationName(operation: Operation): string {
-// switch (operation) {
-// case Operation.Status: return 'Status';
-// case Operation.Add: return 'Add';
-// case Operation.RevertFiles: return 'RevertFiles';
-// case Operation.Commit: return 'Commit';
-// case Operation.Clean: return 'Clean';
-// case Operation.Branch: return 'Branch';
-// case Operation.Checkout: return 'Checkout';
-// case Operation.Reset: return 'Reset';
-// case Operation.Fetch: return 'Fetch';
-// case Operation.Pull: return 'Pull';
-// case Operation.Push: return 'Push';
-// case Operation.Sync: return 'Sync';
-// case Operation.Init: return 'Init';
-// case Operation.Show: return 'Show';
-// case Operation.Stage: return 'Stage';
-// case Operation.GetCommitTemplate: return 'GetCommitTemplate';
-// default: return 'unknown';
-// }
-// }
-
function isReadOnly(operation: Operation): boolean {
switch (operation) {
case Operation.Show:
case Operation.GetCommitTemplate:
+ case Operation.CheckIgnore:
return true;
default:
return false;
@@ -246,6 +317,7 @@ function isReadOnly(operation: Operation): boolean {
function shouldShowProgress(operation: Operation): boolean {
switch (operation) {
case Operation.Fetch:
+ case Operation.CheckIgnore:
return false;
default:
return true;
@@ -259,24 +331,36 @@ export interface Operations {
class OperationsImpl implements Operations {
- constructor(private readonly operations: number = 0) {
- // noop
+ private operations = new Map();
+
+ start(operation: Operation): void {
+ this.operations.set(operation, (this.operations.get(operation) || 0) + 1);
}
- start(operation: Operation): OperationsImpl {
- return new OperationsImpl(this.operations | operation);
- }
+ end(operation: Operation): void {
+ const count = (this.operations.get(operation) || 0) - 1;
- end(operation: Operation): OperationsImpl {
- return new OperationsImpl(this.operations & ~operation);
+ if (count <= 0) {
+ this.operations.delete(operation);
+ } else {
+ this.operations.set(operation, count);
+ }
}
isRunning(operation: Operation): boolean {
- return (this.operations & operation) !== 0;
+ return this.operations.has(operation);
}
isIdle(): boolean {
- return this.operations === 0;
+ const operations = this.operations.keys();
+
+ for (const operation of operations) {
+ if (!isReadOnly(operation)) {
+ return false;
+ }
+ }
+
+ return true;
}
}
@@ -302,6 +386,9 @@ export class Repository implements Disposable {
private _onDidChangeStatus = new EventEmitter();
readonly onDidChangeStatus: Event = this._onDidChangeStatus.event;
+ private _onDidChangeOriginalResource = new EventEmitter();
+ readonly onDidChangeOriginalResource: Event = this._onDidChangeOriginalResource.event;
+
private _onRunOperation = new EventEmitter();
readonly onRunOperation: Event = this._onRunOperation.event;
@@ -382,9 +469,8 @@ export class Repository implements Disposable {
const onRelevantGitChange = filterEvent(onRelevantRepositoryChange, uri => /\/\.git\//.test(uri.path));
onRelevantGitChange(this._onDidChangeRepository.fire, this._onDidChangeRepository, this.disposables);
- const label = `${path.basename(repository.root)} (Git)`;
-
- this._sourceControl = scm.createSourceControl('git', label);
+ this._sourceControl = scm.createSourceControl('git', 'Git', Uri.file(repository.root));
+ this._sourceControl.inputBox.placeholder = localize('commitMessage', "Message (press {0} to commit)");
this._sourceControl.acceptInputCommand = { command: 'git.commitWithInput', title: localize('commit', "Commit"), arguments: [this._sourceControl] };
this._sourceControl.quickDiffProvider = this;
this.disposables.push(this._sourceControl);
@@ -449,6 +535,7 @@ export class Repository implements Disposable {
async stage(resource: Uri, contents: string): Promise {
const relativePath = path.relative(this.repository.root, resource.fsPath).replace(/\\/g, '/');
await this.run(Operation.Stage, () => this.repository.stage(relativePath, contents));
+ this._onDidChangeOriginalResource.fire(resource);
}
async revert(resources: Uri[]): Promise {
@@ -534,11 +621,7 @@ export class Repository implements Disposable {
@throttle
async fetch(): Promise {
- try {
- await this.run(Operation.Fetch, () => this.repository.fetch());
- } catch (err) {
- // noop
- }
+ await this.run(Operation.Fetch, () => this.repository.fetch());
}
@throttle
@@ -568,10 +651,9 @@ export class Repository implements Disposable {
await this.run(Operation.Push, () => this.repository.push(remote, undefined, false, true));
}
- @throttle
- async sync(): Promise {
+ private async _sync(rebase: boolean): Promise {
await this.run(Operation.Sync, async () => {
- await this.repository.pull();
+ await this.repository.pull(rebase);
const shouldPush = this.HEAD && typeof this.HEAD.ahead === 'number' ? this.HEAD.ahead > 0 : true;
@@ -581,10 +663,20 @@ export class Repository implements Disposable {
});
}
+ @throttle
+ sync(): Promise {
+ return this._sync(false);
+ }
+
+ @throttle
+ async syncRebase(): Promise {
+ return this._sync(true);
+ }
+
async show(ref: string, filePath: string): Promise {
return await this.run(Operation.Show, async () => {
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
- const configFiles = workspace.getConfiguration('files');
+ const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
const encoding = configFiles.get('encoding');
return await this.repository.buffer(`${ref}:${relativePath}`, encoding);
@@ -629,13 +721,56 @@ export class Repository implements Disposable {
});
}
+ checkIgnore(filePaths: string[]): Promise> {
+ return this.run(Operation.CheckIgnore, () => {
+ return new Promise>((resolve, reject) => {
+
+ filePaths = filePaths.filter(filePath => !path.relative(this.root, filePath).startsWith('..'));
+
+ if (filePaths.length === 0) {
+ // nothing left
+ return Promise.resolve(new Set());
+ }
+
+ const child = this.repository.stream(['check-ignore', ...filePaths]);
+
+ const onExit = (exitCode: number) => {
+ if (exitCode === 1) {
+ // nothing ignored
+ resolve(new Set());
+ } else if (exitCode === 0) {
+ // each line is something ignored
+ resolve(new Set(data.split('\n')));
+ } else {
+ reject(new GitError({ stdout: data, stderr, exitCode }));
+ }
+ };
+
+ let data = '';
+ const onStdoutData = (raw: string) => {
+ data += raw;
+ };
+
+ child.stdout.setEncoding('utf8');
+ child.stdout.on('data', onStdoutData);
+
+ let stderr: string = '';
+ child.stderr.setEncoding('utf8');
+ child.stderr.on('data', raw => stderr += raw);
+
+ child.on('error', reject);
+ child.on('exit', onExit);
+ });
+ });
+ }
+
private async run(operation: Operation, runOperation: () => Promise = () => Promise.resolve(null)): Promise {
if (this.state !== RepositoryState.Idle) {
throw new Error('Repository not initialized');
}
const run = async () => {
- this._operations = this._operations.start(operation);
+ this._operations.start(operation);
this._onRunOperation.fire(operation);
try {
@@ -653,7 +788,7 @@ export class Repository implements Disposable {
throw err;
} finally {
- this._operations = this._operations.end(operation);
+ this._operations.end(operation);
this._onDidRunOperation.fire(operation);
}
};
@@ -818,7 +953,7 @@ export class Repository implements Disposable {
await timeout(5000);
}
- private async whenIdleAndFocused(): Promise {
+ async whenIdleAndFocused(): Promise {
while (true) {
if (!this.operations.isIdle()) {
await eventToPromise(this.onDidRunOperation);
@@ -835,6 +970,36 @@ export class Repository implements Disposable {
}
}
+ get headLabel(): string {
+ const HEAD = this.HEAD;
+
+ if (!HEAD) {
+ return '';
+ }
+
+ const tag = this.refs.filter(iref => iref.type === RefType.Tag && iref.commit === HEAD.commit)[0];
+ const tagName = tag && tag.name;
+ const head = HEAD.name || tagName || (HEAD.commit || '').substr(0, 8);
+
+ return head
+ + (this.workingTreeGroup.resourceStates.length > 0 ? '*' : '')
+ + (this.indexGroup.resourceStates.length > 0 ? '+' : '')
+ + (this.mergeGroup.resourceStates.length > 0 ? '!' : '');
+ }
+
+ get syncLabel(): string {
+ if (!this.HEAD
+ || !this.HEAD.name
+ || !this.HEAD.commit
+ || !this.HEAD.upstream
+ || !(this.HEAD.ahead || this.HEAD.behind)
+ ) {
+ return '';
+ }
+
+ return `${this.HEAD.behind}ā ${this.HEAD.ahead}ā`;
+ }
+
dispose(): void {
this.disposables = dispose(this.disposables);
}
diff --git a/extensions/git/src/statusbar.ts b/extensions/git/src/statusbar.ts
index f82fda91881..4233abec580 100644
--- a/extensions/git/src/statusbar.ts
+++ b/extensions/git/src/statusbar.ts
@@ -6,7 +6,7 @@
'use strict';
import { Disposable, Command, EventEmitter, Event } from 'vscode';
-import { RefType, Branch } from './git';
+import { Branch } from './git';
import { Repository, Operation } from './repository';
import { anyEvent, dispose } from './util';
import * as nls from 'vscode-nls';
@@ -24,20 +24,7 @@ class CheckoutStatusBar {
}
get command(): Command | undefined {
- const HEAD = this.repository.HEAD;
-
- if (!HEAD) {
- return undefined;
- }
-
- const tag = this.repository.refs.filter(iref => iref.type === RefType.Tag && iref.commit === HEAD.commit)[0];
- const tagName = tag && tag.name;
- const head = HEAD.name || tagName || (HEAD.commit || '').substr(0, 8);
- const title = '$(git-branch) '
- + head
- + (this.repository.workingTreeGroup.resourceStates.length > 0 ? '*' : '')
- + (this.repository.indexGroup.resourceStates.length > 0 ? '+' : '')
- + (this.repository.mergeGroup.resourceStates.length > 0 ? '!' : '');
+ const title = `$(git-branch) ${this.repository.headLabel}`;
return {
command: 'git.checkout',
@@ -112,7 +99,7 @@ class SyncStatusBar {
if (HEAD && HEAD.name && HEAD.commit) {
if (HEAD.upstream) {
if (HEAD.ahead || HEAD.behind) {
- text += `${HEAD.behind}ā ${HEAD.ahead}ā`;
+ text += this.repository.syncLabel;
}
command = 'git.sync';
tooltip = localize('sync changes', "Synchronize Changes");
diff --git a/extensions/git/src/test/git.test.ts b/extensions/git/src/test/git.test.ts
index b42041ce80d..d8c1eb405ad 100644
--- a/extensions/git/src/test/git.test.ts
+++ b/extensions/git/src/test/git.test.ts
@@ -5,6 +5,7 @@
'use strict';
+import 'mocha';
import { GitStatusParser } from '../git';
import * as assert from 'assert';
diff --git a/extensions/git/src/typings/refs.d.ts b/extensions/git/src/typings/refs.d.ts
index eebe504c7ee..12e1d618942 100644
--- a/extensions/git/src/typings/refs.d.ts
+++ b/extensions/git/src/typings/refs.d.ts
@@ -4,6 +4,4 @@
*--------------------------------------------------------------------------------------------*/
///
-///
-///
-///
+///
\ No newline at end of file
diff --git a/extensions/git/src/util.ts b/extensions/git/src/util.ts
index 632fd5a0a86..7004ccc18e0 100644
--- a/extensions/git/src/util.ts
+++ b/extensions/git/src/util.ts
@@ -8,6 +8,7 @@
import { Event } from 'vscode';
import { dirname } from 'path';
import * as fs from 'fs';
+import * as byline from 'byline';
export function log(...args: any[]): void {
console.log.apply(console, ['git:', ...args]);
@@ -85,7 +86,7 @@ export function once(fn: (...args: any[]) => any): (...args: any[]) => any {
export function assign(destination: T, ...sources: any[]): T {
for (const source of sources) {
- Object.keys(source).forEach(key => destination[key] = source[key]);
+ Object.keys(source).forEach(key => (destination as any)[key] = source[key]);
}
return destination;
@@ -114,12 +115,12 @@ export function groupBy(arr: T[], fn: (el: T) => string): { [key: string]: T[
}, Object.create(null));
}
-export function denodeify(fn: Function): (...args) => Promise {
- return (...args) => new Promise((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
+export function denodeify(fn: Function): (...args: any[]) => Promise {
+ return (...args) => new Promise((c, e) => fn(...args, (err: any, r: any) => err ? e(err) : c(r)));
}
-export function nfcall(fn: Function, ...args): Promise {
- return new Promise((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
+export function nfcall(fn: Function, ...args: any[]): Promise {
+ return new Promise((c, e) => fn(...args, (err: any, r: any) => err ? e(err) : c(r)));
}
export async function mkdirp(path: string, mode?: number): Promise {
@@ -188,4 +189,20 @@ export function find(array: T[], fn: (t: T) => boolean): T | undefined {
});
return result;
+}
+
+export async function grep(filename: string, pattern: RegExp): Promise {
+ return new Promise((c, e) => {
+ const fileStream = fs.createReadStream(filename, { encoding: 'utf8' });
+ const stream = byline(fileStream);
+ stream.on('data', (line: string) => {
+ if (pattern.test(line)) {
+ fileStream.close();
+ c(true);
+ }
+ });
+
+ stream.on('error', e);
+ stream.on('end', () => c(false));
+ });
}
\ No newline at end of file
diff --git a/extensions/git/tsconfig.json b/extensions/git/tsconfig.json
index 254c9e67459..ea7679c9ac0 100644
--- a/extensions/git/tsconfig.json
+++ b/extensions/git/tsconfig.json
@@ -6,7 +6,10 @@
],
"module": "commonjs",
"outDir": "./out",
- "strictNullChecks": true,
+ "typeRoots": [
+ "./node_modules/@types"
+ ],
+ "strict": true,
"experimentalDecorators": true
},
"include": [
diff --git a/extensions/gitsyntax/package.json b/extensions/gitsyntax/package.json
index bc1a1810f91..0040fe55473 100644
--- a/extensions/gitsyntax/package.json
+++ b/extensions/gitsyntax/package.json
@@ -50,6 +50,11 @@
"scopeName": "text.git-rebase",
"path": "./syntaxes/git-rebase.tmLanguage.json"
}
- ]
+ ],
+ "configurationDefaults": {
+ "[git-commit]": {
+ "editor.rulers": [72]
+ }
+ }
}
}
\ No newline at end of file
diff --git a/extensions/go/syntaxes/go.json b/extensions/go/syntaxes/go.json
index 5adc522e0a4..4a62b05ef8c 100644
--- a/extensions/go/syntaxes/go.json
+++ b/extensions/go/syntaxes/go.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/atom/language-go/commit/c413bc93966c03031cd114c53c54bc7927eea25b",
+ "version": "https://github.com/atom/language-go/commit/f7c6ca60bfd9d11252560b21e9378e5f82438ce3",
"scopeName": "source.go",
"name": "Go",
"comment": "Go language",
@@ -233,7 +233,7 @@
]
},
{
- "match": "(?,\\s*\\w+(?:\\.\\w+)*)*)(?=\\s*=(?!=))",
"captures": {
"1": {
"patterns": [
@@ -242,7 +242,7 @@
"name": "invalid.illegal.identifier.go"
},
{
- "match": "\\w+(?:\\.\\w+)?",
+ "match": "\\w+(?:\\.\\w+)*",
"name": "variable.other.assignment.go",
"captures": {
"0": {
@@ -627,7 +627,7 @@
}
},
{
- "match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[(\\d*|\\.\\.\\.)\\])*\\*?\\w+(?:\\.\\w+)?\\s*[^=].*)",
+ "match": "(\\w+(?:,\\s*\\w+)*)(\\s+(\\[(\\d*|\\.\\.\\.)\\])*\\*?(<-)?\\w+(?:\\.\\w+)?\\s*[^=].*)",
"captures": {
"1": {
"patterns": [
diff --git a/extensions/groovy/test/colorize-results/test_groovy.json b/extensions/groovy/test/colorize-results/test_groovy.json
index ee78a65becc..8d1191aa367 100644
--- a/extensions/groovy/test/colorize-results/test_groovy.json
+++ b/extensions/groovy/test/colorize-results/test_groovy.json
@@ -9232,33 +9232,33 @@
"c": "${",
"t": "source.groovy meta.definition.method.groovy meta.method.body.java string.quoted.double.groovy source.groovy.embedded.source punctuation.section.embedded.groovy",
"r": {
- "dark_plus": "string: #CE9178",
- "light_plus": "string: #A31515",
- "dark_vs": "string: #CE9178",
- "light_vs": "string: #A31515",
- "hc_black": "string: #CE9178"
+ "dark_plus": "punctuation.section.embedded: #569CD6",
+ "light_plus": "punctuation.section.embedded: #0000FF",
+ "dark_vs": "punctuation.section.embedded: #569CD6",
+ "light_vs": "punctuation.section.embedded: #0000FF",
+ "hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "System.currentTimeMillis() - start",
"t": "source.groovy meta.definition.method.groovy meta.method.body.java string.quoted.double.groovy source.groovy.embedded.source",
"r": {
- "dark_plus": "string: #CE9178",
- "light_plus": "string: #A31515",
- "dark_vs": "string: #CE9178",
- "light_vs": "string: #A31515",
- "hc_black": "string: #CE9178"
+ "dark_plus": "source.groovy.embedded: #D4D4D4",
+ "light_plus": "source.groovy.embedded: #000000",
+ "dark_vs": "source.groovy.embedded: #D4D4D4",
+ "light_vs": "source.groovy.embedded: #000000",
+ "hc_black": "source.groovy.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "source.groovy meta.definition.method.groovy meta.method.body.java string.quoted.double.groovy source.groovy.embedded.source punctuation.section.embedded.groovy",
"r": {
- "dark_plus": "string: #CE9178",
- "light_plus": "string: #A31515",
- "dark_vs": "string: #CE9178",
- "light_vs": "string: #A31515",
- "hc_black": "string: #CE9178"
+ "dark_plus": "punctuation.section.embedded: #569CD6",
+ "light_plus": "punctuation.section.embedded: #0000FF",
+ "dark_vs": "punctuation.section.embedded: #569CD6",
+ "light_vs": "punctuation.section.embedded: #0000FF",
+ "hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
diff --git a/extensions/grunt/package.json b/extensions/grunt/package.json
index 0758d440b08..b330d18326c 100644
--- a/extensions/grunt/package.json
+++ b/extensions/grunt/package.json
@@ -18,7 +18,7 @@
"vscode-nls": "^2.0.2"
},
"devDependencies": {
- "@types/node": "^7.0.12"
+ "@types/node": "7.0.43"
},
"main": "./out/main",
"activationEvents": [
@@ -31,6 +31,7 @@
"title": "Grunt",
"properties": {
"grunt.autoDetect": {
+ "scope": "resource",
"type": "string",
"enum": [
"off",
diff --git a/extensions/grunt/src/main.ts b/extensions/grunt/src/main.ts
index 554bb4963e6..d08e845c1ba 100644
--- a/extensions/grunt/src/main.ts
+++ b/extensions/grunt/src/main.ts
@@ -13,49 +13,6 @@ import * as nls from 'vscode-nls';
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();
type AutoDetect = 'on' | 'off';
-let taskProvider: vscode.Disposable | undefined;
-
-export function activate(_context: vscode.ExtensionContext): void {
- let workspaceRoot = vscode.workspace.rootPath;
- if (!workspaceRoot) {
- return;
- }
- let pattern = path.join(workspaceRoot, '[Gg]runtfile.js');
- let detectorPromise: Thenable | undefined = undefined;
- let fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
- fileWatcher.onDidChange(() => detectorPromise = undefined);
- fileWatcher.onDidCreate(() => detectorPromise = undefined);
- fileWatcher.onDidDelete(() => detectorPromise = undefined);
-
- function onConfigurationChanged() {
- let autoDetect = vscode.workspace.getConfiguration('grunt').get('autoDetect');
- if (taskProvider && autoDetect === 'off') {
- detectorPromise = undefined;
- taskProvider.dispose();
- taskProvider = undefined;
- } else if (!taskProvider && autoDetect === 'on') {
- taskProvider = vscode.workspace.registerTaskProvider('grunt', {
- provideTasks: () => {
- if (!detectorPromise) {
- detectorPromise = getGruntTasks();
- }
- return detectorPromise;
- },
- resolveTask(_task: vscode.Task): vscode.Task | undefined {
- return undefined;
- }
- });
- }
- }
- vscode.workspace.onDidChangeConfiguration(onConfigurationChanged);
- onConfigurationChanged();
-}
-
-export function deactivate(): void {
- if (taskProvider) {
- taskProvider.dispose();
- }
-}
function exists(file: string): Promise {
return new Promise((resolve, _reject) => {
@@ -76,19 +33,6 @@ 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 GruntTaskDefinition extends vscode.TaskDefinition {
- task: string;
- file?: string;
-}
-
const buildNames: string[] = ['build', 'compile', 'watch'];
function isBuildTask(name: string): boolean {
for (let buildName of buildNames) {
@@ -109,97 +53,269 @@ function isTestTask(name: string): boolean {
return false;
}
-async function getGruntTasks(): Promise {
- let workspaceRoot = vscode.workspace.rootPath;
- let emptyTasks: vscode.Task[] = [];
- if (!workspaceRoot) {
- return emptyTasks;
+let _channel: vscode.OutputChannel;
+function getOutputChannel(): vscode.OutputChannel {
+ if (!_channel) {
+ _channel = vscode.window.createOutputChannel('Gulp Auto Detection');
}
- if (!await exists(path.join(workspaceRoot, 'gruntfile.js')) && !await exists(path.join(workspaceRoot, 'Gruntfile.js'))) {
- return emptyTasks;
+ return _channel;
+}
+
+interface GruntTaskDefinition extends vscode.TaskDefinition {
+ task: string;
+ file?: string;
+}
+
+class FolderDetector {
+
+ private fileWatcher: vscode.FileSystemWatcher;
+ private promise: Thenable | undefined;
+
+ constructor(private _workspaceFolder: vscode.WorkspaceFolder) {
}
- let command: string;
- let platform = process.platform;
- if (platform === 'win32' && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'grunt.cmd'))) {
- command = path.join('.', 'node_modules', '.bin', 'grunt.cmd');
- } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'grunt'))) {
- command = path.join('.', 'node_modules', '.bin', 'grunt');
- } else {
- command = 'grunt';
+ public get workspaceFolder(): vscode.WorkspaceFolder {
+ return this._workspaceFolder;
}
- let commandLine = `${command} --help --no-color`;
- try {
- let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot });
- if (stderr) {
- getOutputChannel().appendLine(stderr);
- getOutputChannel().show(true);
+ public isEnabled(): boolean {
+ return vscode.workspace.getConfiguration('grunt', this._workspaceFolder.uri).get('autoDetect') === 'on';
+ }
+
+ public start(): void {
+ let pattern = path.join(this._workspaceFolder.uri.fsPath, '[Gg]runtfile.js');
+ this.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
+ this.fileWatcher.onDidChange(() => this.promise = undefined);
+ this.fileWatcher.onDidCreate(() => this.promise = undefined);
+ this.fileWatcher.onDidDelete(() => this.promise = undefined);
+ }
+
+ public async getTasks(): Promise {
+ if (!this.promise) {
+ this.promise = this.computeTasks();
}
- let result: vscode.Task[] = [];
- if (stdout) {
- // grunt lists tasks as follows (description is wrapped into a new line if too long):
- // ...
- // Available tasks
- // uglify Minify files with UglifyJS. *
- // jshint Validate files with JSHint. *
- // test Alias for "jshint", "qunit" tasks.
- // default Alias for "jshint", "qunit", "concat", "uglify" tasks.
- // long Alias for "eslint", "qunit", "browserify", "sass",
- // "autoprefixer", "uglify", tasks.
- //
- // Tasks run in the order specified
+ return this.promise;
+ }
- let lines = stdout.split(/\r{0,1}\n/);
- let tasksStart = false;
- let tasksEnd = false;
- for (let line of lines) {
- if (line.length === 0) {
- continue;
- }
- if (!tasksStart && !tasksEnd) {
- if (line.indexOf('Available tasks') === 0) {
- tasksStart = true;
+ private async computeTasks(): Promise {
+ let rootPath = this._workspaceFolder.uri.scheme === 'file' ? this._workspaceFolder.uri.fsPath : undefined;
+ let emptyTasks: vscode.Task[] = [];
+ if (!rootPath) {
+ return emptyTasks;
+ }
+ if (!await exists(path.join(rootPath, 'gruntfile.js')) && !await exists(path.join(rootPath, 'Gruntfile.js'))) {
+ return emptyTasks;
+ }
+
+ let command: string;
+ let platform = process.platform;
+ if (platform === 'win32' && await exists(path.join(rootPath!, 'node_modules', '.bin', 'grunt.cmd'))) {
+ command = path.join('.', 'node_modules', '.bin', 'grunt.cmd');
+ } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(rootPath!, 'node_modules', '.bin', 'grunt'))) {
+ command = path.join('.', 'node_modules', '.bin', 'grunt');
+ } else {
+ command = 'grunt';
+ }
+
+ let commandLine = `${command} --help --no-color`;
+ try {
+ let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
+ if (stderr) {
+ getOutputChannel().appendLine(stderr);
+ getOutputChannel().show(true);
+ }
+ let result: vscode.Task[] = [];
+ if (stdout) {
+ // grunt lists tasks as follows (description is wrapped into a new line if too long):
+ // ...
+ // Available tasks
+ // uglify Minify files with UglifyJS. *
+ // jshint Validate files with JSHint. *
+ // test Alias for "jshint", "qunit" tasks.
+ // default Alias for "jshint", "qunit", "concat", "uglify" tasks.
+ // long Alias for "eslint", "qunit", "browserify", "sass",
+ // "autoprefixer", "uglify", tasks.
+ //
+ // Tasks run in the order specified
+
+ let lines = stdout.split(/\r{0,1}\n/);
+ let tasksStart = false;
+ let tasksEnd = false;
+ for (let line of lines) {
+ if (line.length === 0) {
+ continue;
}
- } else if (tasksStart && !tasksEnd) {
- if (line.indexOf('Tasks run in the order specified') === 0) {
- tasksEnd = true;
- } else {
- let regExp = /^\s*(\S.*\S) \S/g;
- let matches = regExp.exec(line);
- if (matches && matches.length === 2) {
- let name = matches[1];
- let kind: GruntTaskDefinition = {
- type: 'grunt',
- task: name
- };
- let source = 'grunt';
- let task = name.indexOf(' ') === -1
- ? new vscode.Task(kind, name, source, new vscode.ShellExecution(`${command} ${name}`))
- : new vscode.Task(kind, name, source, new vscode.ShellExecution(`${command} "${name}"`));
- result.push(task);
- let lowerCaseTaskName = name.toLowerCase();
- if (isBuildTask(lowerCaseTaskName)) {
- task.group = vscode.TaskGroup.Build;
- } else if (isTestTask(lowerCaseTaskName)) {
- task.group = vscode.TaskGroup.Test;
+ if (!tasksStart && !tasksEnd) {
+ if (line.indexOf('Available tasks') === 0) {
+ tasksStart = true;
+ }
+ } else if (tasksStart && !tasksEnd) {
+ if (line.indexOf('Tasks run in the order specified') === 0) {
+ tasksEnd = true;
+ } else {
+ let regExp = /^\s*(\S.*\S) \S/g;
+ let matches = regExp.exec(line);
+ if (matches && matches.length === 2) {
+ let name = matches[1];
+ let kind: GruntTaskDefinition = {
+ type: 'grunt',
+ task: name
+ };
+ let source = 'grunt';
+ let options: vscode.ShellExecutionOptions = { cwd: this.workspaceFolder.uri.fsPath };
+ let task = name.indexOf(' ') === -1
+ ? new vscode.Task(kind, this.workspaceFolder, name, source, new vscode.ShellExecution(`${command} ${name}`, options))
+ : new vscode.Task(kind, this.workspaceFolder, name, source, new vscode.ShellExecution(`${command} "${name}"`, options));
+ result.push(task);
+ let lowerCaseTaskName = name.toLowerCase();
+ if (isBuildTask(lowerCaseTaskName)) {
+ task.group = vscode.TaskGroup.Build;
+ } else if (isTestTask(lowerCaseTaskName)) {
+ 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 Grunt for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
+ channel.show(true);
+ return emptyTasks;
}
- 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 Grunt failed with error: {0}', err.error ? err.error.toString() : 'unknown'));
- channel.show(true);
- return emptyTasks;
}
+
+ public dispose() {
+ this.promise = undefined;
+ if (this.fileWatcher) {
+ this.fileWatcher.dispose();
+ }
+ }
+}
+
+class TaskDetector {
+
+ private taskProvider: vscode.Disposable | undefined;
+ private detectors: Map = new Map();
+
+ constructor() {
+ }
+
+ public start(): void {
+ let folders = vscode.workspace.workspaceFolders;
+ if (folders) {
+ this.updateWorkspaceFolders(folders, []);
+ }
+ vscode.workspace.onDidChangeWorkspaceFolders((event) => this.updateWorkspaceFolders(event.added, event.removed));
+ vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this);
+ }
+
+ public dispose(): void {
+ if (this.taskProvider) {
+ this.taskProvider.dispose();
+ this.taskProvider = undefined;
+ }
+ this.detectors.clear();
+ }
+
+ private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
+ for (let remove of removed) {
+ let detector = this.detectors.get(remove.uri.toString());
+ if (detector) {
+ detector.dispose();
+ this.detectors.delete(remove.uri.toString());
+ }
+ }
+ for (let add of added) {
+ let detector = new FolderDetector(add);
+ if (detector.isEnabled()) {
+ this.detectors.set(add.uri.toString(), detector);
+ detector.start();
+ }
+ }
+ this.updateProvider();
+ }
+
+ private updateConfiguration(): void {
+ for (let detector of this.detectors.values()) {
+ if (!detector.isEnabled()) {
+ detector.dispose();
+ this.detectors.delete(detector.workspaceFolder.uri.toString());
+ }
+ }
+ let folders = vscode.workspace.workspaceFolders;
+ if (folders) {
+ for (let folder of folders) {
+ if (!this.detectors.has(folder.uri.toString())) {
+ let detector = new FolderDetector(folder);
+ if (detector.isEnabled()) {
+ this.detectors.set(folder.uri.toString(), detector);
+ detector.start();
+ }
+ }
+ }
+ }
+ this.updateProvider();
+ }
+
+ private updateProvider(): void {
+ if (!this.taskProvider && this.detectors.size > 0) {
+ this.taskProvider = vscode.workspace.registerTaskProvider('gulp', {
+ provideTasks: () => {
+ return this.getTasks();
+ },
+ resolveTask(_task: vscode.Task): vscode.Task | undefined {
+ return undefined;
+ }
+ });
+ }
+ else if (this.taskProvider && this.detectors.size === 0) {
+ this.taskProvider.dispose();
+ this.taskProvider = undefined;
+ }
+ }
+
+ public getTasks(): Promise {
+ return this.computeTasks();
+ }
+
+ private computeTasks(): Promise {
+ if (this.detectors.size === 0) {
+ return Promise.resolve([]);
+ } else if (this.detectors.size === 1) {
+ return this.detectors.values().next().value.getTasks();
+ } else {
+ let promises: Promise[] = [];
+ for (let detector of this.detectors.values()) {
+ promises.push(detector.getTasks().then((value) => value, () => []));
+ }
+ return Promise.all(promises).then((values) => {
+ let result: vscode.Task[] = [];
+ for (let tasks of values) {
+ if (tasks && tasks.length > 0) {
+ result.push(...tasks);
+ }
+ }
+ return result;
+ });
+ }
+ }
+}
+
+let detector: TaskDetector;
+export function activate(_context: vscode.ExtensionContext): void {
+ detector = new TaskDetector();
+ detector.start();
+}
+
+export function deactivate(): void {
+ detector.dispose();
}
\ No newline at end of file
diff --git a/extensions/grunt/tsconfig.json b/extensions/grunt/tsconfig.json
index e804fa3acd7..51007d3cc84 100644
--- a/extensions/grunt/tsconfig.json
+++ b/extensions/grunt/tsconfig.json
@@ -6,11 +6,11 @@
"es2016"
],
"outDir": "./out",
- "strictNullChecks": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
- "noUnusedParameters": true
+ "noUnusedParameters": true,
+ "strict": true
},
"include": [
"src/**/*"
diff --git a/extensions/gulp/package.json b/extensions/gulp/package.json
index 235f3e2d138..00e098d9b20 100644
--- a/extensions/gulp/package.json
+++ b/extensions/gulp/package.json
@@ -18,7 +18,7 @@
"vscode-nls": "^2.0.2"
},
"devDependencies": {
- "@types/node": "^7.0.4"
+ "@types/node": "7.0.43"
},
"main": "./out/main",
"activationEvents": [
@@ -31,6 +31,7 @@
"title": "Gulp",
"properties": {
"gulp.autoDetect": {
+ "scope": "resource",
"type": "string",
"enum": [
"off",
diff --git a/extensions/gulp/src/main.ts b/extensions/gulp/src/main.ts
index 24d7370cf13..cde1116d3ef 100644
--- a/extensions/gulp/src/main.ts
+++ b/extensions/gulp/src/main.ts
@@ -13,49 +13,6 @@ import * as nls from 'vscode-nls';
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();
type AutoDetect = 'on' | 'off';
-let taskProvider: vscode.Disposable | undefined;
-
-export function activate(_context: vscode.ExtensionContext): void {
- let workspaceRoot = vscode.workspace.rootPath;
- if (!workspaceRoot) {
- return;
- }
- let pattern = path.join(workspaceRoot, 'gulpfile{.babel.js,.js}');
- let gulpPromise: Thenable | undefined = undefined;
- let fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
- fileWatcher.onDidChange(() => gulpPromise = undefined);
- fileWatcher.onDidCreate(() => gulpPromise = undefined);
- fileWatcher.onDidDelete(() => gulpPromise = undefined);
-
- function onConfigurationChanged() {
- let autoDetect = vscode.workspace.getConfiguration('gulp').get('autoDetect');
- if (taskProvider && autoDetect === 'off') {
- gulpPromise = undefined;
- taskProvider.dispose();
- taskProvider = undefined;
- } else if (!taskProvider && autoDetect === 'on') {
- taskProvider = vscode.workspace.registerTaskProvider('gulp', {
- provideTasks: () => {
- if (!gulpPromise) {
- gulpPromise = getGulpTasks();
- }
- return gulpPromise;
- },
- resolveTask(_task: vscode.Task): vscode.Task | undefined {
- return undefined;
- }
- });
- }
- }
- vscode.workspace.onDidChangeConfiguration(onConfigurationChanged);
- onConfigurationChanged();
-}
-
-export function deactivate(): void {
- if (taskProvider) {
- taskProvider.dispose();
- }
-}
function exists(file: string): Promise {
return new Promise((resolve, _reject) => {
@@ -76,19 +33,6 @@ 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 GulpTaskDefinition extends vscode.TaskDefinition {
- task: string;
- file?: string;
-}
-
const buildNames: string[] = ['build', 'compile', 'watch'];
function isBuildTask(name: string): boolean {
for (let buildName of buildNames) {
@@ -109,69 +53,241 @@ function isTestTask(name: string): boolean {
return false;
}
-async function getGulpTasks(): Promise {
- let workspaceRoot = vscode.workspace.rootPath;
- let emptyTasks: vscode.Task[] = [];
- if (!workspaceRoot) {
- return emptyTasks;
+let _channel: vscode.OutputChannel;
+function getOutputChannel(): vscode.OutputChannel {
+ if (!_channel) {
+ _channel = vscode.window.createOutputChannel('Gulp Auto Detection');
}
- let gulpfile = path.join(workspaceRoot, 'gulpfile.js');
- if (!await exists(gulpfile)) {
- gulpfile = path.join(workspaceRoot, 'gulpfile.babel.js');
- if (! await exists(gulpfile)) {
+ return _channel;
+}
+
+interface GulpTaskDefinition extends vscode.TaskDefinition {
+ task: string;
+ file?: string;
+}
+
+class FolderDetector {
+
+ private fileWatcher: vscode.FileSystemWatcher;
+ private promise: Thenable | undefined;
+
+ constructor(private _workspaceFolder: vscode.WorkspaceFolder) {
+ }
+
+ public get workspaceFolder(): vscode.WorkspaceFolder {
+ return this._workspaceFolder;
+ }
+
+ public isEnabled(): boolean {
+ return vscode.workspace.getConfiguration('gulp', this._workspaceFolder.uri).get('autoDetect') === 'on';
+ }
+
+ public start(): void {
+ let pattern = path.join(this._workspaceFolder.uri.fsPath, 'gulpfile{.babel.js,.js}');
+ this.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
+ this.fileWatcher.onDidChange(() => this.promise = undefined);
+ this.fileWatcher.onDidCreate(() => this.promise = undefined);
+ this.fileWatcher.onDidDelete(() => this.promise = undefined);
+ }
+
+ public async getTasks(): Promise {
+ if (!this.promise) {
+ this.promise = this.computeTasks();
+ }
+ return this.promise;
+ }
+
+ private async computeTasks(): Promise {
+ let rootPath = this._workspaceFolder.uri.scheme === 'file' ? this._workspaceFolder.uri.fsPath : undefined;
+ let emptyTasks: vscode.Task[] = [];
+ if (!rootPath) {
+ return emptyTasks;
+ }
+ let gulpfile = path.join(rootPath, 'gulpfile.js');
+ if (!await exists(gulpfile)) {
+ gulpfile = path.join(rootPath, 'gulpfile.babel.js');
+ if (! await exists(gulpfile)) {
+ return emptyTasks;
+ }
+ }
+
+ let gulpCommand: string;
+ let platform = process.platform;
+ if (platform === 'win32' && await exists(path.join(rootPath!, 'node_modules', '.bin', 'gulp.cmd'))) {
+ gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp.cmd');
+ } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(rootPath!, 'node_modules', '.bin', 'gulp'))) {
+ gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp');
+ } else {
+ gulpCommand = 'gulp';
+ }
+
+ let commandLine = `${gulpCommand} --tasks-simple --no-color`;
+ try {
+ let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
+ if (stderr && stderr.length > 0) {
+ getOutputChannel().appendLine(stderr);
+ getOutputChannel().show(true);
+ }
+ let result: vscode.Task[] = [];
+ if (stdout) {
+ let lines = stdout.split(/\r{0,1}\n/);
+ for (let line of lines) {
+ if (line.length === 0) {
+ continue;
+ }
+ let kind: GulpTaskDefinition = {
+ type: 'gulp',
+ task: line
+ };
+ let options: vscode.ShellExecutionOptions = { cwd: this.workspaceFolder.uri.fsPath };
+ let task = new vscode.Task(kind, this.workspaceFolder, line, 'gulp', new vscode.ShellExecution(`${gulpCommand} ${line}`, options));
+ result.push(task);
+ let lowerCaseLine = line.toLowerCase();
+ if (isBuildTask(lowerCaseLine)) {
+ task.group = vscode.TaskGroup.Build;
+ } else if (isTestTask(lowerCaseLine)) {
+ 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 for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
+ channel.show(true);
return emptyTasks;
}
}
- let gulpCommand: string;
- let platform = process.platform;
- if (platform === 'win32' && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'gulp.cmd'))) {
- gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp.cmd');
- } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'gulp'))) {
- gulpCommand = path.join('.', 'node_modules', '.bin', 'gulp');
- } else {
- gulpCommand = 'gulp';
+ public dispose() {
+ this.promise = undefined;
+ if (this.fileWatcher) {
+ this.fileWatcher.dispose();
+ }
+ }
+}
+
+class TaskDetector {
+
+ private taskProvider: vscode.Disposable | undefined;
+ private detectors: Map = new Map();
+
+ constructor() {
}
- let commandLine = `${gulpCommand} --tasks-simple --no-color`;
- try {
- let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot });
- if (stderr && stderr.length > 0) {
- getOutputChannel().appendLine(stderr);
- getOutputChannel().show(true);
+ public start(): void {
+ let folders = vscode.workspace.workspaceFolders;
+ if (folders) {
+ this.updateWorkspaceFolders(folders, []);
}
- let result: vscode.Task[] = [];
- if (stdout) {
- let lines = stdout.split(/\r{0,1}\n/);
- for (let line of lines) {
- if (line.length === 0) {
- continue;
- }
- let kind: GulpTaskDefinition = {
- type: 'gulp',
- task: line
- };
- let task = new vscode.Task(kind, line, 'gulp', new vscode.ShellExecution(`${gulpCommand} ${line}`));
- result.push(task);
- let lowerCaseLine = line.toLowerCase();
- if (isBuildTask(lowerCaseLine)) {
- task.group = vscode.TaskGroup.Build;
- } else if (isTestTask(lowerCaseLine)) {
- task.group = vscode.TaskGroup.Test;
+ vscode.workspace.onDidChangeWorkspaceFolders((event) => this.updateWorkspaceFolders(event.added, event.removed));
+ vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this);
+ }
+
+ public dispose(): void {
+ if (this.taskProvider) {
+ this.taskProvider.dispose();
+ this.taskProvider = undefined;
+ }
+ this.detectors.clear();
+ }
+
+ private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
+ for (let remove of removed) {
+ let detector = this.detectors.get(remove.uri.toString());
+ if (detector) {
+ detector.dispose();
+ this.detectors.delete(remove.uri.toString());
+ }
+ }
+ for (let add of added) {
+ let detector = new FolderDetector(add);
+ if (detector.isEnabled()) {
+ this.detectors.set(add.uri.toString(), detector);
+ detector.start();
+ }
+ }
+ this.updateProvider();
+ }
+
+ private updateConfiguration(): void {
+ for (let detector of this.detectors.values()) {
+ if (!detector.isEnabled()) {
+ detector.dispose();
+ this.detectors.delete(detector.workspaceFolder.uri.toString());
+ }
+ }
+ let folders = vscode.workspace.workspaceFolders;
+ if (folders) {
+ for (let folder of folders) {
+ if (!this.detectors.has(folder.uri.toString())) {
+ let detector = new FolderDetector(folder);
+ if (detector.isEnabled()) {
+ this.detectors.set(folder.uri.toString(), detector);
+ detector.start();
+ }
}
}
}
- 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;
+ this.updateProvider();
}
+
+ private updateProvider(): void {
+ if (!this.taskProvider && this.detectors.size > 0) {
+ this.taskProvider = vscode.workspace.registerTaskProvider('gulp', {
+ provideTasks: () => {
+ return this.getTasks();
+ },
+ resolveTask(_task: vscode.Task): vscode.Task | undefined {
+ return undefined;
+ }
+ });
+ }
+ else if (this.taskProvider && this.detectors.size === 0) {
+ this.taskProvider.dispose();
+ this.taskProvider = undefined;
+ }
+ }
+
+ public getTasks(): Promise {
+ return this.computeTasks();
+ }
+
+ private computeTasks(): Promise {
+ if (this.detectors.size === 0) {
+ return Promise.resolve([]);
+ } else if (this.detectors.size === 1) {
+ return this.detectors.values().next().value.getTasks();
+ } else {
+ let promises: Promise[] = [];
+ for (let detector of this.detectors.values()) {
+ promises.push(detector.getTasks().then((value) => value, () => []));
+ }
+ return Promise.all(promises).then((values) => {
+ let result: vscode.Task[] = [];
+ for (let tasks of values) {
+ if (tasks && tasks.length > 0) {
+ result.push(...tasks);
+ }
+ }
+ return result;
+ });
+ }
+ }
+}
+
+let detector: TaskDetector;
+export function activate(_context: vscode.ExtensionContext): void {
+ detector = new TaskDetector();
+ detector.start();
+}
+
+export function deactivate(): void {
+ detector.dispose();
}
\ No newline at end of file
diff --git a/extensions/gulp/tsconfig.json b/extensions/gulp/tsconfig.json
index e804fa3acd7..51007d3cc84 100644
--- a/extensions/gulp/tsconfig.json
+++ b/extensions/gulp/tsconfig.json
@@ -6,11 +6,11 @@
"es2016"
],
"outDir": "./out",
- "strictNullChecks": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
- "noUnusedParameters": true
+ "noUnusedParameters": true,
+ "strict": true
},
"include": [
"src/**/*"
diff --git a/extensions/html/.vscode/launch.json b/extensions/html/.vscode/launch.json
index c794c543acd..753220eccdf 100644
--- a/extensions/html/.vscode/launch.json
+++ b/extensions/html/.vscode/launch.json
@@ -7,11 +7,11 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
- "--extensionDevelopmentPath=${workspaceRoot}"
+ "--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
- "outFiles": ["${workspaceRoot}/client/out/**/*.js"],
+ "outFiles": ["${workspaceFolder}/client/out/**/*.js"],
"preLaunchTask": "npm"
},
{
@@ -19,10 +19,10 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
- "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/client/out/test" ],
+ "args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/client/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
- "outFiles": ["${workspaceRoot}/client/out/test/**/*.js"],
+ "outFiles": ["${workspaceFolder}/client/out/test/**/*.js"],
"preLaunchTask": "npm"
},
{
@@ -32,7 +32,7 @@
"port": 6004,
"protocol": "legacy",
"sourceMaps": true,
- "outFiles": ["${workspaceRoot}/server/out/**/*.js"]
+ "outFiles": ["${workspaceFolder}/server/out/**/*.js"]
}
]
}
\ No newline at end of file
diff --git a/extensions/html/.vscode/tasks.json b/extensions/html/.vscode/tasks.json
index a132a04214d..9e5593ade83 100644
--- a/extensions/html/.vscode/tasks.json
+++ b/extensions/html/.vscode/tasks.json
@@ -1,5 +1,5 @@
// Available variables which can be used inside of strings.
-// ${workspaceRoot}: the root folder of the team
+// ${workspaceFolder}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
diff --git a/extensions/html/client/src/htmlMain.ts b/extensions/html/client/src/htmlMain.ts
index 44138ce758a..db3d12b2f3a 100644
--- a/extensions/html/client/src/htmlMain.ts
+++ b/extensions/html/client/src/htmlMain.ts
@@ -6,14 +6,14 @@
import * as path from 'path';
-import { languages, ExtensionContext, IndentAction, Position, TextDocument, Color, ColorRange } from 'vscode';
+import { languages, ExtensionContext, IndentAction, Position, TextDocument, Color, ColorInformation, ColorPresentation } from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, TextDocumentPositionParams } from 'vscode-languageclient';
import { EMPTY_ELEMENTS } from './htmlEmptyTagsShared';
import { activateTagClosing } from './tagClosing';
import TelemetryReporter from 'vscode-extension-telemetry';
-import { ConfigurationFeature } from 'vscode-languageclient/lib/proposed';
-import { DocumentColorRequest } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
+import { ConfigurationFeature } from 'vscode-languageclient/lib/configuration.proposed';
+import { DocumentColorRequest, DocumentColorParams, ColorPresentationRequest, ColorPresentationParams } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();
@@ -28,18 +28,6 @@ interface IPackageInfo {
aiKey: string;
}
-const CSSColorFormats = {
- Hex: '#{red:X}{green:X}{blue:X}',
- RGB: {
- opaque: 'rgb({red:d[0-255]}, {green:d[0-255]}, {blue:d[0-255]})',
- transparent: 'rgba({red:d[0-255]}, {green:d[0-255]}, {blue:d[0-255]}, {alpha})'
- },
- HSL: {
- opaque: 'hsl({hue:d[0-360]}, {saturation:d[0-100]}%, {luminance:d[0-100]}%)',
- transparent: 'hsla({hue:d[0-360]}, {saturation:d[0-100]}%, {luminance:d[0-100]}%, {alpha})'
- }
-};
-
export function activate(context: ExtensionContext) {
let toDispose = context.subscriptions;
@@ -83,13 +71,30 @@ export function activate(context: ExtensionContext) {
toDispose.push(disposable);
client.onReady().then(() => {
disposable = languages.registerColorProvider(documentSelector, {
- provideDocumentColors(document: TextDocument): Thenable {
- let params = client.code2ProtocolConverter.asDocumentSymbolParams(document);
+ provideDocumentColors(document: TextDocument): Thenable {
+ let params: DocumentColorParams = {
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)
+ };
return client.sendRequest(DocumentColorRequest.type, params).then(symbols => {
return symbols.map(symbol => {
let range = client.protocol2CodeConverter.asRange(symbol.range);
- let color = new Color(symbol.color.red * 255, symbol.color.green * 255, symbol.color.blue * 255, symbol.color.alpha);
- return new ColorRange(range, color, [CSSColorFormats.Hex, CSSColorFormats.RGB, CSSColorFormats.HSL]);
+ let color = new Color(symbol.color.red, symbol.color.green, symbol.color.blue, symbol.color.alpha);
+ return new ColorInformation(range, color);
+ });
+ });
+ },
+ provideColorPresentations(color, context): Thenable {
+ let params: ColorPresentationParams = {
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(context.document),
+ color,
+ range: client.code2ProtocolConverter.asRange(context.range)
+ };
+ return client.sendRequest(ColorPresentationRequest.type, params).then(presentations => {
+ return presentations.map(p => {
+ let presentation = new ColorPresentation(p.label);
+ presentation.textEdit = p.textEdit && client.protocol2CodeConverter.asTextEdit(p.textEdit);
+ presentation.additionalTextEdits = p.additionalTextEdits && client.protocol2CodeConverter.asTextEdits(p.additionalTextEdits);
+ return presentation;
});
});
}
@@ -171,4 +176,4 @@ function getPackageInfo(context: ExtensionContext): IPackageInfo {
};
}
return null;
-}
\ No newline at end of file
+}
diff --git a/extensions/html/client/src/typings/color-convert.d.ts b/extensions/html/client/src/typings/color-convert.d.ts
new file mode 100644
index 00000000000..a88de674d2d
--- /dev/null
+++ b/extensions/html/client/src/typings/color-convert.d.ts
@@ -0,0 +1,11 @@
+declare module "color-convert" {
+ module convert {
+ module rgb {
+ function hex(r: number, g: number, b: number);
+ function hsl(r: number, g: number, b: number);
+ function hvs(r: number, g: number, b: number);
+ }
+ }
+
+ export = convert;
+}
\ No newline at end of file
diff --git a/extensions/html/client/tsconfig.json b/extensions/html/client/tsconfig.json
index 31c07df105b..d2f8f6376fe 100644
--- a/extensions/html/client/tsconfig.json
+++ b/extensions/html/client/tsconfig.json
@@ -3,6 +3,7 @@
"target": "es5",
"module": "commonjs",
"outDir": "./out",
+ "noUnusedLocals": true,
"lib": [
"es5", "es2015.promise"
]
diff --git a/extensions/html/npm-shrinkwrap.json b/extensions/html/npm-shrinkwrap.json
index f8f32b0eef7..358372962ed 100644
--- a/extensions/html/npm-shrinkwrap.json
+++ b/extensions/html/npm-shrinkwrap.json
@@ -13,24 +13,24 @@
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz"
},
"vscode-jsonrpc": {
- "version": "3.3.1",
- "from": "vscode-jsonrpc@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.3.1.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-jsonrpc@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0-next.2.tgz"
},
"vscode-languageclient": {
- "version": "3.4.0-next.17",
- "from": "vscode-languageclient@next",
- "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.4.0-next.17.tgz"
+ "version": "3.5.0-next.4",
+ "from": "vscode-languageclient@3.5.0-next.4",
+ "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.5.0-next.4.tgz"
},
"vscode-languageserver-protocol": {
- "version": "3.1.1",
- "from": "vscode-languageserver-protocol@>=3.1.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.1.1.tgz"
+ "version": "3.5.0-next.5",
+ "from": "vscode-languageserver-protocol@3.5.0-next.5",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0-next.5.tgz"
},
"vscode-languageserver-types": {
- "version": "3.3.0",
- "from": "vscode-languageserver-types@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.3.0.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-languageserver-types@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0-next.2.tgz"
},
"vscode-nls": {
"version": "2.0.2",
diff --git a/extensions/html/package.json b/extensions/html/package.json
index 3f4871ce158..da8612b9852 100644
--- a/extensions/html/package.json
+++ b/extensions/html/package.json
@@ -17,8 +17,8 @@
"compile": "gulp compile-extension:html-client && gulp compile-extension:html-server",
"postinstall": "cd server && npm install",
"update-grammar": "node ../../build/npm/update-grammar.js textmate/html.tmbundle Syntaxes/HTML.plist ./syntaxes/html.json",
- "install-client-next": "npm install vscode-languageserver-types -f -S && npm install vscode-languageclient@next -f -S",
- "install-client-local": "npm install ../../../vscode-languageserver-node/types -f -S && npm install ../../../vscode-languageserver-node/client -f -S"
+ "install-client-next": "npm install vscode-languageclient@next -f -S",
+ "install-client-local": "npm install ../../../vscode-languageserver-node/client -f -S"
},
"contributes": {
"languages": [
@@ -92,7 +92,7 @@
"null"
],
"scope": "resource",
- "default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var",
+ "default": "wbr",
"description": "%html.format.unformatted.desc%"
},
"html.format.contentUnformatted": {
@@ -101,7 +101,7 @@
"null"
],
"scope": "resource",
- "default": "pre",
+ "default": "pre,code,textarea",
"description": "%html.format.contentUnformatted.desc%"
},
"html.format.indentInnerHtml": {
@@ -216,13 +216,10 @@
},
"dependencies": {
"vscode-extension-telemetry": "0.0.8",
- "vscode-languageclient": "3.4.0-next.17",
- "vscode-languageserver-protocol": "^3.1.1",
- "vscode-languageserver-types": "^3.3.0",
+ "vscode-languageclient": "3.5.0-next.4",
"vscode-nls": "2.0.2"
},
"devDependencies": {
- "@types/node": "^6.0.51",
- "@types/mocha": "^2.2.33"
+ "@types/node": "7.0.43"
}
}
diff --git a/extensions/html/server/.vscode/launch.json b/extensions/html/server/.vscode/launch.json
index a09436fd912..764c1456f17 100644
--- a/extensions/html/server/.vscode/launch.json
+++ b/extensions/html/server/.vscode/launch.json
@@ -8,25 +8,25 @@
"request": "attach",
"port": 6004,
"sourceMaps": true,
- "outDir": "${workspaceRoot}/out"
+ "outDir": "${workspaceFolder}/out"
},
{
"name": "Unit Tests",
"type": "node",
"request": "launch",
- "program": "${workspaceRoot}/../../../node_modules/mocha/bin/_mocha",
+ "program": "${workspaceFolder}/../../../node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--timeout",
"999999",
"--colors"
],
- "cwd": "${workspaceRoot}",
+ "cwd": "${workspaceFolder}",
"runtimeExecutable": null,
"runtimeArgs": [],
"env": {},
"sourceMaps": true,
- "outDir": "${workspaceRoot}/out"
+ "outDir": "${workspaceFolder}/out"
}
]
}
\ No newline at end of file
diff --git a/extensions/html/server/npm-shrinkwrap.json b/extensions/html/server/npm-shrinkwrap.json
index 62a5bf9b691..28596433531 100644
--- a/extensions/html/server/npm-shrinkwrap.json
+++ b/extensions/html/server/npm-shrinkwrap.json
@@ -3,34 +3,34 @@
"version": "1.0.0",
"dependencies": {
"vscode-css-languageservice": {
- "version": "2.1.4",
- "from": "vscode-css-languageservice@next",
- "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.4.tgz"
+ "version": "3.0.0",
+ "from": "vscode-css-languageservice@3.0.0",
+ "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-3.0.0.tgz"
},
"vscode-html-languageservice": {
- "version": "2.0.7",
- "from": "vscode-html-languageservice@next",
- "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.7.tgz"
+ "version": "2.0.10",
+ "from": "vscode-html-languageservice@2.0.10",
+ "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.10.tgz"
},
"vscode-jsonrpc": {
- "version": "3.3.1",
- "from": "vscode-jsonrpc@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.3.1.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-jsonrpc@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0-next.2.tgz"
},
"vscode-languageserver": {
- "version": "3.4.0-next.6",
- "from": "vscode-languageserver@next",
- "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.4.0-next.6.tgz"
+ "version": "3.5.0-next.6",
+ "from": "vscode-languageserver@3.5.0-next.6",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.5.0-next.6.tgz"
},
"vscode-languageserver-protocol": {
- "version": "3.1.1",
- "from": "vscode-languageserver-protocol@>=3.1.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.1.1.tgz"
+ "version": "3.5.0-next.5",
+ "from": "vscode-languageserver-protocol@3.5.0-next.5",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.0-next.5.tgz"
},
"vscode-languageserver-types": {
- "version": "3.3.0",
- "from": "vscode-languageserver-types@>=3.3.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.3.0.tgz"
+ "version": "3.5.0-next.2",
+ "from": "vscode-languageserver-types@3.5.0-next.2",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0-next.2.tgz"
},
"vscode-nls": {
"version": "2.0.2",
diff --git a/extensions/html/server/package.json b/extensions/html/server/package.json
index 3cac05b7da9..9c54bcba388 100644
--- a/extensions/html/server/package.json
+++ b/extensions/html/server/package.json
@@ -8,17 +8,15 @@
"node": "*"
},
"dependencies": {
- "vscode-css-languageservice": "^2.1.4",
- "vscode-html-languageservice": "^2.0.7",
- "vscode-languageserver": "3.4.0-next.6",
- "vscode-languageserver-protocol": "^3.1.1",
- "vscode-languageserver-types": "^3.3.0",
+ "vscode-css-languageservice": "3.0.0",
+ "vscode-html-languageservice": "2.0.10",
+ "vscode-languageserver": "3.5.0-next.6",
"vscode-nls": "^2.0.2",
"vscode-uri": "^1.0.1"
},
"devDependencies": {
- "@types/node": "^6.0.51",
- "@types/mocha": "^2.2.33"
+ "@types/node": "7.0.43",
+ "@types/mocha": "2.2.33"
},
"scripts": {
"compile": "gulp compile-extension:html-server",
diff --git a/extensions/html/server/src/htmlServerMain.ts b/extensions/html/server/src/htmlServerMain.ts
index 9b53da722a2..ff5df2a8ebd 100644
--- a/extensions/html/server/src/htmlServerMain.ts
+++ b/extensions/html/server/src/htmlServerMain.ts
@@ -4,13 +4,13 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
-import { createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult, RequestType, DocumentRangeFormattingRequest, Disposable, DocumentSelector, GetConfigurationParams, TextDocumentPositionParams, ServerCapabilities, Position } from 'vscode-languageserver';
+import { createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult, RequestType, DocumentRangeFormattingRequest, Disposable, DocumentSelector, TextDocumentPositionParams, ServerCapabilities, Position } from 'vscode-languageserver';
import { DocumentContext } from 'vscode-html-languageservice';
import { TextDocument, Diagnostic, DocumentLink, SymbolInformation } from 'vscode-languageserver-types';
import { getLanguageModes, LanguageModes, Settings } from './modes/languageModes';
-import { GetConfigurationRequest } from 'vscode-languageserver-protocol/lib/protocol.configuration.proposed';
-import { DocumentColorRequest, ServerCapabilities as CPServerCapabilities, ColorInformation } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
+import { ConfigurationRequest, ConfigurationParams } from 'vscode-languageserver-protocol/lib/protocol.configuration.proposed';
+import { DocumentColorRequest, ServerCapabilities as CPServerCapabilities, ColorInformation, ColorPresentationRequest } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
import { format } from './modes/formatting';
import { pushAll } from './utils/arrays';
@@ -54,13 +54,12 @@ documents.onDidClose(e => {
});
function getDocumentSettings(textDocument: TextDocument, needsDocumentSettings: () => boolean): Thenable {
- console.log('scopedSettingsSupport ' + scopedSettingsSupport + 'needsSettings ' + needsDocumentSettings());
if (scopedSettingsSupport && needsDocumentSettings()) {
let promise = documentSettings[textDocument.uri];
if (!promise) {
let scopeUri = textDocument.uri;
- let configRequestParam: GetConfigurationParams = { items: [{ scopeUri, section: 'css' }, { scopeUri, section: 'html' }, { scopeUri, section: 'javascript' }] };
- promise = connection.sendRequest(GetConfigurationRequest.type, configRequestParam).then(s => ({ css: s[0], html: s[1], javascript: s[2] }));
+ let configRequestParam: ConfigurationParams = { items: [{ scopeUri, section: 'css' }, { scopeUri, section: 'html' }, { scopeUri, section: 'javascript' }] };
+ promise = connection.sendRequest(ConfigurationRequest.type, configRequestParam).then(s => ({ css: s[0], html: s[1], javascript: s[2] }));
documentSettings[textDocument.uri] = promise;
}
return promise;
@@ -324,6 +323,17 @@ connection.onRequest(DocumentColorRequest.type, params => {
return infos;
});
+connection.onRequest(ColorPresentationRequest.type, params => {
+ let document = documents.get(params.textDocument.uri);
+ if (document) {
+ let mode = languageModes.getModeAtPosition(document, params.range.start);
+ if (mode && mode.getColorPresentations) {
+ return mode.getColorPresentations(document, params.color, params.range);
+ }
+ }
+ return [];
+});
+
connection.onRequest(TagCloseRequest.type, params => {
let document = documents.get(params.textDocument.uri);
if (document) {
diff --git a/extensions/html/server/src/modes/cssMode.ts b/extensions/html/server/src/modes/cssMode.ts
index dcb221e83d5..f787b9c2742 100644
--- a/extensions/html/server/src/modes/cssMode.ts
+++ b/extensions/html/server/src/modes/cssMode.ts
@@ -5,10 +5,11 @@
'use strict';
import { LanguageModelCache, getLanguageModelCache } from '../languageModelCache';
-import { TextDocument, Position } from 'vscode-languageserver-types';
+import { TextDocument, Position, Range } from 'vscode-languageserver-types';
import { getCSSLanguageService, Stylesheet } from 'vscode-css-languageservice';
import { LanguageMode, Settings } from './languageModes';
import { HTMLDocumentRegions, CSS_STYLE_RULE } from './embeddedSupport';
+import { Color } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
export function getCSSMode(documentRegions: LanguageModelCache): LanguageMode {
let cssLanguageService = getCSSLanguageService();
@@ -54,6 +55,10 @@ export function getCSSMode(documentRegions: LanguageModelCache(entry.isWriteAccess ? DocumentHighlightKind.Write : DocumentHighlightKind.Text)
};
});
- };
+ }
return null;
},
findDocumentSymbols(document: TextDocument): SymbolInformation[] {
@@ -286,7 +286,7 @@ export function getJavascriptMode(documentRegions: LanguageModelCache Location[];
format?: (document: TextDocument, range: Range, options: FormattingOptions, settings: Settings) => TextEdit[];
findDocumentColors?: (document: TextDocument) => ColorInformation[];
+ getColorPresentations?: (document: TextDocument, color: Color, range: Range) => ColorPresentation[];
doAutoClose?: (document: TextDocument, position: Position) => string;
onDocumentRemoved(document: TextDocument): void;
dispose(): void;
diff --git a/extensions/html/server/src/test/embedded.test.ts b/extensions/html/server/src/test/embedded.test.ts
index 95050a135e5..acc3b4be0d8 100644
--- a/extensions/html/server/src/test/embedded.test.ts
+++ b/extensions/html/server/src/test/embedded.test.ts
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
+import 'mocha';
import * as assert from 'assert';
import * as embeddedSupport from '../modes/embeddedSupport';
import { TextDocument } from 'vscode-languageserver-types';
diff --git a/extensions/html/server/src/test/fixtures/expected/19813-4spaces.html b/extensions/html/server/src/test/fixtures/expected/19813-4spaces.html
index d6bf8136562..0a5a4431a1a 100644
--- a/extensions/html/server/src/test/fixtures/expected/19813-4spaces.html
+++ b/extensions/html/server/src/test/fixtures/expected/19813-4spaces.html
@@ -13,7 +13,6 @@
}
},
});
-
diff --git a/extensions/html/server/src/test/fixtures/expected/19813-tab.html b/extensions/html/server/src/test/fixtures/expected/19813-tab.html
index 5f0bf9e0003..6292fe9cd4e 100644
--- a/extensions/html/server/src/test/fixtures/expected/19813-tab.html
+++ b/extensions/html/server/src/test/fixtures/expected/19813-tab.html
@@ -13,7 +13,6 @@
}
},
});
-
diff --git a/extensions/html/server/src/test/fixtures/expected/19813.html b/extensions/html/server/src/test/fixtures/expected/19813.html
index 296e4ba3e96..aac7580ac1e 100644
--- a/extensions/html/server/src/test/fixtures/expected/19813.html
+++ b/extensions/html/server/src/test/fixtures/expected/19813.html
@@ -13,7 +13,6 @@
}
},
});
-
diff --git a/extensions/html/server/src/test/fixtures/expected/21634.html b/extensions/html/server/src/test/fixtures/expected/21634.html
index 189aab98163..8398821a6ae 100644
--- a/extensions/html/server/src/test/fixtures/expected/21634.html
+++ b/extensions/html/server/src/test/fixtures/expected/21634.html
@@ -3,5 +3,4 @@
\ No newline at end of file
diff --git a/extensions/html/server/src/test/formatting.test.ts b/extensions/html/server/src/test/formatting.test.ts
index 713d2943ed4..ad8918274b6 100644
--- a/extensions/html/server/src/test/formatting.test.ts
+++ b/extensions/html/server/src/test/formatting.test.ts
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
+import 'mocha';
import * as path from 'path';
import * as fs from 'fs';
@@ -58,12 +59,11 @@ suite('HTML Embedded Formatting', () => {
test('HTML & Scripts', function (): any {
assertFormat('', '\n\n\n \n\n\n');
- assertFormat('', '\n\n\n \n\n\n');
- assertFormat('', '\n\n\n \n\n\n');
- assertFormat('\n ', '\n\n\n \n\n\n');
- assertFormat('\n ', '\n\n\n \n\n\n');
-
- assertFormat('\n ||', '\n ');
+ assertFormat('', '\n\n\n \n\n\n');
+ assertFormat('', '\n\n\n \n\n\n');
+ assertFormat('\n ', '\n\n\n \n\n\n');
+ assertFormat('\n ', '\n\n\n \n\n\n');
+ assertFormat('\n ||', '\n ');
});
test('HTLM & Scripts - Fixtures', function () {
@@ -74,11 +74,11 @@ suite('HTML Embedded Formatting', () => {
});
test('Script end tag', function (): any {
- assertFormat('\n\n ', '\n\n\n \n\n\n');
+ assertFormat('\n\n ', '\n\n\n \n\n\n');
});
test('HTML & Multiple Scripts', function (): any {
- assertFormat('\n', '\n\n\n \n \n\n\n');
+ assertFormat('\n', '\n\n\n \n \n\n\n');
});
test('HTML & Styles', function (): any {
@@ -95,7 +95,7 @@ suite('HTML Embedded Formatting', () => {
};
assertFormat(']Hello
', '\n\n\n Hello
\n\n\n\n', options);
assertFormat('|Hello
|', '\n Hello
\n', options);
- assertFormat('', '\n\n\n \n\n\n\n', options);
+ assertFormat('', '\n\n\n \n\n\n\n', options);
});
test('Inside script', function (): any {
@@ -104,7 +104,7 @@ suite('HTML Embedded Formatting', () => {
});
test('Range after new line', function (): any {
- assertFormat('\n |\n|', '\n \n');
+ assertFormat('\n |\n|', '\n \n');
});
});
diff --git a/extensions/html/server/src/test/javascriptMode.test.ts b/extensions/html/server/src/test/javascriptMode.test.ts
index c5d44e88cae..c775c19b0b9 100644
--- a/extensions/html/server/src/test/javascriptMode.test.ts
+++ b/extensions/html/server/src/test/javascriptMode.test.ts
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
+import 'mocha';
import * as assert from 'assert';
import { getJavascriptMode } from '../modes/javascriptMode';
import { TextDocument } from 'vscode-languageserver-types';
diff --git a/extensions/html/server/src/test/ref.d.ts b/extensions/html/server/src/test/ref.d.ts
deleted file mode 100644
index 4e54d6a8a24..00000000000
--- a/extensions/html/server/src/test/ref.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-///
\ No newline at end of file
diff --git a/extensions/html/server/src/utils/edits.ts b/extensions/html/server/src/utils/edits.ts
index 5983d9014fb..f29dd174f67 100644
--- a/extensions/html/server/src/utils/edits.ts
+++ b/extensions/html/server/src/utils/edits.ts
@@ -15,6 +15,7 @@ export function applyEdits(document: TextDocument, edits: TextEdit[]): string {
}
return startDiff;
});
+ // @ts-ignore unused local
let lastOffset = text.length;
sortedEdits.forEach(e => {
let startOffset = document.offsetAt(e.range.start);
diff --git a/extensions/html/server/tsconfig.json b/extensions/html/server/tsconfig.json
index 31c07df105b..d2f8f6376fe 100644
--- a/extensions/html/server/tsconfig.json
+++ b/extensions/html/server/tsconfig.json
@@ -3,6 +3,7 @@
"target": "es5",
"module": "commonjs",
"outDir": "./out",
+ "noUnusedLocals": true,
"lib": [
"es5", "es2015.promise"
]
diff --git a/extensions/html/snippet/html.json b/extensions/html/snippet/html.json
index a7f9c9cb1ab..f999d151752 100644
--- a/extensions/html/snippet/html.json
+++ b/extensions/html/snippet/html.json
@@ -5,15 +5,15 @@
"",
"",
"",
- " ",
- " ",
- " {{Page Title}}",
- " ",
- " ",
- " ",
+ "\t",
+ "\t",
+ "\t{{Page Title}}",
+ "\t",
+ "\t",
+ "\t",
"",
"",
- " {{}}",
+ "\t{{}}",
"",
""
],
diff --git a/extensions/html/test/colorize-results/12750_html.json b/extensions/html/test/colorize-results/12750_html.json
index 88c372b5581..a89b03aa84f 100644
--- a/extensions/html/test/colorize-results/12750_html.json
+++ b/extensions/html/test/colorize-results/12750_html.json
@@ -25,11 +25,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -47,11 +47,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -102,11 +102,11 @@
"c": "\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -115,8 +115,8 @@
"r": {
"dark_plus": "support.variable: #9CDCFE",
"light_plus": "support.variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "support.variable: #9CDCFE"
}
},
@@ -124,11 +124,11 @@
"c": ".",
"t": "text.html.basic meta.embedded.block.html source.js meta.function-call.js punctuation.accessor.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -137,8 +137,8 @@
"r": {
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "support.function: #DCDCAA"
}
},
@@ -146,11 +146,11 @@
"c": "(",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -190,22 +190,22 @@
"c": ")",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -289,11 +289,11 @@
"c": "\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -302,8 +302,8 @@
"r": {
"dark_plus": "support.variable: #9CDCFE",
"light_plus": "support.variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "support.variable: #9CDCFE"
}
},
@@ -311,11 +311,11 @@
"c": ".",
"t": "text.html.basic meta.embedded.block.html source.js meta.function-call.js punctuation.accessor.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -324,8 +324,8 @@
"r": {
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "support.function: #DCDCAA"
}
},
@@ -333,11 +333,11 @@
"c": "(",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -377,22 +377,22 @@
"c": ")",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
diff --git a/extensions/html/test/colorize-results/25920_html.json b/extensions/html/test/colorize-results/25920_html.json
index 697937acdbd..16b71acbe88 100644
--- a/extensions/html/test/colorize-results/25920_html.json
+++ b/extensions/html/test/colorize-results/25920_html.json
@@ -58,11 +58,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -80,11 +80,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -135,11 +135,11 @@
"c": "\t",
"t": "text.html.basic meta.embedded.block.html text.html.basic",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -168,11 +168,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -190,11 +190,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -355,11 +355,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -377,11 +377,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -432,11 +432,11 @@
"c": "\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -454,11 +454,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -467,8 +467,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -476,11 +476,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js meta.var-single-variable.expr.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -498,11 +498,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.var.expr.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -520,11 +520,11 @@
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -597,11 +597,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -619,11 +619,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -674,11 +674,11 @@
"c": "\t",
"t": "text.html.basic meta.embedded.block.html text.html.basic",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -707,11 +707,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -729,11 +729,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html text.html.basic meta.tag.any.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
diff --git a/extensions/html/test/colorize-results/test_html.json b/extensions/html/test/colorize-results/test_html.json
index 987bfae286c..a1da5d2c393 100644
--- a/extensions/html/test/colorize-results/test_html.json
+++ b/extensions/html/test/colorize-results/test_html.json
@@ -476,11 +476,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.style.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -498,11 +498,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.style.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -553,11 +553,11 @@
"c": "\t\t",
"t": "text.html.basic meta.embedded.block.html source.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -575,33 +575,33 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css punctuation.section.property-list.begin.bracket.curly.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -619,22 +619,22 @@
"c": ":",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css punctuation.separator.key-value.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -643,7 +643,7 @@
"r": {
"dark_plus": "support.constant.color: #CE9178",
"light_plus": "support.constant.color: #0451A5",
- "dark_vs": "default: #D4D4D4",
+ "dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "support.constant.color: #0451A5",
"hc_black": "support.constant.color: #CE9178"
}
@@ -652,22 +652,22 @@
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css punctuation.terminator.rule.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -685,22 +685,22 @@
"c": ":",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css punctuation.separator.key-value.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -709,7 +709,7 @@
"r": {
"dark_plus": "constant.other.color.rgb-value: #CE9178",
"light_plus": "constant.other.color.rgb-value: #0451A5",
- "dark_vs": "default: #D4D4D4",
+ "dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "constant.other.color.rgb-value: #0451A5",
"hc_black": "constant.other.color.rgb-value: #CE9178"
}
@@ -720,7 +720,7 @@
"r": {
"dark_plus": "constant.other.color.rgb-value: #CE9178",
"light_plus": "constant.other.color.rgb-value: #0451A5",
- "dark_vs": "default: #D4D4D4",
+ "dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "constant.other.color.rgb-value: #0451A5",
"hc_black": "constant.other.color.rgb-value: #CE9178"
}
@@ -729,44 +729,44 @@
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css punctuation.terminator.rule.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.basic meta.embedded.block.html source.css meta.property-list.css punctuation.section.property-list.end.bracket.curly.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t",
"t": "text.html.basic meta.embedded.block.html source.css",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1125,11 +1125,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1147,11 +1147,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1279,11 +1279,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1301,11 +1301,11 @@
"c": "=",
"t": "text.html.basic meta.embedded.block.html meta.tag.metadata.script.html",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1444,11 +1444,11 @@
"c": "\t\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1457,8 +1457,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -1466,11 +1466,11 @@
"c": ".",
"t": "text.html.basic meta.embedded.block.html source.js meta.function-call.js punctuation.accessor.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1479,8 +1479,8 @@
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
@@ -1488,11 +1488,11 @@
"c": "(",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1532,33 +1532,33 @@
"c": ")",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1567,8 +1567,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -1576,11 +1576,11 @@
"c": ".",
"t": "text.html.basic meta.embedded.block.html source.js meta.function-call.js punctuation.accessor.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1589,8 +1589,8 @@
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
@@ -1598,33 +1598,33 @@
"c": "(",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1633,8 +1633,8 @@
"r": {
"dark_plus": "meta.object-literal.key: #9CDCFE",
"light_plus": "meta.object-literal.key: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "meta.object-literal.key: #9CDCFE"
}
},
@@ -1644,8 +1644,8 @@
"r": {
"dark_plus": "meta.object-literal.key: #9CDCFE",
"light_plus": "meta.object-literal.key: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "meta.object-literal.key: #9CDCFE"
}
},
@@ -1653,11 +1653,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1697,22 +1697,22 @@
"c": ",",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js punctuation.separator.comma.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1721,8 +1721,8 @@
"r": {
"dark_plus": "meta.object-literal.key: #9CDCFE",
"light_plus": "meta.object-literal.key: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "meta.object-literal.key: #9CDCFE"
}
},
@@ -1732,8 +1732,8 @@
"r": {
"dark_plus": "meta.object-literal.key: #9CDCFE",
"light_plus": "meta.object-literal.key: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "meta.object-literal.key: #9CDCFE"
}
},
@@ -1741,33 +1741,33 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js meta.objectliteral.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js meta.objectliteral.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1776,8 +1776,8 @@
"r": {
"dark_plus": "meta.object-literal.key: #9CDCFE",
"light_plus": "meta.object-literal.key: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "meta.object-literal.key: #9CDCFE"
}
},
@@ -1787,8 +1787,8 @@
"r": {
"dark_plus": "meta.object-literal.key: #9CDCFE",
"light_plus": "meta.object-literal.key: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "meta.object-literal.key: #9CDCFE"
}
},
@@ -1796,11 +1796,11 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js meta.objectliteral.js meta.object.member.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1840,77 +1840,77 @@
"c": "\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js meta.objectliteral.js meta.object.member.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js meta.objectliteral.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ")",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1919,8 +1919,8 @@
"r": {
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "support.function: #DCDCAA"
}
},
@@ -1928,33 +1928,33 @@
"c": "(",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{ ",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -1963,8 +1963,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -1972,55 +1972,55 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.basic meta.embedded.block.html source.js meta.objectliteral.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ",",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.separator.comma.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": " ",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2038,66 +2038,66 @@
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "(",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.parameters.js punctuation.definition.parameters.begin.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ")",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.parameters.js punctuation.definition.parameters.end.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": " ",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "{",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2106,8 +2106,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "variable: #9CDCFE"
}
},
@@ -2115,11 +2115,11 @@
"c": ".",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js meta.function-call.js punctuation.accessor.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
@@ -2128,8 +2128,8 @@
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
@@ -2137,77 +2137,77 @@
"c": "()",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t\t",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "}",
"t": "text.html.basic meta.embedded.block.html source.js meta.function.expression.js meta.block.js punctuation.definition.block.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ")",
"t": "text.html.basic meta.embedded.block.html source.js meta.brace.round.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": ";",
"t": "text.html.basic meta.embedded.block.html source.js punctuation.terminator.statement.js",
"r": {
- "dark_plus": "default: #D4D4D4",
- "light_plus": "default: #000000",
- "dark_vs": "default: #D4D4D4",
- "light_vs": "default: #000000",
- "hc_black": "default: #FFFFFF"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "\t",
"t": "text.html.basic 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"
+ "dark_plus": "meta.embedded: #D4D4D4",
+ "light_plus": "meta.embedded: #000000",
+ "dark_vs": "meta.embedded: #D4D4D4",
+ "light_vs": "meta.embedded: #000000",
+ "hc_black": "meta.embedded: #FFFFFF"
}
},
{
diff --git a/extensions/jake/package.json b/extensions/jake/package.json
index 9e48dd07c43..58ba0168e4a 100644
--- a/extensions/jake/package.json
+++ b/extensions/jake/package.json
@@ -18,7 +18,7 @@
"vscode-nls": "^2.0.2"
},
"devDependencies": {
- "@types/node": "^7.0.18"
+ "@types/node": "7.0.43"
},
"main": "./out/main",
"activationEvents": [
@@ -31,6 +31,7 @@
"title": "Jake",
"properties": {
"jake.autoDetect": {
+ "scope": "resource",
"type": "string",
"enum": [
"off",
diff --git a/extensions/jake/src/main.ts b/extensions/jake/src/main.ts
index b0b4b137ab9..0a2032c970c 100644
--- a/extensions/jake/src/main.ts
+++ b/extensions/jake/src/main.ts
@@ -13,49 +13,6 @@ import * as nls from 'vscode-nls';
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();
type AutoDetect = 'on' | 'off';
-let taskProvider: vscode.Disposable | undefined;
-
-export function activate(_context: vscode.ExtensionContext): void {
- let workspaceRoot = vscode.workspace.rootPath;
- if (!workspaceRoot) {
- return;
- }
- let pattern = path.join(workspaceRoot, '{Jakefile,Jakefile.js}');
- let jakePromise: Thenable | undefined = undefined;
- let fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
- fileWatcher.onDidChange(() => jakePromise = undefined);
- fileWatcher.onDidCreate(() => jakePromise = undefined);
- fileWatcher.onDidDelete(() => jakePromise = undefined);
-
- function onConfigurationChanged() {
- let autoDetect = vscode.workspace.getConfiguration('jake').get('autoDetect');
- if (taskProvider && autoDetect === 'off') {
- jakePromise = undefined;
- taskProvider.dispose();
- taskProvider = undefined;
- } else if (!taskProvider && autoDetect === 'on') {
- taskProvider = vscode.workspace.registerTaskProvider('jake', {
- provideTasks: () => {
- if (!jakePromise) {
- jakePromise = getJakeTasks();
- }
- return jakePromise;
- },
- resolveTask(_task: vscode.Task): vscode.Task | undefined {
- return undefined;
- }
- });
- }
- }
- vscode.workspace.onDidChangeConfiguration(onConfigurationChanged);
- onConfigurationChanged();
-}
-
-export function deactivate(): void {
- if (taskProvider) {
- taskProvider.dispose();
- }
-}
function exists(file: string): Promise {
return new Promise((resolve, _reject) => {
@@ -76,19 +33,6 @@ 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 JakeTaskDefinition extends vscode.TaskDefinition {
- task: string;
- file?: string;
-}
-
const buildNames: string[] = ['build', 'compile', 'watch'];
function isBuildTask(name: string): boolean {
for (let buildName of buildNames) {
@@ -109,74 +53,246 @@ function isTestTask(name: string): boolean {
return false;
}
-async function getJakeTasks(): Promise {
- let workspaceRoot = vscode.workspace.rootPath;
- let emptyTasks: vscode.Task[] = [];
- if (!workspaceRoot) {
- return emptyTasks;
+let _channel: vscode.OutputChannel;
+function getOutputChannel(): vscode.OutputChannel {
+ if (!_channel) {
+ _channel = vscode.window.createOutputChannel('Jake Auto Detection');
}
- let jakefile = path.join(workspaceRoot, 'Jakefile');
- if (!await exists(jakefile)) {
- jakefile = path.join(workspaceRoot, 'Jakefile.js');
- if (! await exists(jakefile)) {
+ return _channel;
+}
+
+interface JakeTaskDefinition extends vscode.TaskDefinition {
+ task: string;
+ file?: string;
+}
+
+class FolderDetector {
+
+ private fileWatcher: vscode.FileSystemWatcher;
+ private promise: Thenable | undefined;
+
+ constructor(private _workspaceFolder: vscode.WorkspaceFolder) {
+ }
+
+ public get workspaceFolder(): vscode.WorkspaceFolder {
+ return this._workspaceFolder;
+ }
+
+ public isEnabled(): boolean {
+ return vscode.workspace.getConfiguration('jake', this._workspaceFolder.uri).get('autoDetect') === 'on';
+ }
+
+ public start(): void {
+ let pattern = path.join(this._workspaceFolder.uri.fsPath, '{Jakefile,Jakefile.js}');
+ this.fileWatcher = vscode.workspace.createFileSystemWatcher(pattern);
+ this.fileWatcher.onDidChange(() => this.promise = undefined);
+ this.fileWatcher.onDidCreate(() => this.promise = undefined);
+ this.fileWatcher.onDidDelete(() => this.promise = undefined);
+ }
+
+ public async getTasks(): Promise {
+ if (!this.promise) {
+ this.promise = this.computeTasks();
+ }
+ return this.promise;
+ }
+
+ private async computeTasks(): Promise {
+ let rootPath = this._workspaceFolder.uri.scheme === 'file' ? this._workspaceFolder.uri.fsPath : undefined;
+ let emptyTasks: vscode.Task[] = [];
+ if (!rootPath) {
+ return emptyTasks;
+ }
+ let jakefile = path.join(rootPath, 'Jakefile');
+ if (!await exists(jakefile)) {
+ jakefile = path.join(rootPath, 'Jakefile.js');
+ if (! await exists(jakefile)) {
+ return emptyTasks;
+ }
+ }
+
+ let jakeCommand: string;
+ let platform = process.platform;
+ if (platform === 'win32' && await exists(path.join(rootPath!, 'node_modules', '.bin', 'jake.cmd'))) {
+ jakeCommand = path.join('.', 'node_modules', '.bin', 'jake.cmd');
+ } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(rootPath!, 'node_modules', '.bin', 'jake'))) {
+ jakeCommand = path.join('.', 'node_modules', '.bin', 'jake');
+ } else {
+ jakeCommand = 'jake';
+ }
+
+ let commandLine = `${jakeCommand} --tasks`;
+ try {
+ let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
+ if (stderr) {
+ getOutputChannel().appendLine(stderr);
+ getOutputChannel().show(true);
+ }
+ let result: vscode.Task[] = [];
+ if (stdout) {
+ let lines = stdout.split(/\r{0,1}\n/);
+ for (let line of lines) {
+ if (line.length === 0) {
+ continue;
+ }
+ let regExp = /^jake\s+([^\s]+)\s/g;
+ let matches = regExp.exec(line);
+ if (matches && matches.length === 2) {
+ let taskName = matches[1];
+ let kind: JakeTaskDefinition = {
+ type: 'jake',
+ task: taskName
+ };
+ let options: vscode.ShellExecutionOptions = { cwd: this.workspaceFolder.uri.fsPath };
+ let task = new vscode.Task(kind, taskName, 'jake', new vscode.ShellExecution(`${jakeCommand} ${taskName}`, options));
+ result.push(task);
+ let lowerCaseLine = line.toLowerCase();
+ if (isBuildTask(lowerCaseLine)) {
+ task.group = vscode.TaskGroup.Build;
+ } else if (isTestTask(lowerCaseLine)) {
+ 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 for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
+ channel.show(true);
return emptyTasks;
}
}
- let jakeCommand: string;
- let platform = process.platform;
- if (platform === 'win32' && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'jake.cmd'))) {
- jakeCommand = path.join('.', 'node_modules', '.bin', 'jake.cmd');
- } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(workspaceRoot!, 'node_modules', '.bin', 'jake'))) {
- jakeCommand = path.join('.', 'node_modules', '.bin', 'jake');
- } else {
- jakeCommand = 'jake';
+ public dispose() {
+ this.promise = undefined;
+ if (this.fileWatcher) {
+ this.fileWatcher.dispose();
+ }
+ }
+}
+
+class TaskDetector {
+
+ private taskProvider: vscode.Disposable | undefined;
+ private detectors: Map = new Map();
+
+ constructor() {
}
- let commandLine = `${jakeCommand} --tasks`;
- try {
- let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot });
- if (stderr) {
- getOutputChannel().appendLine(stderr);
- getOutputChannel().show(true);
+ public start(): void {
+ let folders = vscode.workspace.workspaceFolders;
+ if (folders) {
+ this.updateWorkspaceFolders(folders, []);
}
- let result: vscode.Task[] = [];
- if (stdout) {
- let lines = stdout.split(/\r{0,1}\n/);
- for (let line of lines) {
- if (line.length === 0) {
- continue;
- }
- let regExp = /^jake\s+([^\s]+)\s/g;
- let matches = regExp.exec(line);
- if (matches && matches.length === 2) {
- let taskName = matches[1];
- let kind: JakeTaskDefinition = {
- type: 'jake',
- task: taskName
- };
- let task = new vscode.Task(kind, taskName, 'jake', new vscode.ShellExecution(`${jakeCommand} ${taskName}`));
- result.push(task);
- let lowerCaseLine = line.toLowerCase();
- if (isBuildTask(lowerCaseLine)) {
- task.group = vscode.TaskGroup.Build;
- } else if (isTestTask(lowerCaseLine)) {
- task.group = vscode.TaskGroup.Test;
+ vscode.workspace.onDidChangeWorkspaceFolders((event) => this.updateWorkspaceFolders(event.added, event.removed));
+ vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this);
+ }
+
+ public dispose(): void {
+ if (this.taskProvider) {
+ this.taskProvider.dispose();
+ this.taskProvider = undefined;
+ }
+ this.detectors.clear();
+ }
+
+ private updateWorkspaceFolders(added: vscode.WorkspaceFolder[], removed: vscode.WorkspaceFolder[]): void {
+ for (let remove of removed) {
+ let detector = this.detectors.get(remove.uri.toString());
+ if (detector) {
+ detector.dispose();
+ this.detectors.delete(remove.uri.toString());
+ }
+ }
+ for (let add of added) {
+ let detector = new FolderDetector(add);
+ if (detector.isEnabled()) {
+ this.detectors.set(add.uri.toString(), detector);
+ detector.start();
+ }
+ }
+ this.updateProvider();
+ }
+
+ private updateConfiguration(): void {
+ for (let detector of this.detectors.values()) {
+ if (!detector.isEnabled()) {
+ detector.dispose();
+ this.detectors.delete(detector.workspaceFolder.uri.toString());
+ }
+ }
+ let folders = vscode.workspace.workspaceFolders;
+ if (folders) {
+ for (let folder of folders) {
+ if (!this.detectors.has(folder.uri.toString())) {
+ let detector = new FolderDetector(folder);
+ if (detector.isEnabled()) {
+ this.detectors.set(folder.uri.toString(), detector);
+ detector.start();
}
}
}
}
- 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;
+ this.updateProvider();
}
+
+ private updateProvider(): void {
+ if (!this.taskProvider && this.detectors.size > 0) {
+ this.taskProvider = vscode.workspace.registerTaskProvider('gulp', {
+ provideTasks: () => {
+ return this.getTasks();
+ },
+ resolveTask(_task: vscode.Task): vscode.Task | undefined {
+ return undefined;
+ }
+ });
+ }
+ else if (this.taskProvider && this.detectors.size === 0) {
+ this.taskProvider.dispose();
+ this.taskProvider = undefined;
+ }
+ }
+
+ public getTasks(): Promise {
+ return this.computeTasks();
+ }
+
+ private computeTasks(): Promise {
+ if (this.detectors.size === 0) {
+ return Promise.resolve([]);
+ } else if (this.detectors.size === 1) {
+ return this.detectors.values().next().value.getTasks();
+ } else {
+ let promises: Promise[] = [];
+ for (let detector of this.detectors.values()) {
+ promises.push(detector.getTasks().then((value) => value, () => []));
+ }
+ return Promise.all(promises).then((values) => {
+ let result: vscode.Task[] = [];
+ for (let tasks of values) {
+ if (tasks && tasks.length > 0) {
+ result.push(...tasks);
+ }
+ }
+ return result;
+ });
+ }
+ }
+}
+
+let detector: TaskDetector;
+export function activate(_context: vscode.ExtensionContext): void {
+ detector = new TaskDetector();
+ detector.start();
+}
+
+export function deactivate(): void {
+ detector.dispose();
}
\ No newline at end of file
diff --git a/extensions/jake/tsconfig.json b/extensions/jake/tsconfig.json
index e804fa3acd7..51007d3cc84 100644
--- a/extensions/jake/tsconfig.json
+++ b/extensions/jake/tsconfig.json
@@ -6,11 +6,11 @@
"es2016"
],
"outDir": "./out",
- "strictNullChecks": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
- "noUnusedParameters": true
+ "noUnusedParameters": true,
+ "strict": true
},
"include": [
"src/**/*"
diff --git a/extensions/java/language-configuration.json b/extensions/java/language-configuration.json
index 5ae0cec3192..cc45a8a0139 100644
--- a/extensions/java/language-configuration.json
+++ b/extensions/java/language-configuration.json
@@ -23,5 +23,11 @@
["\"", "\""],
["'", "'"],
["<", ">"]
- ]
+ ],
+ "folding": {
+ "markers": {
+ "start": "^\\s*//\\s*(#?region\\b)|()"
+ }
+ }
}
diff --git a/extensions/java/syntaxes/java.tmLanguage.json b/extensions/java/syntaxes/java.tmLanguage.json
index 28495a497cc..abc5ee65bb1 100644
--- a/extensions/java/syntaxes/java.tmLanguage.json
+++ b/extensions/java/syntaxes/java.tmLanguage.json
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
- "version": "https://github.com/atom/language-java/commit/4eb3d906f572ef1999b7ebf0708c841d36b32f0b",
+ "version": "https://github.com/atom/language-java/commit/26b83893bf071f291481c924051462e17d2f77cd",
"scopeName": "source.java",
"name": "Java",
"fileTypes": [
@@ -121,18 +121,21 @@
"annotations": {
"patterns": [
{
- "begin": "(@[^ (]+)(\\()",
+ "begin": "((@)[^\\s(]+)(\\()",
"beginCaptures": {
"1": {
"name": "storage.type.annotation.java"
},
"2": {
+ "name": "punctuation.definition.annotation.java"
+ },
+ "3": {
"name": "punctuation.definition.annotation-arguments.begin.bracket.round.java"
}
},
- "end": "(\\))",
+ "end": "\\)",
"endCaptures": {
- "1": {
+ "0": {
"name": "punctuation.definition.annotation-arguments.end.bracket.round.java"
}
},
@@ -155,8 +158,25 @@
]
},
{
- "match": "@\\w*",
- "name": "storage.type.annotation.java"
+ "match": "(@)(interface)\\s+(\\w*)|((@)\\w*)",
+ "name": "meta.declaration.annotation.java",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.annotation.java"
+ },
+ "2": {
+ "name": "storage.modifier.java"
+ },
+ "3": {
+ "name": "storage.type.annotation.java"
+ },
+ "4": {
+ "name": "storage.type.annotation.java"
+ },
+ "5": {
+ "name": "punctuation.definition.annotation.java"
+ }
+ }
}
]
},
@@ -224,7 +244,7 @@
]
},
"class": {
- "begin": "(?=\\w?[\\w\\s]*(?:class|(?:@)?interface|enum)\\s+\\w+)",
+ "begin": "(?=\\w?[\\w\\s]*(?:class|(?(\\w+\\.)*[A-Z]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n (\n <[\\w<>,?\\s]*> # HashMap\n |\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|;)\n)",
+ "begin": "(?x)\n(?=\n (\n (void|boolean|byte|char|short|int|float|long|double)\n |\n (?>(\\w+\\.)*[A-Z]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n (\n <[\\w<>,?\\s]*> # HashMap\n )?\n (\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|;)\n)",
"end": "(?=;)",
"name": "meta.definition.variable.java",
"patterns": [
diff --git a/extensions/java/test/colorize-results/basic_java.json b/extensions/java/test/colorize-results/basic_java.json
index 0622a9209cc..1ef3a8ff324 100644
--- a/extensions/java/test/colorize-results/basic_java.json
+++ b/extensions/java/test/colorize-results/basic_java.json
@@ -1056,7 +1056,18 @@
}
},
{
- "c": "@SuppressWarnings",
+ "c": "@",
+ "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java storage.type.annotation.java punctuation.definition.annotation.java",
+ "r": {
+ "dark_plus": "storage.type.annotation.java: #4EC9B0",
+ "light_plus": "storage.type.annotation.java: #267F99",
+ "dark_vs": "storage.type: #569CD6",
+ "light_vs": "storage.type: #0000FF",
+ "hc_black": "storage.type.annotation.java: #4EC9B0"
+ }
+ },
+ {
+ "c": "SuppressWarnings",
"t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java storage.type.annotation.java",
"r": {
"dark_plus": "storage.type.annotation.java: #4EC9B0",
@@ -1848,8 +1859,19 @@
}
},
{
- "c": "@Test",
- "t": "source.java meta.class.java meta.class.body.java storage.type.annotation.java",
+ "c": "@",
+ "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java storage.type.annotation.java punctuation.definition.annotation.java",
+ "r": {
+ "dark_plus": "storage.type.annotation.java: #4EC9B0",
+ "light_plus": "storage.type.annotation.java: #267F99",
+ "dark_vs": "storage.type: #569CD6",
+ "light_vs": "storage.type: #0000FF",
+ "hc_black": "storage.type.annotation.java: #4EC9B0"
+ }
+ },
+ {
+ "c": "Test",
+ "t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java storage.type.annotation.java",
"r": {
"dark_plus": "storage.type.annotation.java: #4EC9B0",
"light_plus": "storage.type.annotation.java: #267F99",
diff --git a/extensions/javascript/.vscode/launch.json b/extensions/javascript/.vscode/launch.json
index 2bfe2a16420..da4bc0f01e1 100644
--- a/extensions/javascript/.vscode/launch.json
+++ b/extensions/javascript/.vscode/launch.json
@@ -7,11 +7,11 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
- "--extensionDevelopmentPath=${workspaceRoot}"
+ "--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
- "outDir": "${workspaceRoot}/out",
+ "outDir": "${workspaceFolder}/out",
"preLaunchTask": "npm"
},
{
@@ -19,10 +19,10 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
- "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
+ "args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
- "outDir": "${workspaceRoot}/out/test",
+ "outDir": "${workspaceFolder}/out/test",
"preLaunchTask": "npm"
}
]
diff --git a/extensions/javascript/.vscode/tasks.json b/extensions/javascript/.vscode/tasks.json
index a132a04214d..9e5593ade83 100644
--- a/extensions/javascript/.vscode/tasks.json
+++ b/extensions/javascript/.vscode/tasks.json
@@ -1,5 +1,5 @@
// Available variables which can be used inside of strings.
-// ${workspaceRoot}: the root folder of the team
+// ${workspaceFolder}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
diff --git a/extensions/javascript/OSSREADME.json b/extensions/javascript/OSSREADME.json
index 89a7912b239..ad083ab8743 100644
--- a/extensions/javascript/OSSREADME.json
+++ b/extensions/javascript/OSSREADME.json
@@ -3,190 +3,9 @@
[{
"name": "Microsoft/TypeScript-TmLanguage",
"version": "0.0.1",
- "license": "Apache2",
+ "license": "MIT",
"repositoryURL": "https://github.com/Microsoft/TypeScript-TmLanguage",
- "description": "The file syntaxes/JavaScript.tmLanguage.json was derived from TypeScriptReact.tmLanguage in https://github.com/Microsoft/TypeScript-TmLanguage.",
- "licenseDetail": [
- // Reason: LICENSE file does not include Copyright statement
- "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:",
- "",
- " (a) You must give any other recipients of the Work or",
- " Derivative Works a copy of this License; and",
- "",
- " (b) You must cause any modified files to carry prominent notices",
- " stating that You changed the files; and",
- "",
- " (c) 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",
- "",
- " (d) 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"
- ]
+ "description": "The file syntaxes/JavaScript.tmLanguage.json was derived from TypeScriptReact.tmLanguage in https://github.com/Microsoft/TypeScript-TmLanguage."
},
{
"name": "textmate/javascript.tmbundle",
diff --git a/extensions/javascript/javascript-language-configuration.json b/extensions/javascript/javascript-language-configuration.json
index f25940db455..1e8f440a420 100644
--- a/extensions/javascript/javascript-language-configuration.json
+++ b/extensions/javascript/javascript-language-configuration.json
@@ -24,5 +24,11 @@
["'", "'"],
["\"", "\""],
["`", "`"]
- ]
+ ],
+ "folding": {
+ "markers": {
+ "start": "^\\s*//\\s*#?region\\b",
+ "end": "^\\s*//\\s*#?endregion\\b"
+ }
+ }
}
\ No newline at end of file
diff --git a/extensions/javascript/package.json b/extensions/javascript/package.json
index b22f781c5f9..b3b68dedd5f 100644
--- a/extensions/javascript/package.json
+++ b/extensions/javascript/package.json
@@ -63,11 +63,13 @@
"grammars": [
{
"language": "javascriptreact",
- "scopeName": "source.js",
- "path": "./syntaxes/JavaScript.tmLanguage.json",
+ "scopeName": "source.js.jsx",
+ "path": "./syntaxes/JavaScriptReact.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.js": "jsx-tags",
- "meta.tag.without-attributes.js": "jsx-tags"
+ "meta.tag.without-attributes.js": "jsx-tags",
+ "meta.tag.attributes.js.jsx": "javascriptreact",
+ "meta.embedded.expression.js": "javascriptreact"
}
},
{
@@ -76,7 +78,9 @@
"path": "./syntaxes/JavaScript.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.js": "jsx-tags",
- "meta.tag.without-attributes.js": "jsx-tags"
+ "meta.tag.without-attributes.js": "jsx-tags",
+ "meta.tag.attributes.js": "javascript",
+ "meta.embedded.expression.js": "javascript"
}
},
{
@@ -91,7 +95,7 @@
},
{
"language": "javascriptreact",
- "path": "./snippets/javascriptreact.json"
+ "path": "./snippets/javascript.json"
}
],
"jsonValidation": [
@@ -130,6 +134,6 @@
]
},
"devDependencies": {
- "@types/node": "^7.0.4"
+ "@types/node": "8.0.33"
}
-}
\ No newline at end of file
+}
diff --git a/extensions/javascript/snippets/javascript.json b/extensions/javascript/snippets/javascript.json
index bdae6179418..5cbc2a0418d 100644
--- a/extensions/javascript/snippets/javascript.json
+++ b/extensions/javascript/snippets/javascript.json
@@ -15,8 +15,8 @@
"For Loop": {
"prefix": "for",
"body": [
- "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
- "\tvar ${3:element} = ${2:array}[${1:index}];",
+ "for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
+ "\tconst ${3:element} = ${2:array}[${1:index}];",
"\t$0",
"}"
],
@@ -25,24 +25,33 @@
"For-Each Loop": {
"prefix": "foreach",
"body": [
- "${1:array}.forEach(function(${2:element}) {",
+ "${1:array}.forEach(${2:element} => {",
"\t$0",
- "}, this);"
+ "});"
],
"description": "For-Each Loop"
},
"For-In Loop": {
"prefix": "forin",
"body": [
- "for (var ${1:key} in ${2:object}) {",
+ "for (const ${1:key} in ${2:object}) {",
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
- "\t\tvar ${3:element} = ${2:object}[${1:key}];",
+ "\t\tconst ${3:element} = ${2:object}[${1:key}];",
"\t\t$0",
"\t}",
"}"
],
"description": "For-In Loop"
},
+ "For-Of Loop": {
+ "prefix": "forof",
+ "body": [
+ "for (const ${1:iterator} of ${2:object}) {",
+ "\t$0",
+ "}"
+ ],
+ "description": "For-Of Loop"
+ },
"Function Statement": {
"prefix": "function",
"body": [
@@ -75,7 +84,7 @@
"New Statement": {
"prefix": "new",
"body": [
- "var ${1:name} = new ${2:type}(${3:arguments});$0"
+ "const ${1:name} = new ${2:type}(${3:arguments});$0"
],
"description": "New Statement"
},
@@ -125,17 +134,31 @@
"Set Timeout Function": {
"prefix": "settimeout",
"body": [
- "setTimeout(function() {",
+ "setTimeout(() => {",
"\t$0",
"}, ${1:timeout});"
],
"description": "Set Timeout Function"
},
- "Relative Reference to another File": {
- "prefix": "reference",
+ "Import external module.": {
+ "prefix": "import statement",
"body": [
- "/// $0"
+ "import { $0 } from \"${1:module}\";"
],
- "description": "Relative Reference to another File"
+ "description": "Import external module."
+ },
+ "Region Start": {
+ "prefix": "#region",
+ "body": [
+ "//#region $0"
+ ],
+ "description": "Folding Region Start"
+ },
+ "Region End": {
+ "prefix": "#endregion",
+ "body": [
+ "//#endregion"
+ ],
+ "description": "Folding Region End"
}
}
diff --git a/extensions/javascript/snippets/javascriptreact.json b/extensions/javascript/snippets/javascriptreact.json
deleted file mode 100644
index 0566af20e7b..00000000000
--- a/extensions/javascript/snippets/javascriptreact.json
+++ /dev/null
@@ -1,141 +0,0 @@
-{
- "define module": {
- "prefix": "define",
- "body": [
- "define([",
- "\t'require',",
- "\t'${1:dependency}'",
- "], function(require, ${2:factory}) {",
- "\t'use strict';",
- "\t$0",
- "});"
- ],
- "description": "define module"
- },
- "For Loop": {
- "prefix": "for",
- "body": [
- "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
- "\tvar ${3:element} = ${2:array}[${1:index}];",
- "\t$0",
- "}"
- ],
- "description": "For Loop"
- },
- "For-Each Loop": {
- "prefix": "foreach",
- "body": [
- "${1:array}.forEach(function(${2:element}) {",
- "\t$0",
- "}, this);"
- ],
- "description": "For-Each Loop"
- },
- "For-In Loop": {
- "prefix": "forin",
- "body": [
- "for (var ${1:key} in ${2:object}) {",
- "\tif (${2:object}.hasOwnProperty(${1:key})) {",
- "\t\tvar ${3:element} = ${2:object}[${1:key}];",
- "\t\t$0",
- "\t}",
- "}"
- ],
- "description": "For-In Loop"
- },
- "Function Statement": {
- "prefix": "function",
- "body": [
- "function ${1:name}(${2:params}) {",
- "\t$0",
- "}"
- ],
- "description": "Function Statement"
- },
- "If Statement": {
- "prefix": "if",
- "body": [
- "if (${1:condition}) {",
- "\t$0",
- "}"
- ],
- "description": "If Statement"
- },
- "If-Else Statement": {
- "prefix": "ifelse",
- "body": [
- "if (${1:condition}) {",
- "\t$0",
- "} else {",
- "\t",
- "}"
- ],
- "description": "If-Else Statement"
- },
- "New Statement": {
- "prefix": "new",
- "body": [
- "var ${1:name} = new ${2:type}(${3:arguments});$0"
- ],
- "description": "New Statement"
- },
- "Switch Statement": {
- "prefix": "switch",
- "body": [
- "switch (${1:key}) {",
- "\tcase ${2:value}:",
- "\t\t$0",
- "\t\tbreak;",
- "",
- "\tdefault:",
- "\t\tbreak;",
- "}"
- ],
- "description": "Switch Statement"
- },
- "While Statement": {
- "prefix": "while",
- "body": [
- "while (${1:condition}) {",
- "\t$0",
- "}"
- ],
- "description": "While Statement"
- },
- "Do-While Statement": {
- "prefix": "dowhile",
- "body": [
- "do {",
- "\t$0",
- "} while (${1:condition});"
- ],
- "description": "Do-While Statement"
- },
- "Try-Catch Statement": {
- "prefix": "trycatch",
- "body": [
- "try {",
- "\t$0",
- "} catch (${2:error}) {",
- "\t",
- "}"
- ],
- "description": "Try-Catch Statement"
- },
- "Set Timeout Function": {
- "prefix": "settimeout",
- "body": [
- "setTimeout(function() {",
- "\t$0",
- "}, ${1:timeout});"
- ],
- "description": "Set Timeout Function"
- },
- "Relative Reference to another File": {
- "prefix": "reference",
- "body": [
- "/// $0"
- ],
- "description": "Relative Reference to another File"
- }
-}
diff --git a/extensions/javascript/src/features/bowerJSONContribution.ts b/extensions/javascript/src/features/bowerJSONContribution.ts
index c8ecb91aeb3..a3c7b17e46d 100644
--- a/extensions/javascript/src/features/bowerJSONContribution.ts
+++ b/extensions/javascript/src/features/bowerJSONContribution.ts
@@ -30,8 +30,8 @@ export class BowerJSONContribution implements IJSONContribution {
return [{ language: 'json', pattern: '**/bower.json' }, { language: 'json', pattern: '**/.bower.json' }];
}
- public collectDefaultSuggestions(resource: string, collector: ISuggestionsCollector): Thenable {
- let defaultValue = {
+ public collectDefaultSuggestions(_resource: string, collector: ISuggestionsCollector): Thenable {
+ const defaultValue = {
'name': '${1:name}',
'description': '${2:description}',
'authors': ['${3:author}'],
@@ -39,37 +39,37 @@ export class BowerJSONContribution implements IJSONContribution {
'main': '${5:pathToMain}',
'dependencies': {}
};
- let proposal = new CompletionItem(localize('json.bower.default', 'Default bower.json'));
+ const proposal = new CompletionItem(localize('json.bower.default', 'Default bower.json'));
proposal.kind = CompletionItemKind.Class;
proposal.insertText = new SnippetString(JSON.stringify(defaultValue, null, '\t'));
collector.add(proposal);
return Promise.resolve(null);
}
- public collectPropertySuggestions(resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable {
+ public collectPropertySuggestions(_resource: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, collector: ISuggestionsCollector): Thenable | null {
if ((location.matches(['dependencies']) || location.matches(['devDependencies']))) {
if (currentWord.length > 0) {
- let queryUrl = 'https://bower.herokuapp.com/packages/search/' + encodeURIComponent(currentWord);
+ const queryUrl = 'https://bower.herokuapp.com/packages/search/' + encodeURIComponent(currentWord);
return this.xhr({
url: queryUrl
}).then((success) => {
if (success.status === 200) {
try {
- let obj = JSON.parse(success.responseText);
+ const obj = JSON.parse(success.responseText);
if (Array.isArray(obj)) {
- let results = <{ name: string; description: string; }[]>obj;
+ const results = <{ name: string; description: string; }[]>obj;
for (let i = 0; i < results.length; i++) {
- let name = results[i].name;
- let description = results[i].description || '';
- let insertText = new SnippetString().appendText(JSON.stringify(name));
+ const name = results[i].name;
+ const description = results[i].description || '';
+ const insertText = new SnippetString().appendText(JSON.stringify(name));
if (addValue) {
insertText.appendText(': ').appendPlaceholder('latest');
if (!isLast) {
insertText.appendText(',');
}
}
- let proposal = new CompletionItem(name);
+ const proposal = new CompletionItem(name);
proposal.kind = CompletionItemKind.Property;
proposal.insertText = insertText;
proposal.filterText = JSON.stringify(name);
@@ -85,13 +85,14 @@ export class BowerJSONContribution implements IJSONContribution {
collector.error(localize('json.bower.error.repoaccess', 'Request to the bower repository failed: {0}', success.responseText));
return 0;
}
+ return undefined;
}, (error) => {
collector.error(localize('json.bower.error.repoaccess', 'Request to the bower repository failed: {0}', error.responseText));
return 0;
});
} else {
this.topRanked.forEach((name) => {
- let insertText = new SnippetString().appendText(JSON.stringify(name));
+ const insertText = new SnippetString().appendText(JSON.stringify(name));
if (addValue) {
insertText.appendText(': ').appendPlaceholder('latest');
if (!isLast) {
@@ -99,7 +100,7 @@ export class BowerJSONContribution implements IJSONContribution {
}
}
- let proposal = new CompletionItem(name);
+ const proposal = new CompletionItem(name);
proposal.kind = CompletionItemKind.Property;
proposal.insertText = insertText;
proposal.filterText = JSON.stringify(name);
@@ -113,10 +114,10 @@ export class BowerJSONContribution implements IJSONContribution {
return null;
}
- public collectValueSuggestions(resource: string, location: Location, collector: ISuggestionsCollector): Thenable {
+ public collectValueSuggestions(_resource: string, location: Location, collector: ISuggestionsCollector): Thenable {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) {
// not implemented. Could be do done calling the bower command. Waiting for web API: https://github.com/bower/registry/issues/26
- let proposal = new CompletionItem(localize('json.bower.latest.version', 'latest'));
+ const proposal = new CompletionItem(localize('json.bower.latest.version', 'latest'));
proposal.insertText = new SnippetString('"${1:latest}"');
proposal.filterText = '""';
proposal.kind = CompletionItemKind.Value;
@@ -126,7 +127,7 @@ export class BowerJSONContribution implements IJSONContribution {
return Promise.resolve(null);
}
- public resolveSuggestion(item: CompletionItem): Thenable {
+ public resolveSuggestion(item: CompletionItem): Thenable