diff --git a/.github/issue_template.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 52% rename from .github/issue_template.md rename to .github/ISSUE_TEMPLATE/bug_report.md index 72e663ea733..1a324740cbd 100644 --- a/.github/issue_template.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,8 +1,10 @@ - +--- + + - VSCode Version: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..a820760fc48 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,9 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + + + + diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 00000000000..2043e48c7aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,9 @@ +--- +name: Question +about: The issue tracker is not for questions. Please ask questions on https://stackoverflow.com/questions/tagged/vscode. + +--- + +🚨 The issue tracker is not for questions 🚨 + +If you have a question, please ask it on https://stackoverflow.com/questions/tagged/vscode. diff --git a/.github/calendar.yml b/.github/calendar.yml index 3a5dad30159..d8adda455ea 100644 --- a/.github/calendar.yml +++ b/.github/calendar.yml @@ -19,4 +19,5 @@ '2018-05-08 12:00, US/Pacific': 'development', '2018-05-10 12:00, US/Pacific': 'release', # 1.23.1 '2018-05-15 12:00, US/Pacific': 'development', + '2018-05-28 18:00, US/Pacific': 'endgame', } diff --git a/.github/classifier.yml b/.github/classifier.yml index 2a39464380b..514910d63d2 100644 --- a/.github/classifier.yml +++ b/.github/classifier.yml @@ -47,7 +47,7 @@ assignLabel: false }, file-explorer: { - assignees: [ isidorn ], + assignees: [ weinand ], assignLabel: false }, format: [], diff --git a/.vscode/launch.json b/.vscode/launch.json index da7e7c092a5..4761367d036 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,7 +18,7 @@ "name": "Attach to Extension Host", "protocol": "inspector", "port": 5870, - // "restart": true, + "restart": true, "outFiles": [ "${workspaceFolder}/out/**/*.js" ] diff --git a/.vscode/settings.json b/.vscode/settings.json index 78c92075624..e8df189e775 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -41,8 +41,6 @@ "npm.exclude": "**/extensions/**", "emmet.excludeLanguages": [], "typescript.preferences.importModuleSpecifier": "non-relative", - "typescript.preferences.quoteStyle": "single", + "typescript.preferences.quoteStyle": "single" - // Self-host search in EH - "search.enableSearchProviders": true } \ No newline at end of file diff --git a/OSSREADME.json b/OSSREADME.json index eb9b02a336f..8f167afc904 100644 --- a/OSSREADME.json +++ b/OSSREADME.json @@ -1161,5 +1161,176 @@ " This Source Code Form is \"Incompatible With Secondary Licenses\", as", " defined by the Mozilla Public License, v. 2.0." ] +}, +{ + "isLicense": true, + "name": "devtools-protocol", + "licenseDetail": [ + " Copyright 2015 The Chromium Authors. All rights reserved.", + "", + " Redistribution and use in source and binary forms, with or without", + " modification, are permitted provided that the following conditions are", + " met:", + "", + " * Redistributions of source code must retain the above copyright", + " notice, this list of conditions and the following disclaimer.", + " * Redistributions in binary form must reproduce the above", + " copyright notice, this list of conditions and the following disclaimer", + " in the documentation and/or other materials provided with the", + " distribution.", + " * Neither the name of Google Inc. nor the names of its", + " contributors may be used to endorse or promote products derived from", + " this software without specific prior written permission.", + "", + " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS", + " \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT", + " LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR", + " A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT", + " OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,", + " SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT", + " LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,", + " DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY", + " THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT", + " (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE", + " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + ] +}, +{ + "isLicense": true, + "name": "buffer-alloc", + "licenseDetail": [ + "This project is licensed under the MIT license.", + "Copyrights are respective of each contributor listed at the beginning of each definition file.", + "", + "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." + ] +}, +{ + "isLicense": true, + "name": "expand-template", + "licenseDetail": [ + " DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE", + " Version 2, December 2004", + "", + " Copyright (C) 2004 Sam Hocevar ", + "", + " Everyone is permitted to copy and distribute verbatim or modified", + " copies of this license document, and changing it is allowed as long", + " as the name is changed.", + "", + " DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE", + " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION", + "", + " 0. You just DO WHAT THE FUCK YOU WANT TO." + ] +}, +{ + "isLicense": true, + "name": "tunnel-agent", + "licenseDetail": [ + "Copyright (c) tunnel-agent authors", + "", + "Apache License", + "", + "Version 2.0, January 2004", + "", + "http://www.apache.org/licenses/", + "", + "TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION", + "", + "1. Definitions.", + "", + "\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.", + "", + "\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.", + "", + "\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.", + "", + "\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.", + "", + "\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.", + "", + "\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.", + "", + "\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).", + "", + "\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.", + "", + "\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"", + "", + "\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.", + "", + "2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.", + "", + "3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.", + "", + "4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:", + "", + "You must give any other recipients of the Work or Derivative Works a copy of this License; and", + "", + "You must cause any modified files to carry prominent notices stating that You changed the files; and", + "", + "You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and", + "", + "If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.", + "", + "5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.", + "", + "6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.", + "", + "7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.", + "", + "8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.", + "", + "9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.", + "", + "END OF TERMS AND CONDITIONS" + ] +}, +{ + "isLicense": true, + "name": "noop-logger", + "licenseDetail": [ + "This project is licensed under the MIT license.", + "Copyrights are respective of each contributor listed at the beginning of each definition file.", + "", + "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." + ] +}, +{ + "isLicense": true, + "name": "buffer-alloc-unsafe", + "licenseDetail": [ + "This project is licensed under the MIT license.", + "Copyrights are respective of each contributor listed at the beginning of each definition file.", + "", + "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." + ] +}, +{ + "isLicense": true, + "name": "buffer-fill", + "licenseDetail": [ + "This project is licensed under the MIT license.", + "Copyrights are respective of each contributor listed at the beginning of each definition file.", + "", + "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." + ] } ] diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 22e2eeb13a8..b2fe9e4c585 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -18,7 +18,7 @@ This project incorporates components from the projects listed below. The origina 11. chriskempson/tomorrow-theme (https://github.com/chriskempson/tomorrow-theme) 12. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) 13. daaain/Handlebars (https://github.com/daaain/Handlebars) -14. davidrios/jade-tmbundle (https://github.com/davidrios/jade-tmbundle) +14. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle) 15. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) 16. demyte/language-cshtml (https://github.com/demyte/language-cshtml) 17. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) @@ -535,25 +535,30 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ========================================= END OF daaain/Handlebars NOTICES AND INFORMATION -%% davidrios/jade-tmbundle NOTICES AND INFORMATION BEGIN HERE +%% davidrios/pug-tmbundle NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) -Copyright (c) 2014 David Rios +Copyright (c) 2016 David Rios -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: +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 above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE +THE 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 davidrios/jade-tmbundle NOTICES AND INFORMATION +END OF davidrios/pug-tmbundle NOTICES AND INFORMATION %% definitelytyped NOTICES AND INFORMATION BEGIN HERE ========================================= diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 1e61897c5ed..e61259d8103 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -1,12 +1,12 @@ [ { "name": "ms-vscode.node-debug", - "version": "1.23.3", + "version": "1.24.0", "repo": "https://github.com/Microsoft/vscode-node-debug" }, { "name": "ms-vscode.node-debug2", - "version": "1.24.1", + "version": "1.24.2", "repo": "https://github.com/Microsoft/vscode-node-debug2" } ] diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index ce14c96c3a8..f8880c0e02b 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -104,7 +104,7 @@ const copyrightFilter = [ '!build/**/*.init', '!resources/linux/snap/snapcraft.yaml', '!resources/win32/bin/code.js', - '!extensions/markdown-language-features/media/tomorrow.css', + '!extensions/markdown-language-features/media/highlight.css', '!extensions/html-language-features/server/src/modes/typescript/*', '!extensions/*/server/bin/*' ]; diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 67c8fe08858..c53b798fed7 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -141,7 +141,7 @@ const config = { name: product.nameLong + ' document', 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"], + 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", "pug", "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"], iconFile: 'resources/darwin/code_file.icns' }], darwinBundleURLTypes: [{ diff --git a/build/lib/extensions.js b/build/lib/extensions.js index bb27bfccbef..ce74ac25ee6 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -44,6 +44,7 @@ function error(err) { var baseHeaders = { 'X-Market-Client-Id': 'VSCode Build', 'User-Agent': 'VSCode Build', + 'X-Market-User-Id': '291C1CD0-051A-4123-9B4B-30D60EF52EE2', }; function fromMarketplace(extensionName, version) { var filterType = 7; diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index 6a07fa77d69..4b05bea1979 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -49,6 +49,7 @@ function error(err: any): Stream { const baseHeaders = { 'X-Market-Client-Id': 'VSCode Build', 'User-Agent': 'VSCode Build', + 'X-Market-User-Id': '291C1CD0-051A-4123-9B4B-30D60EF52EE2', }; export function fromMarketplace(extensionName: string, version: string): Stream { diff --git a/build/lib/tslint/noStandaloneEditorRule.js b/build/lib/tslint/noStandaloneEditorRule.js new file mode 100644 index 00000000000..4bb57bbc322 --- /dev/null +++ b/build/lib/tslint/noStandaloneEditorRule.js @@ -0,0 +1,72 @@ +"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 path_1 = require("path"); +var Rule = /** @class */ (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + if (/vs(\/|\\)editor/.test(sourceFile.fileName)) { + // the vs/editor folder is allowed to use the standalone editor + return []; + } + return this.applyWithWalker(new NoStandaloneEditorRuleWalker(sourceFile, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var NoStandaloneEditorRuleWalker = /** @class */ (function (_super) { + __extends(NoStandaloneEditorRuleWalker, _super); + function NoStandaloneEditorRuleWalker(file, opts) { + return _super.call(this, file, opts) || this; + } + NoStandaloneEditorRuleWalker.prototype.visitImportEqualsDeclaration = function (node) { + if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { + this._validateImport(node.moduleReference.expression.getText(), node); + } + }; + NoStandaloneEditorRuleWalker.prototype.visitImportDeclaration = function (node) { + this._validateImport(node.moduleSpecifier.getText(), node); + }; + NoStandaloneEditorRuleWalker.prototype.visitCallExpression = function (node) { + _super.prototype.visitCallExpression.call(this, node); + // import('foo') statements inside the code + if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { + var path = node.arguments[0]; + this._validateImport(path.getText(), node); + } + }; + NoStandaloneEditorRuleWalker.prototype._validateImport = function (path, node) { + // remove quotes + path = path.slice(1, -1); + // resolve relative paths + if (path[0] === '.') { + path = path_1.join(this.getSourceFile().fileName, path); + } + if (/vs(\/|\\)editor(\/|\\)standalone/.test(path) + || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.api/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.main/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Not allowed to import standalone editor modules. See https://github.com/Microsoft/vscode/wiki/Code-Organization")); + } + }; + return NoStandaloneEditorRuleWalker; +}(Lint.RuleWalker)); diff --git a/build/lib/tslint/noStandaloneEditorRule.ts b/build/lib/tslint/noStandaloneEditorRule.ts new file mode 100644 index 00000000000..b85e2da037a --- /dev/null +++ b/build/lib/tslint/noStandaloneEditorRule.ts @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as ts from 'typescript'; +import * as Lint from 'tslint'; +import { join } from 'path'; + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + if (/vs(\/|\\)editor/.test(sourceFile.fileName)) { + // the vs/editor folder is allowed to use the standalone editor + return []; + } + return this.applyWithWalker(new NoStandaloneEditorRuleWalker(sourceFile, this.getOptions())); + } +} + +class NoStandaloneEditorRuleWalker extends Lint.RuleWalker { + + constructor(file: ts.SourceFile, opts: Lint.IOptions) { + super(file, opts); + } + + protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { + if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { + this._validateImport(node.moduleReference.expression.getText(), node); + } + } + + protected visitImportDeclaration(node: ts.ImportDeclaration): void { + this._validateImport(node.moduleSpecifier.getText(), node); + } + + protected visitCallExpression(node: ts.CallExpression): void { + super.visitCallExpression(node); + + // import('foo') statements inside the code + if (node.expression.kind === ts.SyntaxKind.ImportKeyword) { + const [path] = node.arguments; + this._validateImport(path.getText(), node); + } + } + + private _validateImport(path: string, node: ts.Node): void { + // remove quotes + path = path.slice(1, -1); + + // resolve relative paths + if (path[0] === '.') { + path = join(this.getSourceFile().fileName, path); + } + + if ( + /vs(\/|\\)editor(\/|\\)standalone/.test(path) + || /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.api/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.main/.test(path) + || /vs(\/|\\)editor(\/|\\)editor.worker/.test(path) + ) { + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Not allowed to import standalone editor modules. See https://github.com/Microsoft/vscode/wiki/Code-Organization`)); + } + } +} diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index 652c154d3d5..218d4cdf8f5 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -32,6 +32,10 @@ declare namespace monaco { Error = 3, } + export enum MarkerTag { + Unnecessary = 1, + } + export enum MarkerSeverity { Hint = 1, Info = 2, diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js index 822de7c59c2..988b7bc3795 100644 --- a/build/npm/update-grammar.js +++ b/build/npm/update-grammar.js @@ -83,7 +83,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas grammar = plist.parse(content); } else if (ext === '.cson') { grammar = cson.parse(content); - } else if (ext === '.json') { + } else if (ext === '.json' || ext === '.JSON-tmLanguage') { grammar = JSON.parse(content); } else { return Promise.reject(new Error('Unknown file extension: ' + ext)); diff --git a/build/tfs/continuous-build.yml b/build/tfs/continuous-build.yml index 6a2f594ad30..4765e3ccf6d 100644 --- a/build/tfs/continuous-build.yml +++ b/build/tfs/continuous-build.yml @@ -8,9 +8,13 @@ phases: - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 inputs: versionSpec: "1.3.2" - - powershell: | - yarn - displayName: Install Dependencies + - task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2 + displayName: Yarn + inputs: + customRegistry: useFeed + customFeed: 'd28dd4e6-8e53-406e-8887-22f7c4dffd0c' + # - task: npmAuthenticate@0 + # displayName: NPM Authenticate - powershell: | yarn gulp electron displayName: Download Electron @@ -61,9 +65,13 @@ phases: - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 inputs: versionSpec: "1.3.2" - - script: | - yarn - displayName: Install Dependencies + - task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2 + displayName: Yarn + inputs: + customRegistry: useFeed + customFeed: 'd28dd4e6-8e53-406e-8887-22f7c4dffd0c' + # - task: npmAuthenticate@0 + # displayName: NPM Authenticate - script: | yarn gulp electron-x64 displayName: Download Electron @@ -92,9 +100,13 @@ phases: - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 inputs: versionSpec: "1.3.2" - - script: | - yarn - displayName: Install Dependencies + - task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2 + displayName: Yarn + inputs: + customRegistry: useFeed + customFeed: 'd28dd4e6-8e53-406e-8887-22f7c4dffd0c' + # - task: npmAuthenticate@0 + # displayName: NPM Authenticate - script: | yarn gulp electron-x64 displayName: Download Electron diff --git a/extensions/configuration-editing/src/extension.ts b/extensions/configuration-editing/src/extension.ts index ee653a7d17f..68dbbf165b4 100644 --- a/extensions/configuration-editing/src/extension.ts +++ b/extensions/configuration-editing/src/extension.ts @@ -119,13 +119,16 @@ function registerVariableCompletions(pattern: string): vscode.Disposable { provideCompletionItems(document, position, token) { const location = getLocation(document.getText(), document.offsetAt(position)); if (!location.isAtPropertyKey && location.previousNode && location.previousNode.type === 'string') { + const indexOf$ = document.lineAt(position.line).text.indexOf('$'); + const startPosition = indexOf$ >= 0 ? new vscode.Position(position.line, indexOf$) : position; + return [{ label: 'workspaceFolder', detail: localize('workspaceFolder', "The path of the folder opened in VS Code") }, { label: 'workspaceFolderBasename', detail: localize('workspaceFolderBasename', "The name of the folder opened in VS Code without any slashes (/)") }, { label: 'relativeFile', detail: localize('relativeFile', "The current opened file relative to ${workspaceFolder}") }, { label: 'file', detail: localize('file', "The current opened file") }, { label: 'cwd', detail: localize('cwd', "The task runner's current working directory on startup") }, { label: 'lineNumber', detail: localize('lineNumber', "The current selected line number in the active file") }, { label: 'selectedText', detail: localize('selectedText', "The current selected text in the active file") }, { label: 'fileDirname', detail: localize('fileDirname', "The current opened file's dirname") }, { label: 'fileExtname', detail: localize('fileExtname', "The current opened file's extension") }, { label: 'fileBasename', detail: localize('fileBasename', "The current opened file's basename") }, { label: 'fileBasenameNoExtension', detail: localize('fileBasenameNoExtension', "The current opened file's basename with no file extension") }].map(variable => ({ label: '${' + variable.label + '}', - range: new vscode.Range(position, position), + range: new vscode.Range(startPosition, position), detail: variable.detail })); } diff --git a/extensions/csharp/syntaxes/csharp.tmLanguage.json b/extensions/csharp/syntaxes/csharp.tmLanguage.json index be97f524690..7cc5b64818d 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/925295380addea5b27f419a423c708f421347c5c", + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/2904dae001939996c6a3484eac1b95716797ac41", "name": "C#", "scopeName": "source.cs", "patterns": [ @@ -3588,7 +3588,7 @@ ] }, "lambda-parameter": { - "match": "(?x)\n(?:\\b(ref|out|in)\\b)?\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n(\\g)\\b\\s*\n(?=[,)])", + "match": "(?x)\n(?:\\b(ref|out|in)\\b)?\\s*\n(?:(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+)?\n(\\g)\\b\\s*\n(?=[,)])", "captures": { "1": { "name": "storage.modifier.cs" diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index b6662751be0..44a960237e0 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -695,9 +695,9 @@ ] }, "dependencies": { - "vscode-languageclient": "^4.0.0", - "vscode-languageserver-protocol-foldingprovider": "^2.0.0-next.2", - "vscode-nls": "^3.2.1" + "vscode-languageclient": "^4.1.4", + "vscode-languageserver-protocol-foldingprovider": "^2.0.1", + "vscode-nls": "^3.2.2" }, "devDependencies": { "@types/node": "7.0.43" diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index 2eb8e49941a..9404a08ce70 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -8,9 +8,9 @@ "node": "*" }, "dependencies": { - "vscode-css-languageservice": "^3.0.9-next.14", - "vscode-languageserver": "^4.0.0", - "vscode-languageserver-protocol-foldingprovider": "^2.0.0-next.2" + "vscode-css-languageservice": "^3.0.9-next.18", + "vscode-languageserver": "^4.1.3", + "vscode-languageserver-protocol-foldingprovider": "^2.0.1" }, "devDependencies": { "@types/mocha": "2.2.33", diff --git a/extensions/css-language-features/server/src/cssServerMain.ts b/extensions/css-language-features/server/src/cssServerMain.ts index 6f95bc28432..8778faf2b79 100644 --- a/extensions/css-language-features/server/src/cssServerMain.ts +++ b/extensions/css-language-features/server/src/cssServerMain.ts @@ -24,7 +24,7 @@ export interface Settings { } // Create a connection for the server. -let connection: IConnection = createConnection(); +const connection: IConnection = createConnection(); console.log = connection.console.log.bind(connection.console); console.error = connection.console.error.bind(connection.console); @@ -35,12 +35,12 @@ process.on('unhandledRejection', (e: any) => { // Create a simple text document manager. The text document manager // supports full document sync only -let documents: TextDocuments = new TextDocuments(); +const documents: TextDocuments = new TextDocuments(); // Make the text document manager listen on the connection // for open, change and close text document events documents.listen(connection); -let stylesheets = getLanguageModelCache(10, 60, document => getLanguageService(document).parseStylesheet(document)); +const stylesheets = getLanguageModelCache(10, 60, document => getLanguageService(document).parseStylesheet(document)); documents.onDidClose(e => { stylesheets.onDocumentRemoved(e.document); }); @@ -64,7 +64,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { } function getClientCapability(name: string, def: T) { - let keys = name.split('.'); + const keys = name.split('.'); let c: any = params.capabilities; for (let i = 0; c && i < keys.length; i++) { if (!c.hasOwnProperty(keys[i])) { @@ -74,11 +74,11 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { } return c; } - let snippetSupport = !!getClientCapability('textDocument.completion.completionItem.snippetSupport', false); + const snippetSupport = !!getClientCapability('textDocument.completion.completionItem.snippetSupport', false); scopedSettingsSupport = !!getClientCapability('workspace.configuration', false); foldingRangeLimit = getClientCapability('textDocument.foldingRange.rangeLimit', Number.MAX_VALUE); - let capabilities: ServerCapabilities & FoldingRangeServerCapabilities = { + const capabilities: ServerCapabilities & FoldingRangeServerCapabilities = { // Tell the client that the server works in FULL text document sync mode textDocumentSync: documents.syncKind, completionProvider: snippetSupport ? { resolveProvider: false, triggerCharacters: ['/'] } : undefined, @@ -95,7 +95,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { return { capabilities }; }); -let languageServices: { [id: string]: LanguageService } = { +const languageServices: { [id: string]: LanguageService } = { css: getCSSLanguageService(), scss: getSCSSLanguageService(), less: getLESSLanguageService() @@ -119,7 +119,7 @@ function getDocumentSettings(textDocument: TextDocument): Thenable s[0]); documentSettings[textDocument.uri] = promise; } @@ -134,7 +134,7 @@ connection.onDidChangeConfiguration(change => { }); function updateConfiguration(settings: Settings) { - for (let languageId in languageServices) { + for (const languageId in languageServices) { languageServices[languageId].configure((settings as any)[languageId]); } // reset all document settings @@ -143,7 +143,7 @@ function updateConfiguration(settings: Settings) { documents.all().forEach(triggerValidation); } -let pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {}; +const pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {}; const validationDelayMs = 500; // The content of a text document has changed. This event is emitted @@ -159,7 +159,7 @@ documents.onDidClose(event => { }); function cleanPendingValidation(textDocument: TextDocument): void { - let request = pendingValidationRequests[textDocument.uri]; + const request = pendingValidationRequests[textDocument.uri]; if (request) { clearTimeout(request); delete pendingValidationRequests[textDocument.uri]; @@ -175,10 +175,10 @@ function triggerValidation(textDocument: TextDocument): void { } function validateTextDocument(textDocument: TextDocument): void { - let settingsPromise = getDocumentSettings(textDocument); + const settingsPromise = getDocumentSettings(textDocument); settingsPromise.then(settings => { - let stylesheet = stylesheets.get(textDocument); - let diagnostics = getLanguageService(textDocument).doValidation(textDocument, stylesheet, settings); + const stylesheet = stylesheets.get(textDocument); + const diagnostics = getLanguageService(textDocument).doValidation(textDocument, stylesheet, settings); // Send the computed diagnostics to VSCode. connection.sendDiagnostics({ uri: textDocument.uri, diagnostics }); }, e => { @@ -188,14 +188,17 @@ function validateTextDocument(textDocument: TextDocument): void { connection.onCompletion((textDocumentPosition, token) => { return runSafe(() => { - let document = documents.get(textDocumentPosition.textDocument.uri); + const document = documents.get(textDocumentPosition.textDocument.uri); + if (!document) { + return null; + } const cssLS = getLanguageService(document); const pathCompletionList: CompletionList = { isIncomplete: false, items: [] }; cssLS.setCompletionParticipants([getPathCompletionParticipant(document, workspaceFolders, pathCompletionList)]); - const result = cssLS.doComplete(document, textDocumentPosition.position, stylesheets.get(document))!; /* TODO: remove ! once LS has null annotations */ + const result = cssLS.doComplete(document, textDocumentPosition.position, stylesheets.get(document)); return { isIncomplete: pathCompletionList.isIncomplete, items: [...pathCompletionList.items, ...result.items] @@ -205,57 +208,76 @@ connection.onCompletion((textDocumentPosition, token) => { connection.onHover((textDocumentPosition, token) => { return runSafe(() => { - let document = documents.get(textDocumentPosition.textDocument.uri); - let styleSheet = stylesheets.get(document); - return getLanguageService(document).doHover(document, textDocumentPosition.position, styleSheet); + const document = documents.get(textDocumentPosition.textDocument.uri); + if (document) { + const styleSheet = stylesheets.get(document); + return getLanguageService(document).doHover(document, textDocumentPosition.position, styleSheet); + } + return null; }, null, `Error while computing hover for ${textDocumentPosition.textDocument.uri}`, token); }); connection.onDocumentSymbol((documentSymbolParams, token) => { return runSafe(() => { - let document = documents.get(documentSymbolParams.textDocument.uri); - let stylesheet = stylesheets.get(document); - return getLanguageService(document).findDocumentSymbols(document, stylesheet); + const document = documents.get(documentSymbolParams.textDocument.uri); + if (document) { + const stylesheet = stylesheets.get(document); + return getLanguageService(document).findDocumentSymbols(document, stylesheet); + } + return []; }, [], `Error while computing document symbols for ${documentSymbolParams.textDocument.uri}`, token); }); connection.onDefinition((documentSymbolParams, token) => { return runSafe(() => { - let document = documents.get(documentSymbolParams.textDocument.uri); - let stylesheet = stylesheets.get(document); - return getLanguageService(document).findDefinition(document, documentSymbolParams.position, stylesheet); + const document = documents.get(documentSymbolParams.textDocument.uri); + if (document) { + + const stylesheet = stylesheets.get(document); + return getLanguageService(document).findDefinition(document, documentSymbolParams.position, stylesheet); + } + return null; }, null, `Error while computing definitions for ${documentSymbolParams.textDocument.uri}`, token); }); connection.onDocumentHighlight((documentSymbolParams, token) => { return runSafe(() => { - let document = documents.get(documentSymbolParams.textDocument.uri); - let stylesheet = stylesheets.get(document); - return getLanguageService(document).findDocumentHighlights(document, documentSymbolParams.position, stylesheet); + const document = documents.get(documentSymbolParams.textDocument.uri); + if (document) { + const stylesheet = stylesheets.get(document); + return getLanguageService(document).findDocumentHighlights(document, documentSymbolParams.position, stylesheet); + } + return []; }, [], `Error while computing document highlights for ${documentSymbolParams.textDocument.uri}`, token); }); connection.onReferences((referenceParams, token) => { return runSafe(() => { - let document = documents.get(referenceParams.textDocument.uri); - let stylesheet = stylesheets.get(document); - return getLanguageService(document).findReferences(document, referenceParams.position, stylesheet); + const document = documents.get(referenceParams.textDocument.uri); + if (document) { + const stylesheet = stylesheets.get(document); + return getLanguageService(document).findReferences(document, referenceParams.position, stylesheet); + } + return []; }, [], `Error while computing references for ${referenceParams.textDocument.uri}`, token); }); connection.onCodeAction((codeActionParams, token) => { return runSafe(() => { - let document = documents.get(codeActionParams.textDocument.uri); - let stylesheet = stylesheets.get(document); - return getLanguageService(document).doCodeActions(document, codeActionParams.range, codeActionParams.context, stylesheet); + const document = documents.get(codeActionParams.textDocument.uri); + if (document) { + const stylesheet = stylesheets.get(document); + return getLanguageService(document).doCodeActions(document, codeActionParams.range, codeActionParams.context, stylesheet); + } + return []; }, [], `Error while computing code actions for ${codeActionParams.textDocument.uri}`, token); }); connection.onDocumentColor((params, token) => { return runSafe(() => { - let document = documents.get(params.textDocument.uri); + const document = documents.get(params.textDocument.uri); if (document) { - let stylesheet = stylesheets.get(document); + const stylesheet = stylesheets.get(document); return getLanguageService(document).findDocumentColors(document, stylesheet); } return []; @@ -264,9 +286,9 @@ connection.onDocumentColor((params, token) => { connection.onColorPresentation((params, token) => { return runSafe(() => { - let document = documents.get(params.textDocument.uri); + const document = documents.get(params.textDocument.uri); if (document) { - let stylesheet = stylesheets.get(document); + const stylesheet = stylesheets.get(document); return getLanguageService(document).getColorPresentations(document, stylesheet, params.color, params.range); } return []; @@ -275,16 +297,22 @@ connection.onColorPresentation((params, token) => { connection.onRenameRequest((renameParameters, token) => { return runSafe(() => { - let document = documents.get(renameParameters.textDocument.uri); - let stylesheet = stylesheets.get(document); - return getLanguageService(document).doRename(document, renameParameters.position, renameParameters.newName, stylesheet); + const document = documents.get(renameParameters.textDocument.uri); + if (document) { + const stylesheet = stylesheets.get(document); + return getLanguageService(document).doRename(document, renameParameters.position, renameParameters.newName, stylesheet); + } + return null; }, null, `Error while computing renames for ${renameParameters.textDocument.uri}`, token); }); connection.onRequest(FoldingRangeRequest.type, (params, token) => { return runSafe(() => { - let document = documents.get(params.textDocument.uri); - return getLanguageService(document).getFoldingRanges(document, { rangeLimit: foldingRangeLimit }); + const document = documents.get(params.textDocument.uri); + if (document) { + return getLanguageService(document).getFoldingRanges(document, { rangeLimit: foldingRangeLimit }); + } + return null; }, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token); }); diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index 9ab19c4c0ac..f9b1f5c6468 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -10,43 +10,43 @@ version "7.0.43" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c" -vscode-css-languageservice@^3.0.9-next.14: - version "3.0.9-next.14" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.9-next.14.tgz#156822b2d8c56487ffd47105cc884fa3983664ca" +vscode-css-languageservice@^3.0.9-next.18: + version "3.0.9-next.18" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.9-next.18.tgz#f8f25123b5a8cdc9f72fafcd2c0088f726322437" dependencies: - vscode-languageserver-types "^3.6.1" - vscode-nls "^3.2.1" + vscode-languageserver-types "^3.7.2" + vscode-nls "^3.2.2" -vscode-jsonrpc@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.0.tgz#848d56995d5168950d84feb5d9c237ae5c6a02d4" +vscode-jsonrpc@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.2.tgz#3b5eef691159a15556ecc500e9a8a0dd143470c8" -vscode-languageserver-protocol-foldingprovider@^2.0.0-next.2: - version "2.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol-foldingprovider/-/vscode-languageserver-protocol-foldingprovider-2.0.0-next.2.tgz#fbb9cfdf5b8c4ac451826ba6312f1f88379f35b0" +vscode-languageserver-protocol-foldingprovider@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol-foldingprovider/-/vscode-languageserver-protocol-foldingprovider-2.0.1.tgz#051d0d9e58d1b79dc4681acd48f21797f5515bfd" dependencies: - vscode-languageserver-protocol "^3.6.0" - vscode-languageserver-types "^3.6.0" + vscode-languageserver-protocol "^3.7.2" + vscode-languageserver-types "^3.7.2" -vscode-languageserver-protocol@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.6.0.tgz#579642cdcccf74b0cd771c33daa3239acb40d040" +vscode-languageserver-protocol@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.7.2.tgz#df58621c032139010888b6a9ddc969423f9ba9d6" dependencies: - vscode-jsonrpc "^3.6.0" - vscode-languageserver-types "^3.6.0" + vscode-jsonrpc "^3.6.2" + vscode-languageserver-types "^3.7.2" -vscode-languageserver-types@^3.6.0, vscode-languageserver-types@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.1.tgz#4bc06a48dff653495f12f94b8b1e228988a1748d" +vscode-languageserver-types@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.7.2.tgz#aad8846f8e3e27962648554de5a8417e358f34eb" -vscode-languageserver@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-4.0.0.tgz#8b792f0d6d10acfe363d02371ed4ce53d08af88a" +vscode-languageserver@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-4.1.3.tgz#937d37c955b6b9c2409388413cd6f54d1eb9fe7d" dependencies: - vscode-languageserver-protocol "^3.6.0" + vscode-languageserver-protocol "^3.7.2" vscode-uri "^1.0.1" -vscode-nls@^3.2.1: +vscode-nls@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.2.tgz#3817eca5b985c2393de325197cf4e15eb2aa5350" diff --git a/extensions/css-language-features/yarn.lock b/extensions/css-language-features/yarn.lock index 37c6473e3aa..98f6af48a34 100644 --- a/extensions/css-language-features/yarn.lock +++ b/extensions/css-language-features/yarn.lock @@ -6,34 +6,34 @@ version "7.0.43" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c" -vscode-jsonrpc@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.0.tgz#848d56995d5168950d84feb5d9c237ae5c6a02d4" +vscode-jsonrpc@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.2.tgz#3b5eef691159a15556ecc500e9a8a0dd143470c8" -vscode-languageclient@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-4.0.0.tgz#635f5bfbcfa1385dae489b394857f1db8b459a7d" +vscode-languageclient@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-4.1.4.tgz#fff1a6bca4714835dca7fce35bc4ce81442fdf2c" dependencies: - vscode-languageserver-protocol "^3.6.0" + vscode-languageserver-protocol "^3.7.2" -vscode-languageserver-protocol-foldingprovider@^2.0.0-next.2: - version "2.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol-foldingprovider/-/vscode-languageserver-protocol-foldingprovider-2.0.0-next.2.tgz#fbb9cfdf5b8c4ac451826ba6312f1f88379f35b0" +vscode-languageserver-protocol-foldingprovider@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol-foldingprovider/-/vscode-languageserver-protocol-foldingprovider-2.0.1.tgz#051d0d9e58d1b79dc4681acd48f21797f5515bfd" dependencies: - vscode-languageserver-protocol "^3.6.0" - vscode-languageserver-types "^3.6.0" + vscode-languageserver-protocol "^3.7.2" + vscode-languageserver-types "^3.7.2" -vscode-languageserver-protocol@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.6.0.tgz#579642cdcccf74b0cd771c33daa3239acb40d040" +vscode-languageserver-protocol@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.7.2.tgz#df58621c032139010888b6a9ddc969423f9ba9d6" dependencies: - vscode-jsonrpc "^3.6.0" - vscode-languageserver-types "^3.6.0" + vscode-jsonrpc "^3.6.2" + vscode-languageserver-types "^3.7.2" -vscode-languageserver-types@^3.6.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.1.tgz#4bc06a48dff653495f12f94b8b1e228988a1748d" +vscode-languageserver-types@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.7.2.tgz#aad8846f8e3e27962648554de5a8417e358f34eb" -vscode-nls@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51" +vscode-nls@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.2.tgz#3817eca5b985c2393de325197cf4e15eb2aa5350" diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts index e75860293ad..ba03a4bcac4 100644 --- a/extensions/emmet/src/abbreviationActions.ts +++ b/extensions/emmet/src/abbreviationActions.ts @@ -8,7 +8,7 @@ import { Node, HtmlNode, Rule, Property, Stylesheet } from 'EmmetNode'; import { getEmmetHelper, getNode, getInnerRange, getMappingForIncludedLanguages, parseDocument, validate, getEmmetConfiguration, isStyleSheet, getEmmetMode, parsePartialStylesheet, isStyleAttribute, getEmbeddedCssNodeIfAny } from './util'; const trimRegex = /[\u00a0]*[\d|#|\-|\*|\u2022]+\.?/; -const hexColorRegex = /^#\d+$/; +const hexColorRegex = /^#[\d,a-f,A-F]{0,6}$/; const allowedMimeTypesInScriptTag = ['text/html', 'text/plain', 'text/x-template', 'text/template']; const inlineElements = ['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', @@ -402,6 +402,9 @@ export function isValidLocationForEmmetAbbreviation(document: vscode.TextDocumen && abbreviation.indexOf(':') === -1) { return hexColorRegex.test(abbreviation) || abbreviation === '!'; } + if (hexColorRegex.test(abbreviation) || abbreviation === '!') { + return false; + } } // If current node is a rule or at-rule, then perform additional checks to ensure diff --git a/extensions/emmet/src/balance.ts b/extensions/emmet/src/balance.ts index 2d4917994ae..109a82b6150 100644 --- a/extensions/emmet/src/balance.ts +++ b/extensions/emmet/src/balance.ts @@ -7,6 +7,10 @@ import * as vscode from 'vscode'; import { HtmlNode } from 'EmmetNode'; import { getNode, parseDocument, validate } from './util'; +let balanceOutStack: Array = []; +let lastOut = false; +let lastBalancedSelections: vscode.Selection[] = []; + export function balanceOut() { balance(true); } @@ -32,8 +36,28 @@ function balance(out: boolean) { newSelections.push(range); }); - editor.selection = newSelections[0]; - editor.selections = newSelections; + if (areSameSelections(newSelections, editor.selections)) { + return; + } + + if (areSameSelections(lastBalancedSelections, editor.selections)) { + if (out) { + if (!balanceOutStack.length) { + balanceOutStack.push(editor.selections); + } + balanceOutStack.push(newSelections); + } else { + if (lastOut) { + balanceOutStack.pop(); + } + newSelections = balanceOutStack.pop() || newSelections; + } + } else { + balanceOutStack = out ? [editor.selections, newSelections] : []; + } + + lastOut = out; + lastBalancedSelections = editor.selections = newSelections; } function getRangeToBalanceOut(document: vscode.TextDocument, selection: vscode.Selection, rootNode: HtmlNode): vscode.Selection { @@ -83,3 +107,14 @@ function getRangeToBalanceIn(document: vscode.TextDocument, selection: vscode.Se } +function areSameSelections(a: vscode.Selection[], b: vscode.Selection[]): boolean { + if (a.length !== b.length) { + return false; + } + for (let i = 0; i < a.length; i++) { + if (!a[i].isEqual(b[i])) { + return false; + } + } + return true; +} \ No newline at end of file diff --git a/extensions/emmet/src/test/cssAbbreviationAction.test.ts b/extensions/emmet/src/test/cssAbbreviationAction.test.ts index 733d325aa62..88e993cff9c 100644 --- a/extensions/emmet/src/test/cssAbbreviationAction.test.ts +++ b/extensions/emmet/src/test/cssAbbreviationAction.test.ts @@ -310,6 +310,28 @@ nav# }); }); + test('# shouldnt expand to hex color when in selector (CSS)', () => { + const testContent = ` +.foo { + # +} + `; + + return withRandomFileEditor(testContent, 'css', (editor, doc) => { + editor.selection = new Selection(2, 2, 2, 2); + return expandEmmetAbbreviation(null).then(() => { + assert.equal(editor.document.getText(), testContent); + const cancelSrc = new CancellationTokenSource(); + const completionPromise = completionProvider.provideCompletionItems(editor.document, new Position(2, 2), cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); + if (completionPromise) { + assert.equal(1, 2, `Invalid completion of hex color at property name`); + } + return Promise.resolve(); + }); + }); + }); + + test('Expand abbreviation in completion list (CSS)', () => { const abbreviation = 'pos:f'; const expandedText = 'position: fixed;'; diff --git a/extensions/emmet/src/test/editPointSelectItemBalance.test.ts b/extensions/emmet/src/test/editPointSelectItemBalance.test.ts index 3393fdddc24..61fe36ea4ee 100644 --- a/extensions/emmet/src/test/editPointSelectItemBalance.test.ts +++ b/extensions/emmet/src/test/editPointSelectItemBalance.test.ts @@ -211,6 +211,35 @@ suite('Tests for Next/Previous Select/Edit point and Balance actions', () => { }); }); + test('Emmet Balance In using the same stack as Balance out in html file', function (): any { + return withRandomFileEditor(htmlContents, 'html', (editor, doc) => { + + editor.selections = [new Selection(15, 6, 15, 10)]; + let expectedBalanceOutRanges: [number, number, number, number][] = [ + [15, 3, 15, 32], //
  • Item 2
  • + [13, 23, 16, 2], // inner contents of