mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
9
.gitattributes
vendored
Normal file
9
.gitattributes
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
* text=auto
|
||||||
|
|
||||||
|
LICENSE.txt eol=crlf
|
||||||
|
ThirdPartyNotices.txt eol=crlf
|
||||||
|
|
||||||
|
*.bat eol=crlf
|
||||||
|
*.cmd eol=crlf
|
||||||
|
*.ps1 eol=lf
|
||||||
|
*.sh eol=lf
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ node_modules/
|
|||||||
out/
|
out/
|
||||||
out-build/
|
out-build/
|
||||||
out-editor/
|
out-editor/
|
||||||
|
out-editor-esm/
|
||||||
out-editor-min/
|
out-editor-min/
|
||||||
out-monaco-editor-core/
|
out-monaco-editor-core/
|
||||||
out-vscode/
|
out-vscode/
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ addons:
|
|||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- git submodule update --init --recursive
|
- git submodule update --init --recursive
|
||||||
- git clone --depth 1 https://github.com/creationix/nvm.git ./.nvm
|
|
||||||
- source ./.nvm/nvm.sh
|
|
||||||
- nvm install 8.9.1
|
- nvm install 8.9.1
|
||||||
- nvm use 8.9.1
|
- nvm use 8.9.1
|
||||||
- npm i -g yarn
|
- npm i -g yarn
|
||||||
|
|||||||
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
// See https://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
// for the documentation about the extensions.json format
|
// for the documentation about the extensions.json format
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"eg2.tslint",
|
"eg2.tslint",
|
||||||
|
|||||||
384
OSSREADME.json
384
OSSREADME.json
@@ -808,5 +808,389 @@
|
|||||||
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
|
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
|
||||||
"SOFTWARE"
|
"SOFTWARE"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mdn-data",
|
||||||
|
"version": "1.1.12",
|
||||||
|
"repositoryURL": "https://github.com/mdn/data",
|
||||||
|
"license": "MPL",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Mozilla Public License Version 2.0",
|
||||||
|
"",
|
||||||
|
"Copyright (c) 2018 Mozilla Corporation",
|
||||||
|
"",
|
||||||
|
"==================================",
|
||||||
|
"",
|
||||||
|
"1. Definitions",
|
||||||
|
"--------------",
|
||||||
|
"",
|
||||||
|
"1.1. \"Contributor\"",
|
||||||
|
" means each individual or legal entity that creates, contributes to",
|
||||||
|
" the creation of, or owns Covered Software.",
|
||||||
|
"",
|
||||||
|
"1.2. \"Contributor Version\"",
|
||||||
|
" means the combination of the Contributions of others (if any) used",
|
||||||
|
" by a Contributor and that particular Contributor's Contribution.",
|
||||||
|
"",
|
||||||
|
"1.3. \"Contribution\"",
|
||||||
|
" means Covered Software of a particular Contributor.",
|
||||||
|
"",
|
||||||
|
"1.4. \"Covered Software\"",
|
||||||
|
" means Source Code Form to which the initial Contributor has attached",
|
||||||
|
" the notice in Exhibit A, the Executable Form of such Source Code",
|
||||||
|
" Form, and Modifications of such Source Code Form, in each case",
|
||||||
|
" including portions thereof.",
|
||||||
|
"",
|
||||||
|
"1.5. \"Incompatible With Secondary Licenses\"",
|
||||||
|
" means",
|
||||||
|
"",
|
||||||
|
" (a) that the initial Contributor has attached the notice described",
|
||||||
|
" in Exhibit B to the Covered Software; or",
|
||||||
|
"",
|
||||||
|
" (b) that the Covered Software was made available under the terms of",
|
||||||
|
" version 1.1 or earlier of the License, but not also under the",
|
||||||
|
" terms of a Secondary License.",
|
||||||
|
"",
|
||||||
|
"1.6. \"Executable Form\"",
|
||||||
|
" means any form of the work other than Source Code Form.",
|
||||||
|
"",
|
||||||
|
"1.7. \"Larger Work\"",
|
||||||
|
" means a work that combines Covered Software with other material, in",
|
||||||
|
" a separate file or files, that is not Covered Software.",
|
||||||
|
"",
|
||||||
|
"1.8. \"License\"",
|
||||||
|
" means this document.",
|
||||||
|
"",
|
||||||
|
"1.9. \"Licensable\"",
|
||||||
|
" means having the right to grant, to the maximum extent possible,",
|
||||||
|
" whether at the time of the initial grant or subsequently, any and",
|
||||||
|
" all of the rights conveyed by this License.",
|
||||||
|
"",
|
||||||
|
"1.10. \"Modifications\"",
|
||||||
|
" means any of the following:",
|
||||||
|
"",
|
||||||
|
" (a) any file in Source Code Form that results from an addition to,",
|
||||||
|
" deletion from, or modification of the contents of Covered",
|
||||||
|
" Software; or",
|
||||||
|
"",
|
||||||
|
" (b) any new file in Source Code Form that contains any Covered",
|
||||||
|
" Software.",
|
||||||
|
"",
|
||||||
|
"1.11. \"Patent Claims\" of a Contributor",
|
||||||
|
" means any patent claim(s), including without limitation, method,",
|
||||||
|
" process, and apparatus claims, in any patent Licensable by such",
|
||||||
|
" Contributor that would be infringed, but for the grant of the",
|
||||||
|
" License, by the making, using, selling, offering for sale, having",
|
||||||
|
" made, import, or transfer of either its Contributions or its",
|
||||||
|
" Contributor Version.",
|
||||||
|
"",
|
||||||
|
"1.12. \"Secondary License\"",
|
||||||
|
" means either the GNU General Public License, Version 2.0, the GNU",
|
||||||
|
" Lesser General Public License, Version 2.1, the GNU Affero General",
|
||||||
|
" Public License, Version 3.0, or any later versions of those",
|
||||||
|
" licenses.",
|
||||||
|
"",
|
||||||
|
"1.13. \"Source Code Form\"",
|
||||||
|
" means the form of the work preferred for making modifications.",
|
||||||
|
"",
|
||||||
|
"1.14. \"You\" (or \"Your\")",
|
||||||
|
" means an individual or a legal entity exercising rights under this",
|
||||||
|
" License. For legal entities, \"You\" includes any entity that",
|
||||||
|
" controls, is controlled by, or is under common control with You. For",
|
||||||
|
" purposes of this definition, \"control\" means (a) the power, direct",
|
||||||
|
" or indirect, to cause the direction or management of such entity,",
|
||||||
|
" whether by contract or otherwise, or (b) ownership of more than",
|
||||||
|
" fifty percent (50%) of the outstanding shares or beneficial",
|
||||||
|
" ownership of such entity.",
|
||||||
|
"",
|
||||||
|
"2. License Grants and Conditions",
|
||||||
|
"--------------------------------",
|
||||||
|
"",
|
||||||
|
"2.1. Grants",
|
||||||
|
"",
|
||||||
|
"Each Contributor hereby grants You a world-wide, royalty-free,",
|
||||||
|
"non-exclusive license:",
|
||||||
|
"",
|
||||||
|
"(a) under intellectual property rights (other than patent or trademark)",
|
||||||
|
" Licensable by such Contributor to use, reproduce, make available,",
|
||||||
|
" modify, display, perform, distribute, and otherwise exploit its",
|
||||||
|
" Contributions, either on an unmodified basis, with Modifications, or",
|
||||||
|
" as part of a Larger Work; and",
|
||||||
|
"",
|
||||||
|
"(b) under Patent Claims of such Contributor to make, use, sell, offer",
|
||||||
|
" for sale, have made, import, and otherwise transfer either its",
|
||||||
|
" Contributions or its Contributor Version.",
|
||||||
|
"",
|
||||||
|
"2.2. Effective Date",
|
||||||
|
"",
|
||||||
|
"The licenses granted in Section 2.1 with respect to any Contribution",
|
||||||
|
"become effective for each Contribution on the date the Contributor first",
|
||||||
|
"distributes such Contribution.",
|
||||||
|
"",
|
||||||
|
"2.3. Limitations on Grant Scope",
|
||||||
|
"",
|
||||||
|
"The licenses granted in this Section 2 are the only rights granted under",
|
||||||
|
"this License. No additional rights or licenses will be implied from the",
|
||||||
|
"distribution or licensing of Covered Software under this License.",
|
||||||
|
"Notwithstanding Section 2.1(b) above, no patent license is granted by a",
|
||||||
|
"Contributor:",
|
||||||
|
"",
|
||||||
|
"(a) for any code that a Contributor has removed from Covered Software;",
|
||||||
|
" or",
|
||||||
|
"",
|
||||||
|
"(b) for infringements caused by: (i) Your and any other third party's",
|
||||||
|
" modifications of Covered Software, or (ii) the combination of its",
|
||||||
|
" Contributions with other software (except as part of its Contributor",
|
||||||
|
" Version); or",
|
||||||
|
"",
|
||||||
|
"(c) under Patent Claims infringed by Covered Software in the absence of",
|
||||||
|
" its Contributions.",
|
||||||
|
"",
|
||||||
|
"This License does not grant any rights in the trademarks, service marks,",
|
||||||
|
"or logos of any Contributor (except as may be necessary to comply with",
|
||||||
|
"the notice requirements in Section 3.4).",
|
||||||
|
"",
|
||||||
|
"2.4. Subsequent Licenses",
|
||||||
|
"",
|
||||||
|
"No Contributor makes additional grants as a result of Your choice to",
|
||||||
|
"distribute the Covered Software under a subsequent version of this",
|
||||||
|
"License (see Section 10.2) or under the terms of a Secondary License (if",
|
||||||
|
"permitted under the terms of Section 3.3).",
|
||||||
|
"",
|
||||||
|
"2.5. Representation",
|
||||||
|
"",
|
||||||
|
"Each Contributor represents that the Contributor believes its",
|
||||||
|
"Contributions are its original creation(s) or it has sufficient rights",
|
||||||
|
"to grant the rights to its Contributions conveyed by this License.",
|
||||||
|
"",
|
||||||
|
"2.6. Fair Use",
|
||||||
|
"",
|
||||||
|
"This License is not intended to limit any rights You have under",
|
||||||
|
"applicable copyright doctrines of fair use, fair dealing, or other",
|
||||||
|
"equivalents.",
|
||||||
|
"",
|
||||||
|
"2.7. Conditions",
|
||||||
|
"",
|
||||||
|
"Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted",
|
||||||
|
"in Section 2.1.",
|
||||||
|
"",
|
||||||
|
"3. Responsibilities",
|
||||||
|
"-------------------",
|
||||||
|
"",
|
||||||
|
"3.1. Distribution of Source Form",
|
||||||
|
"",
|
||||||
|
"All distribution of Covered Software in Source Code Form, including any",
|
||||||
|
"Modifications that You create or to which You contribute, must be under",
|
||||||
|
"the terms of this License. You must inform recipients that the Source",
|
||||||
|
"Code Form of the Covered Software is governed by the terms of this",
|
||||||
|
"License, and how they can obtain a copy of this License. You may not",
|
||||||
|
"attempt to alter or restrict the recipients' rights in the Source Code",
|
||||||
|
"Form.",
|
||||||
|
"",
|
||||||
|
"3.2. Distribution of Executable Form",
|
||||||
|
"",
|
||||||
|
"If You distribute Covered Software in Executable Form then:",
|
||||||
|
"",
|
||||||
|
"(a) such Covered Software must also be made available in Source Code",
|
||||||
|
" Form, as described in Section 3.1, and You must inform recipients of",
|
||||||
|
" the Executable Form how they can obtain a copy of such Source Code",
|
||||||
|
" Form by reasonable means in a timely manner, at a charge no more",
|
||||||
|
" than the cost of distribution to the recipient; and",
|
||||||
|
"",
|
||||||
|
"(b) You may distribute such Executable Form under the terms of this",
|
||||||
|
" License, or sublicense it under different terms, provided that the",
|
||||||
|
" license for the Executable Form does not attempt to limit or alter",
|
||||||
|
" the recipients' rights in the Source Code Form under this License.",
|
||||||
|
"",
|
||||||
|
"3.3. Distribution of a Larger Work",
|
||||||
|
"",
|
||||||
|
"You may create and distribute a Larger Work under terms of Your choice,",
|
||||||
|
"provided that You also comply with the requirements of this License for",
|
||||||
|
"the Covered Software. If the Larger Work is a combination of Covered",
|
||||||
|
"Software with a work governed by one or more Secondary Licenses, and the",
|
||||||
|
"Covered Software is not Incompatible With Secondary Licenses, this",
|
||||||
|
"License permits You to additionally distribute such Covered Software",
|
||||||
|
"under the terms of such Secondary License(s), so that the recipient of",
|
||||||
|
"the Larger Work may, at their option, further distribute the Covered",
|
||||||
|
"Software under the terms of either this License or such Secondary",
|
||||||
|
"License(s).",
|
||||||
|
"",
|
||||||
|
"3.4. Notices",
|
||||||
|
"",
|
||||||
|
"You may not remove or alter the substance of any license notices",
|
||||||
|
"(including copyright notices, patent notices, disclaimers of warranty,",
|
||||||
|
"or limitations of liability) contained within the Source Code Form of",
|
||||||
|
"the Covered Software, except that You may alter any license notices to",
|
||||||
|
"the extent required to remedy known factual inaccuracies.",
|
||||||
|
"",
|
||||||
|
"3.5. Application of Additional Terms",
|
||||||
|
"",
|
||||||
|
"You may choose to offer, and to charge a fee for, warranty, support,",
|
||||||
|
"indemnity or liability obligations to one or more recipients of Covered",
|
||||||
|
"Software. However, You may do so only on Your own behalf, and not on",
|
||||||
|
"behalf of any Contributor. You must make it absolutely clear that any",
|
||||||
|
"such warranty, support, indemnity, or liability obligation is offered by",
|
||||||
|
"You alone, and You hereby agree to indemnify every Contributor for any",
|
||||||
|
"liability incurred by such Contributor as a result of warranty, support,",
|
||||||
|
"indemnity or liability terms You offer. You may include additional",
|
||||||
|
"disclaimers of warranty and limitations of liability specific to any",
|
||||||
|
"jurisdiction.",
|
||||||
|
"",
|
||||||
|
"4. Inability to Comply Due to Statute or Regulation",
|
||||||
|
"---------------------------------------------------",
|
||||||
|
"",
|
||||||
|
"If it is impossible for You to comply with any of the terms of this",
|
||||||
|
"License with respect to some or all of the Covered Software due to",
|
||||||
|
"statute, judicial order, or regulation then You must: (a) comply with",
|
||||||
|
"the terms of this License to the maximum extent possible; and (b)",
|
||||||
|
"describe the limitations and the code they affect. Such description must",
|
||||||
|
"be placed in a text file included with all distributions of the Covered",
|
||||||
|
"Software under this License. Except to the extent prohibited by statute",
|
||||||
|
"or regulation, such description must be sufficiently detailed for a",
|
||||||
|
"recipient of ordinary skill to be able to understand it.",
|
||||||
|
"",
|
||||||
|
"5. Termination",
|
||||||
|
"--------------",
|
||||||
|
"",
|
||||||
|
"5.1. The rights granted under this License will terminate automatically",
|
||||||
|
"if You fail to comply with any of its terms. However, if You become",
|
||||||
|
"compliant, then the rights granted under this License from a particular",
|
||||||
|
"Contributor are reinstated (a) provisionally, unless and until such",
|
||||||
|
"Contributor explicitly and finally terminates Your grants, and (b) on an",
|
||||||
|
"ongoing basis, if such Contributor fails to notify You of the",
|
||||||
|
"non-compliance by some reasonable means prior to 60 days after You have",
|
||||||
|
"come back into compliance. Moreover, Your grants from a particular",
|
||||||
|
"Contributor are reinstated on an ongoing basis if such Contributor",
|
||||||
|
"notifies You of the non-compliance by some reasonable means, this is the",
|
||||||
|
"first time You have received notice of non-compliance with this License",
|
||||||
|
"from such Contributor, and You become compliant prior to 30 days after",
|
||||||
|
"Your receipt of the notice.",
|
||||||
|
"",
|
||||||
|
"5.2. If You initiate litigation against any entity by asserting a patent",
|
||||||
|
"infringement claim (excluding declaratory judgment actions,",
|
||||||
|
"counter-claims, and cross-claims) alleging that a Contributor Version",
|
||||||
|
"directly or indirectly infringes any patent, then the rights granted to",
|
||||||
|
"You by any and all Contributors for the Covered Software under Section",
|
||||||
|
"2.1 of this License shall terminate.",
|
||||||
|
"",
|
||||||
|
"5.3. In the event of termination under Sections 5.1 or 5.2 above, all",
|
||||||
|
"end user license agreements (excluding distributors and resellers) which",
|
||||||
|
"have been validly granted by You or Your distributors under this License",
|
||||||
|
"prior to termination shall survive termination.",
|
||||||
|
"",
|
||||||
|
"************************************************************************",
|
||||||
|
"* *",
|
||||||
|
"* 6. Disclaimer of Warranty *",
|
||||||
|
"* ------------------------- *",
|
||||||
|
"* *",
|
||||||
|
"* Covered Software is provided under this License on an \"as is\" *",
|
||||||
|
"* basis, without warranty of any kind, either expressed, implied, or *",
|
||||||
|
"* statutory, including, without limitation, warranties that the *",
|
||||||
|
"* Covered Software is free of defects, merchantable, fit for a *",
|
||||||
|
"* particular purpose or non-infringing. The entire risk as to the *",
|
||||||
|
"* quality and performance of the Covered Software is with You. *",
|
||||||
|
"* Should any Covered Software prove defective in any respect, You *",
|
||||||
|
"* (not any Contributor) assume the cost of any necessary servicing, *",
|
||||||
|
"* repair, or correction. This disclaimer of warranty constitutes an *",
|
||||||
|
"* essential part of this License. No use of any Covered Software is *",
|
||||||
|
"* authorized under this License except under this disclaimer. *",
|
||||||
|
"* *",
|
||||||
|
"************************************************************************",
|
||||||
|
"",
|
||||||
|
"************************************************************************",
|
||||||
|
"* *",
|
||||||
|
"* 7. Limitation of Liability *",
|
||||||
|
"* -------------------------- *",
|
||||||
|
"* *",
|
||||||
|
"* Under no circumstances and under no legal theory, whether tort *",
|
||||||
|
"* (including negligence), contract, or otherwise, shall any *",
|
||||||
|
"* Contributor, or anyone who distributes Covered Software as *",
|
||||||
|
"* permitted above, be liable to You for any direct, indirect, *",
|
||||||
|
"* special, incidental, or consequential damages of any character *",
|
||||||
|
"* including, without limitation, damages for lost profits, loss of *",
|
||||||
|
"* goodwill, work stoppage, computer failure or malfunction, or any *",
|
||||||
|
"* and all other commercial damages or losses, even if such party *",
|
||||||
|
"* shall have been informed of the possibility of such damages. This *",
|
||||||
|
"* limitation of liability shall not apply to liability for death or *",
|
||||||
|
"* personal injury resulting from such party's negligence to the *",
|
||||||
|
"* extent applicable law prohibits such limitation. Some *",
|
||||||
|
"* jurisdictions do not allow the exclusion or limitation of *",
|
||||||
|
"* incidental or consequential damages, so this exclusion and *",
|
||||||
|
"* limitation may not apply to You. *",
|
||||||
|
"* *",
|
||||||
|
"************************************************************************",
|
||||||
|
"",
|
||||||
|
"8. Litigation",
|
||||||
|
"-------------",
|
||||||
|
"",
|
||||||
|
"Any litigation relating to this License may be brought only in the",
|
||||||
|
"courts of a jurisdiction where the defendant maintains its principal",
|
||||||
|
"place of business and such litigation shall be governed by laws of that",
|
||||||
|
"jurisdiction, without reference to its conflict-of-law provisions.",
|
||||||
|
"Nothing in this Section shall prevent a party's ability to bring",
|
||||||
|
"cross-claims or counter-claims.",
|
||||||
|
"",
|
||||||
|
"9. Miscellaneous",
|
||||||
|
"----------------",
|
||||||
|
"",
|
||||||
|
"This License represents the complete agreement concerning the subject",
|
||||||
|
"matter hereof. If any provision of this License is held to be",
|
||||||
|
"unenforceable, such provision shall be reformed only to the extent",
|
||||||
|
"necessary to make it enforceable. Any law or regulation which provides",
|
||||||
|
"that the language of a contract shall be construed against the drafter",
|
||||||
|
"shall not be used to construe this License against a Contributor.",
|
||||||
|
"",
|
||||||
|
"10. Versions of the License",
|
||||||
|
"---------------------------",
|
||||||
|
"",
|
||||||
|
"10.1. New Versions",
|
||||||
|
"",
|
||||||
|
"Mozilla Foundation is the license steward. Except as provided in Section",
|
||||||
|
"10.3, no one other than the license steward has the right to modify or",
|
||||||
|
"publish new versions of this License. Each version will be given a",
|
||||||
|
"distinguishing version number.",
|
||||||
|
"",
|
||||||
|
"10.2. Effect of New Versions",
|
||||||
|
"",
|
||||||
|
"You may distribute the Covered Software under the terms of the version",
|
||||||
|
"of the License under which You originally received the Covered Software,",
|
||||||
|
"or under the terms of any subsequent version published by the license",
|
||||||
|
"steward.",
|
||||||
|
"",
|
||||||
|
"10.3. Modified Versions",
|
||||||
|
"",
|
||||||
|
"If you create software not governed by this License, and you want to",
|
||||||
|
"create a new license for such software, you may create and use a",
|
||||||
|
"modified version of this License if you rename the license and remove",
|
||||||
|
"any references to the name of the license steward (except to note that",
|
||||||
|
"such modified license differs from this License).",
|
||||||
|
"",
|
||||||
|
"10.4. Distributing Source Code Form that is Incompatible With Secondary",
|
||||||
|
"Licenses",
|
||||||
|
"",
|
||||||
|
"If You choose to distribute Source Code Form that is Incompatible With",
|
||||||
|
"Secondary Licenses under the terms of this version of the License, the",
|
||||||
|
"notice described in Exhibit B of this License must be attached.",
|
||||||
|
"",
|
||||||
|
"Exhibit A - Source Code Form License Notice",
|
||||||
|
"-------------------------------------------",
|
||||||
|
"",
|
||||||
|
" This Source Code Form is subject to the terms of the Mozilla Public",
|
||||||
|
" License, v. 2.0. If a copy of the MPL was not distributed with this",
|
||||||
|
" file, You can obtain one at http://mozilla.org/MPL/2.0/.",
|
||||||
|
"",
|
||||||
|
"If it is not possible or desirable to put the notice in a particular",
|
||||||
|
"file, then You may include the notice in a location (such as a LICENSE",
|
||||||
|
"file in a relevant directory) where a recipient would be likely to look",
|
||||||
|
"for such a notice.",
|
||||||
|
"",
|
||||||
|
"You may add additional accurate notices of copyright ownership.",
|
||||||
|
"",
|
||||||
|
"Exhibit B - \"Incompatible With Secondary Licenses\" Notice",
|
||||||
|
"---------------------------------------------------------",
|
||||||
|
"",
|
||||||
|
" This Source Code Form is \"Incompatible With Secondary Licenses\", as",
|
||||||
|
" defined by the Mozilla Public License, v. 2.0."
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ install:
|
|||||||
build_script:
|
build_script:
|
||||||
- yarn
|
- yarn
|
||||||
- .\node_modules\.bin\gulp electron
|
- .\node_modules\.bin\gulp electron
|
||||||
- .\node_modules\.bin\tsc -p .\src\tsconfig.monaco.json --noEmit
|
|
||||||
- npm run compile
|
- npm run compile
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "ms-vscode.node-debug",
|
"name": "ms-vscode.node-debug",
|
||||||
"version": "1.21.8",
|
"version": "1.23.3",
|
||||||
"repo": "https://github.com/Microsoft/vscode-node-debug"
|
"repo": "https://github.com/Microsoft/vscode-node-debug"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ms-vscode.node-debug2",
|
"name": "ms-vscode.node-debug2",
|
||||||
"version": "1.21.2",
|
"version": "1.23.5",
|
||||||
"repo": "https://github.com/Microsoft/vscode-node-debug2"
|
"repo": "https://github.com/Microsoft/vscode-node-debug2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -3,12 +3,15 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
var gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
var path = require('path');
|
const path = require('path');
|
||||||
var util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
var common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
var es = require('event-stream');
|
const es = require('event-stream');
|
||||||
var File = require('vinyl');
|
const File = require('vinyl');
|
||||||
|
const i18n = require('./lib/i18n');
|
||||||
|
const standalone = require('./lib/standalone');
|
||||||
|
const cp = require('child_process');
|
||||||
|
|
||||||
var root = path.dirname(__dirname);
|
var root = path.dirname(__dirname);
|
||||||
var sha1 = util.getVersion(root);
|
var sha1 = util.getVersion(root);
|
||||||
@@ -71,6 +74,8 @@ function editorLoaderConfig() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
||||||
|
|
||||||
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
||||||
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-client-build'], common.optimizeTask({
|
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-client-build'], common.optimizeTask({
|
||||||
entryPoints: editorEntryPoints,
|
entryPoints: editorEntryPoints,
|
||||||
@@ -81,14 +86,36 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-client-build'],
|
|||||||
header: BUNDLED_FILE_HEADER,
|
header: BUNDLED_FILE_HEADER,
|
||||||
bundleInfo: true,
|
bundleInfo: true,
|
||||||
out: 'out-editor',
|
out: 'out-editor',
|
||||||
languages: undefined
|
languages: languages
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
||||||
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
||||||
|
|
||||||
|
gulp.task('clean-editor-esm', util.rimraf('out-editor-esm'));
|
||||||
|
gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro'], function () {
|
||||||
|
standalone.createESMSourcesAndResources({
|
||||||
|
entryPoints: [
|
||||||
|
'vs/editor/editor.main',
|
||||||
|
'vs/editor/editor.worker'
|
||||||
|
],
|
||||||
|
outFolder: './out-editor-esm/src',
|
||||||
|
outResourcesFolder: './out-monaco-editor-core/esm',
|
||||||
|
redirects: {
|
||||||
|
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
|
||||||
|
'vs/nls': 'vs/nls.mock',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
|
||||||
|
const result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
|
||||||
|
cwd: path.join(__dirname, '../out-editor-esm')
|
||||||
|
});
|
||||||
|
console.log(result.stdout.toString());
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
||||||
gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-editor'], function () {
|
gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () {
|
||||||
return es.merge(
|
return es.merge(
|
||||||
// other assets
|
// other assets
|
||||||
es.merge(
|
es.merge(
|
||||||
@@ -97,6 +124,17 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
|
|||||||
gulp.src('src/vs/monaco.d.ts')
|
gulp.src('src/vs/monaco.d.ts')
|
||||||
).pipe(gulp.dest('out-monaco-editor-core')),
|
).pipe(gulp.dest('out-monaco-editor-core')),
|
||||||
|
|
||||||
|
// place the .d.ts in the esm folder
|
||||||
|
gulp.src('src/vs/monaco.d.ts')
|
||||||
|
.pipe(es.through(function (data) {
|
||||||
|
this.emit('data', new File({
|
||||||
|
path: data.path.replace(/monaco\.d\.ts/, 'editor.api.d.ts'),
|
||||||
|
base: data.base,
|
||||||
|
contents: data.contents
|
||||||
|
}));
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest('out-monaco-editor-core/esm/vs/editor')),
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
gulp.src('build/monaco/package.json')
|
gulp.src('build/monaco/package.json')
|
||||||
.pipe(es.through(function (data) {
|
.pipe(es.through(function (data) {
|
||||||
@@ -208,3 +246,60 @@ function filterStream(testFunc) {
|
|||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//#region monaco type checking
|
||||||
|
|
||||||
|
function createTscCompileTask(watch) {
|
||||||
|
return () => {
|
||||||
|
const createReporter = require('./lib/reporter').createReporter;
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const args = ['./node_modules/.bin/tsc', '-p', './src/tsconfig.monaco.json', '--noEmit'];
|
||||||
|
if (watch) {
|
||||||
|
args.push('-w');
|
||||||
|
}
|
||||||
|
const child = cp.spawn(`node`, args, {
|
||||||
|
cwd: path.join(__dirname, '..'),
|
||||||
|
// stdio: [null, 'pipe', 'inherit']
|
||||||
|
});
|
||||||
|
let errors = [];
|
||||||
|
let reporter = createReporter();
|
||||||
|
let report;
|
||||||
|
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
||||||
|
|
||||||
|
child.stdout.on('data', data => {
|
||||||
|
let str = String(data);
|
||||||
|
str = str.replace(magic, '').trim();
|
||||||
|
if (str.indexOf('Starting compilation') >= 0 || str.indexOf('File change detected') >= 0) {
|
||||||
|
errors.length = 0;
|
||||||
|
report = reporter.end(false);
|
||||||
|
|
||||||
|
} else if (str.indexOf('Compilation complete') >= 0) {
|
||||||
|
report.end();
|
||||||
|
|
||||||
|
} else if (str) {
|
||||||
|
let match = /(.*\(\d+,\d+\): )(.*: )(.*)/.exec(str);
|
||||||
|
if (match) {
|
||||||
|
// trying to massage the message so that it matches the gulp-tsb error messages
|
||||||
|
// e.g. src/vs/base/common/strings.ts(663,5): error TS2322: Type '1234' is not assignable to type 'string'.
|
||||||
|
let fullpath = path.join(root, match[1]);
|
||||||
|
let message = match[3];
|
||||||
|
// @ts-ignore
|
||||||
|
reporter(fullpath + message);
|
||||||
|
} else {
|
||||||
|
// @ts-ignore
|
||||||
|
reporter(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
child.on('exit', resolve);
|
||||||
|
child.on('error', reject);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
gulp.task('monaco-typecheck-watch', createTscCompileTask(true));
|
||||||
|
gulp.task('monaco-typecheck', createTscCompileTask(false));
|
||||||
|
|
||||||
|
//#endregion
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ const nlsDev = require('vscode-nls-dev');
|
|||||||
const root = path.dirname(__dirname);
|
const root = path.dirname(__dirname);
|
||||||
const commit = util.getVersion(root);
|
const commit = util.getVersion(root);
|
||||||
const i18n = require('./lib/i18n');
|
const i18n = require('./lib/i18n');
|
||||||
|
const plumber = require('gulp-plumber');
|
||||||
|
|
||||||
const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
|
const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
|
||||||
|
|
||||||
@@ -82,6 +83,13 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
const input = es.through();
|
const input = es.through();
|
||||||
const tsFilter = filter(['**/*.ts', '!**/lib/lib*.d.ts', '!**/node_modules/**'], { restore: true });
|
const tsFilter = filter(['**/*.ts', '!**/lib/lib*.d.ts', '!**/node_modules/**'], { restore: true });
|
||||||
const output = input
|
const output = input
|
||||||
|
.pipe(plumber({
|
||||||
|
errorHandler: function (err) {
|
||||||
|
if (err && !err.__reporter__) {
|
||||||
|
reporter(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}))
|
||||||
.pipe(tsFilter)
|
.pipe(tsFilter)
|
||||||
.pipe(util.loadSourcemaps())
|
.pipe(util.loadSourcemaps())
|
||||||
.pipe(compilation())
|
.pipe(compilation())
|
||||||
|
|||||||
@@ -46,10 +46,9 @@ const indentationFilter = [
|
|||||||
'!src/vs/nls.js',
|
'!src/vs/nls.js',
|
||||||
'!src/vs/css.js',
|
'!src/vs/css.js',
|
||||||
'!src/vs/loader.js',
|
'!src/vs/loader.js',
|
||||||
'!src/vs/base/common/marked/raw.marked.js',
|
'!src/vs/base/common/marked/marked.js',
|
||||||
'!src/vs/base/common/winjs.base.raw.js',
|
'!src/vs/base/common/winjs.base.js',
|
||||||
'!src/vs/base/node/terminateProcess.sh',
|
'!src/vs/base/node/terminateProcess.sh',
|
||||||
'!src/vs/base/node/ps-win.ps1',
|
|
||||||
'!test/assert.js',
|
'!test/assert.js',
|
||||||
|
|
||||||
// except specific folders
|
// except specific folders
|
||||||
@@ -62,6 +61,7 @@ const indentationFilter = [
|
|||||||
// except multiple specific files
|
// except multiple specific files
|
||||||
'!**/package.json',
|
'!**/package.json',
|
||||||
'!**/yarn.lock',
|
'!**/yarn.lock',
|
||||||
|
'!**/yarn-error.log',
|
||||||
|
|
||||||
// except multiple specific folders
|
// except multiple specific folders
|
||||||
'!**/octicons/**',
|
'!**/octicons/**',
|
||||||
@@ -104,8 +104,9 @@ const copyrightFilter = [
|
|||||||
'!build/**/*.init',
|
'!build/**/*.init',
|
||||||
'!resources/linux/snap/snapcraft.yaml',
|
'!resources/linux/snap/snapcraft.yaml',
|
||||||
'!resources/win32/bin/code.js',
|
'!resources/win32/bin/code.js',
|
||||||
'!extensions/markdown/media/tomorrow.css',
|
'!extensions/markdown-language-features/media/tomorrow.css',
|
||||||
'!extensions/html/server/src/modes/typescript/*'
|
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||||
|
'!extensions/*/server/bin/*'
|
||||||
];
|
];
|
||||||
|
|
||||||
const eslintFilter = [
|
const eslintFilter = [
|
||||||
@@ -116,8 +117,8 @@ const eslintFilter = [
|
|||||||
'!src/vs/nls.js',
|
'!src/vs/nls.js',
|
||||||
'!src/vs/css.build.js',
|
'!src/vs/css.build.js',
|
||||||
'!src/vs/nls.build.js',
|
'!src/vs/nls.build.js',
|
||||||
'!src/**/winjs.base.raw.js',
|
'!src/**/winjs.base.js',
|
||||||
'!src/**/raw.marked.js',
|
'!src/**/marked.js',
|
||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -132,15 +133,15 @@ const tslintFilter = [
|
|||||||
'!extensions/vscode-api-tests/testWorkspace/**',
|
'!extensions/vscode-api-tests/testWorkspace/**',
|
||||||
'!extensions/vscode-api-tests/testWorkspace2/**',
|
'!extensions/vscode-api-tests/testWorkspace2/**',
|
||||||
'!extensions/**/*.test.ts',
|
'!extensions/**/*.test.ts',
|
||||||
'!extensions/html/server/lib/jquery.d.ts'
|
'!extensions/html-language-features/server/lib/jquery.d.ts'
|
||||||
];
|
];
|
||||||
|
|
||||||
const copyrightHeader = [
|
const copyrightHeaderLines = [
|
||||||
'/*---------------------------------------------------------------------------------------------',
|
'/*---------------------------------------------------------------------------------------------',
|
||||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||||
' * Licensed under the Source EULA. See License.txt in the project root for license information.',
|
' * Licensed under the Source EULA. See License.txt in the project root for license information.',
|
||||||
' *--------------------------------------------------------------------------------------------*/'
|
' *--------------------------------------------------------------------------------------------*/'
|
||||||
].join('\n');
|
];
|
||||||
|
|
||||||
gulp.task('eslint', () => {
|
gulp.task('eslint', () => {
|
||||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||||
@@ -202,12 +203,17 @@ function hygiene(some) {
|
|||||||
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
||||||
verify: false,
|
verify: false,
|
||||||
tsfmt: true,
|
tsfmt: true,
|
||||||
// verbose: true
|
// verbose: true,
|
||||||
// keep checkJS happy
|
// keep checkJS happy
|
||||||
editorconfig: undefined,
|
editorconfig: undefined,
|
||||||
replace: undefined,
|
replace: undefined,
|
||||||
tsconfig: undefined,
|
tsconfig: undefined,
|
||||||
tslint: undefined
|
tsconfigFile: undefined,
|
||||||
|
tslint: undefined,
|
||||||
|
tslintFile: undefined,
|
||||||
|
tsfmtFile: undefined,
|
||||||
|
vscode: undefined,
|
||||||
|
vscodeFile: undefined
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
let original = result.src.replace(/\r\n/gm, '\n');
|
let original = result.src.replace(/\r\n/gm, '\n');
|
||||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||||
|
|||||||
@@ -91,18 +91,19 @@ const vscodeEntryPoints = _.flatten([
|
|||||||
const vscodeResources = [
|
const vscodeResources = [
|
||||||
'out-build/main.js',
|
'out-build/main.js',
|
||||||
'out-build/cli.js',
|
'out-build/cli.js',
|
||||||
|
'out-build/driver.js',
|
||||||
'out-build/bootstrap.js',
|
'out-build/bootstrap.js',
|
||||||
'out-build/bootstrap-amd.js',
|
'out-build/bootstrap-amd.js',
|
||||||
'out-build/paths.js',
|
'out-build/paths.js',
|
||||||
'out-build/vs/**/*.{svg,png,cur,html}',
|
'out-build/vs/**/*.{svg,png,cur,html}',
|
||||||
'out-build/vs/base/common/performance.js',
|
'out-build/vs/base/common/performance.js',
|
||||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,ps-win.ps1}',
|
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh}',
|
||||||
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
||||||
'out-build/vs/workbench/browser/media/*-theme.css',
|
'out-build/vs/workbench/browser/media/*-theme.css',
|
||||||
'out-build/vs/workbench/electron-browser/bootstrap/**',
|
'out-build/vs/workbench/electron-browser/bootstrap/**',
|
||||||
'out-build/vs/workbench/parts/debug/**/*.json',
|
'out-build/vs/workbench/parts/debug/**/*.json',
|
||||||
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
||||||
'out-build/vs/workbench/parts/html/browser/webview-pre.js',
|
'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js',
|
||||||
'out-build/vs/**/markdown.css',
|
'out-build/vs/**/markdown.css',
|
||||||
'out-build/vs/workbench/parts/tasks/**/*.json',
|
'out-build/vs/workbench/parts/tasks/**/*.json',
|
||||||
'out-build/vs/workbench/parts/terminal/electron-browser/terminalProcess.js',
|
'out-build/vs/workbench/parts/terminal/electron-browser/terminalProcess.js',
|
||||||
@@ -111,6 +112,7 @@ const vscodeResources = [
|
|||||||
'out-build/vs/workbench/services/files/**/*.md',
|
'out-build/vs/workbench/services/files/**/*.md',
|
||||||
'out-build/vs/code/electron-browser/sharedProcess/sharedProcess.js',
|
'out-build/vs/code/electron-browser/sharedProcess/sharedProcess.js',
|
||||||
'out-build/vs/code/electron-browser/issue/issueReporter.js',
|
'out-build/vs/code/electron-browser/issue/issueReporter.js',
|
||||||
|
'out-build/vs/code/electron-browser/processExplorer/processExplorer.js',
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
'out-build/sql/workbench/electron-browser/splashscreen/*',
|
'out-build/sql/workbench/electron-browser/splashscreen/*',
|
||||||
'out-build/sql/**/*.{svg,png,cur,html}',
|
'out-build/sql/**/*.{svg,png,cur,html}',
|
||||||
@@ -348,7 +350,7 @@ function packageTask(platform, arch, opts) {
|
|||||||
const packageJsonStream = gulp.src(['package.json'], { base: '.' })
|
const packageJsonStream = gulp.src(['package.json'], { base: '.' })
|
||||||
.pipe(json({ name, version }));
|
.pipe(json({ name, version }));
|
||||||
|
|
||||||
const settingsSearchBuildId = getBuildNumber();
|
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||||
const date = new Date().toISOString();
|
const date = new Date().toISOString();
|
||||||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||||
.pipe(json({ commit, date, checksums, settingsSearchBuildId }));
|
.pipe(json({ commit, date, checksums, settingsSearchBuildId }));
|
||||||
@@ -390,6 +392,7 @@ function packageTask(platform, arch, opts) {
|
|||||||
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
|
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
|
||||||
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
|
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
|
||||||
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||||
|
.pipe(util.cleanNodeModule('vscode-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']))
|
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
||||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||||
|
|
||||||
@@ -579,14 +582,12 @@ gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||||
console.error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const settingsSearchBuildId = getBuildNumber();
|
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||||
if (!settingsSearchBuildId) {
|
if (!settingsSearchBuildId) {
|
||||||
console.error('Failed to compute build number');
|
throw new Error('Failed to compute build number');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return gulp.src(allConfigDetailsPath)
|
return gulp.src(allConfigDetailsPath)
|
||||||
@@ -598,76 +599,18 @@ gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () =
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
function getBuildNumber() {
|
function getSettingsSearchBuildId(packageJson) {
|
||||||
const previous = getPreviousVersion(packageJson.version);
|
const previous = util.getPreviousVersion(packageJson.version);
|
||||||
if (!previous) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const out = cp.execSync(`git rev-list ${previous}..HEAD --count`);
|
const out = cp.execSync(`git rev-list ${previous}..HEAD --count`);
|
||||||
const count = parseInt(out.toString());
|
const count = parseInt(out.toString());
|
||||||
return versionStringToNumber(packageJson.version) * 1e4 + count;
|
return util.versionStringToNumber(packageJson.version) * 1e4 + count;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Could not determine build number: ' + e.toString());
|
throw new 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This task is only run for the MacOS build
|
// This task is only run for the MacOS build
|
||||||
gulp.task('generate-vscode-configuration', () => {
|
gulp.task('generate-vscode-configuration', () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -699,9 +642,6 @@ gulp.task('generate-vscode-configuration', () => {
|
|||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
}).catch(e => {
|
|
||||||
// Don't fail the build
|
|
||||||
console.error(e.toString());
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -21,29 +21,6 @@ const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
|||||||
|
|
||||||
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
const flatpakManifest = {
|
|
||||||
appId: product.darwinBundleIdentifier, // We need a reverse-url style identifier.
|
|
||||||
sdk: 'org.freedesktop.Sdk',
|
|
||||||
runtime: 'org.freedesktop.Sdk',
|
|
||||||
runtimeVersion: '1.4',
|
|
||||||
base: 'io.atom.electron.BaseApp',
|
|
||||||
baseFlatpakref: 'https://s3-us-west-2.amazonaws.com/electron-flatpak.endlessm.com/electron-base-app-master.flatpakref',
|
|
||||||
command: product.applicationName,
|
|
||||||
symlinks: [
|
|
||||||
['/share/' + product.applicationName + '/bin/' + product.applicationName, '/bin/' + product.applicationName],
|
|
||||||
],
|
|
||||||
finishArgs: [
|
|
||||||
'--share=ipc', '--socket=x11', // Allow showing X11 windows.
|
|
||||||
'--share=network', // Network access (e.g. for installing extension).
|
|
||||||
'--filesystem=host', // Allow access to the whole file system.
|
|
||||||
'--device=dri', // Allow OpenGL rendering.
|
|
||||||
'--filesystem=/tmp', // Needed for Chromium's single instance check.
|
|
||||||
'--socket=pulseaudio', // Some extensions may want to play sounds...
|
|
||||||
'--talk-name=org.freedesktop.Notifications', // ...or pop up notifications.
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
function getDebPackageArch(arch) {
|
function getDebPackageArch(arch) {
|
||||||
return { x64: 'amd64', ia32: 'i386', arm: 'armhf' }[arch];
|
return { x64: 'amd64', ia32: 'i386', arm: 'armhf' }[arch];
|
||||||
}
|
}
|
||||||
@@ -336,10 +313,3 @@ gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prep
|
|||||||
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
|
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-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-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'));
|
|
||||||
|
|||||||
@@ -22,11 +22,12 @@ var rootDir = path.join(__dirname, '../../src');
|
|||||||
var options = require('../../src/tsconfig.json').compilerOptions;
|
var options = require('../../src/tsconfig.json').compilerOptions;
|
||||||
options.verbose = false;
|
options.verbose = false;
|
||||||
options.sourceMap = true;
|
options.sourceMap = true;
|
||||||
if (process.env['VSCODE_NO_SOURCEMAP']) {
|
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
|
||||||
options.sourceMap = false;
|
options.sourceMap = false;
|
||||||
}
|
}
|
||||||
options.rootDir = rootDir;
|
options.rootDir = rootDir;
|
||||||
options.sourceRoot = util.toFileUri(rootDir);
|
options.sourceRoot = util.toFileUri(rootDir);
|
||||||
|
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF';
|
||||||
function createCompile(build, emitError) {
|
function createCompile(build, emitError) {
|
||||||
var opts = _.clone(options);
|
var opts = _.clone(options);
|
||||||
opts.inlineSources = !!build;
|
opts.inlineSources = !!build;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
|
|||||||
}
|
}
|
||||||
options.rootDir = rootDir;
|
options.rootDir = rootDir;
|
||||||
options.sourceRoot = util.toFileUri(rootDir);
|
options.sourceRoot = util.toFileUri(rootDir);
|
||||||
|
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF';
|
||||||
|
|
||||||
function createCompile(build: boolean, emitError?: boolean): (token?: util.ICancellationToken) => NodeJS.ReadWriteStream {
|
function createCompile(build: boolean, emitError?: boolean): (token?: util.ICancellationToken) => NodeJS.ReadWriteStream {
|
||||||
const opts = _.clone(options);
|
const opts = _.clone(options);
|
||||||
|
|||||||
@@ -527,6 +527,7 @@ function getResource(sourceFile) {
|
|||||||
else if (/^vs\/workbench/.test(sourceFile)) {
|
else if (/^vs\/workbench/.test(sourceFile)) {
|
||||||
return { name: 'vs/workbench', project: workbenchProject };
|
return { name: 'vs/workbench', project: workbenchProject };
|
||||||
}
|
}
|
||||||
|
// {{SQL CARBON EDIT}}
|
||||||
else if (/^sql/.test(sourceFile)) {
|
else if (/^sql/.test(sourceFile)) {
|
||||||
return { name: 'sql', project: sqlopsProject };
|
return { name: 'sql', project: sqlopsProject };
|
||||||
}
|
}
|
||||||
@@ -1051,7 +1052,10 @@ function createI18nFile(originalFilePath, messages) {
|
|||||||
var key = _a[_i];
|
var key = _a[_i];
|
||||||
result[key] = messages[key];
|
result[key] = messages[key];
|
||||||
}
|
}
|
||||||
var content = JSON.stringify(result, null, '\t').replace(/\r\n/g, '\n');
|
var content = JSON.stringify(result, null, '\t');
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
content = content.replace(/\n/g, '\r\n');
|
||||||
|
}
|
||||||
return new File({
|
return new File({
|
||||||
path: path.join(originalFilePath + '.i18n.json'),
|
path: path.join(originalFilePath + '.i18n.json'),
|
||||||
contents: Buffer.from(content, 'utf8')
|
contents: Buffer.from(content, 'utf8')
|
||||||
@@ -1085,7 +1089,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
|
|||||||
extPack = extensionsPacks[resource] = { version: i18nPackVersion, contents: {} };
|
extPack = extensionsPacks[resource] = { version: i18nPackVersion, contents: {} };
|
||||||
}
|
}
|
||||||
var externalId = externalExtensions[resource];
|
var externalId = externalExtensions[resource];
|
||||||
if (!externalId) {
|
if (!externalId) { // internal extension: remove 'extensions/extensionId/' segnent
|
||||||
var secondSlash = path.indexOf('/', firstSlash + 1);
|
var secondSlash = path.indexOf('/', firstSlash + 1);
|
||||||
extPack.contents[path.substr(secondSlash + 1)] = file.messages;
|
extPack.contents[path.substr(secondSlash + 1)] = file.messages;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,10 +130,18 @@
|
|||||||
"name": "vs/workbench/parts/update",
|
"name": "vs/workbench/parts/update",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/parts/url",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/watermark",
|
"name": "vs/workbench/parts/watermark",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/parts/webview",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/welcome",
|
"name": "vs/workbench/parts/welcome",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
@@ -146,6 +154,10 @@
|
|||||||
"name": "vs/workbench/services/configuration",
|
"name": "vs/workbench/services/configuration",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/services/configurationResolver",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/crashReporter",
|
"name": "vs/workbench/services/crashReporter",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
@@ -201,6 +213,10 @@
|
|||||||
{
|
{
|
||||||
"name": "vs/workbench/services/decorations",
|
"name": "vs/workbench/services/decorations",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/services/preferences",
|
||||||
|
"project": "vscode-preferences"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1179,7 +1179,10 @@ function createI18nFile(originalFilePath: string, messages: any): File {
|
|||||||
result[key] = messages[key];
|
result[key] = messages[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
let content = JSON.stringify(result, null, '\t').replace(/\r\n/g, '\n');
|
let content = JSON.stringify(result, null, '\t');
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
content = content.replace(/\n/g, '\r\n');
|
||||||
|
}
|
||||||
return new File({
|
return new File({
|
||||||
path: path.join(originalFilePath + '.i18n.json'),
|
path: path.join(originalFilePath + '.i18n.json'),
|
||||||
contents: Buffer.from(content, 'utf8')
|
contents: Buffer.from(content, 'utf8')
|
||||||
|
|||||||
@@ -150,13 +150,16 @@ function isImportNode(node) {
|
|||||||
.filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport; })
|
.filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport; })
|
||||||
.map(function (d) { return d.importClause.namedBindings.name; })
|
.map(function (d) { return d.importClause.namedBindings.name; })
|
||||||
.concat(importEqualsDeclarations.map(function (d) { return d.name; }))
|
.concat(importEqualsDeclarations.map(function (d) { return d.name; }))
|
||||||
|
// find read-only references to `nls`
|
||||||
.map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); })
|
.map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); })
|
||||||
.flatten()
|
.flatten()
|
||||||
.filter(function (r) { return !r.isWriteAccess; })
|
.filter(function (r) { return !r.isWriteAccess; })
|
||||||
|
// find the deepest call expressions AST nodes that contain those references
|
||||||
.map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); })
|
.map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); })
|
||||||
.map(function (a) { return lazy(a).last(); })
|
.map(function (a) { return lazy(a).last(); })
|
||||||
.filter(function (n) { return !!n; })
|
.filter(function (n) { return !!n; })
|
||||||
.map(function (n) { return n; })
|
.map(function (n) { return n; })
|
||||||
|
// only `localize` calls
|
||||||
.filter(function (n) { return n.expression.kind === ts.SyntaxKind.PropertyAccessExpression && n.expression.name.getText() === 'localize'; });
|
.filter(function (n) { return n.expression.kind === ts.SyntaxKind.PropertyAccessExpression && n.expression.name.getText() === 'localize'; });
|
||||||
// `localize` named imports
|
// `localize` named imports
|
||||||
var allLocalizeImportDeclarations = importDeclarations
|
var allLocalizeImportDeclarations = importDeclarations
|
||||||
|
|||||||
@@ -34,7 +34,13 @@ catch (err) {
|
|||||||
}
|
}
|
||||||
function log() {
|
function log() {
|
||||||
var errors = _.flatten(allErrors);
|
var errors = _.flatten(allErrors);
|
||||||
errors.map(function (err) { return util.log(util.colors.red('Error') + ": " + err); });
|
var seen = new Set();
|
||||||
|
errors.map(function (err) {
|
||||||
|
if (!seen.has(err)) {
|
||||||
|
seen.add(err);
|
||||||
|
util.log(util.colors.red('Error') + ": " + err);
|
||||||
|
}
|
||||||
|
});
|
||||||
var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||||
var messages = errors
|
var messages = errors
|
||||||
.map(function (err) { return regex.exec(err); })
|
.map(function (err) { return regex.exec(err); })
|
||||||
@@ -67,8 +73,13 @@ function createReporter() {
|
|||||||
return es.through(null, function () {
|
return es.through(null, function () {
|
||||||
onEnd();
|
onEnd();
|
||||||
if (emitError && errors.length > 0) {
|
if (emitError && errors.length > 0) {
|
||||||
|
errors.__logged__ = true;
|
||||||
|
if (!errors.__logged__) {
|
||||||
log();
|
log();
|
||||||
this.emit('error');
|
}
|
||||||
|
var err = new Error("Found " + errors.length + " errors");
|
||||||
|
err.__reporter__ = true;
|
||||||
|
this.emit('error', err);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
@@ -80,4 +91,3 @@ function createReporter() {
|
|||||||
return ReportFunc;
|
return ReportFunc;
|
||||||
}
|
}
|
||||||
exports.createReporter = createReporter;
|
exports.createReporter = createReporter;
|
||||||
;
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import * as util from 'gulp-util';
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
const allErrors: Error[][] = [];
|
const allErrors: string[][] = [];
|
||||||
let startTime: number = null;
|
let startTime: number = null;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
@@ -42,7 +42,14 @@ try {
|
|||||||
|
|
||||||
function log(): void {
|
function log(): void {
|
||||||
const errors = _.flatten(allErrors);
|
const errors = _.flatten(allErrors);
|
||||||
errors.map(err => util.log(`${util.colors.red('Error')}: ${err}`));
|
const seen = new Set<string>();
|
||||||
|
|
||||||
|
errors.map(err => {
|
||||||
|
if (!seen.has(err)) {
|
||||||
|
seen.add(err);
|
||||||
|
util.log(`${util.colors.red('Error')}: ${err}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||||
const messages = errors
|
const messages = errors
|
||||||
@@ -61,17 +68,17 @@ function log(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IReporter {
|
export interface IReporter {
|
||||||
(err: Error): void;
|
(err: string): void;
|
||||||
hasErrors(): boolean;
|
hasErrors(): boolean;
|
||||||
end(emitError: boolean): NodeJS.ReadWriteStream;
|
end(emitError: boolean): NodeJS.ReadWriteStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createReporter(): IReporter {
|
export function createReporter(): IReporter {
|
||||||
const errors: Error[] = [];
|
const errors: string[] = [];
|
||||||
allErrors.push(errors);
|
allErrors.push(errors);
|
||||||
|
|
||||||
class ReportFunc {
|
class ReportFunc {
|
||||||
constructor(err: Error) {
|
constructor(err: string) {
|
||||||
errors.push(err);
|
errors.push(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +94,15 @@ export function createReporter(): IReporter {
|
|||||||
onEnd();
|
onEnd();
|
||||||
|
|
||||||
if (emitError && errors.length > 0) {
|
if (emitError && errors.length > 0) {
|
||||||
|
(errors as any).__logged__ = true;
|
||||||
|
|
||||||
|
if (!(errors as any).__logged__) {
|
||||||
log();
|
log();
|
||||||
this.emit('error');
|
}
|
||||||
|
|
||||||
|
const err = new Error(`Found ${errors.length} errors`);
|
||||||
|
(err as any).__reporter__ = true;
|
||||||
|
this.emit('error', err);
|
||||||
} else {
|
} else {
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
}
|
}
|
||||||
@@ -97,4 +111,4 @@ export function createReporter(): IReporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return <IReporter><any>ReportFunc;
|
return <IReporter><any>ReportFunc;
|
||||||
};
|
}
|
||||||
|
|||||||
265
build/lib/standalone.js
Normal file
265
build/lib/standalone.js
Normal file
@@ -0,0 +1,265 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var ts = require("typescript");
|
||||||
|
var fs = require("fs");
|
||||||
|
var path = require("path");
|
||||||
|
var REPO_ROOT = path.join(__dirname, '../../');
|
||||||
|
var SRC_DIR = path.join(REPO_ROOT, 'src');
|
||||||
|
var OUT_EDITOR = path.join(REPO_ROOT, 'out-editor');
|
||||||
|
function createESMSourcesAndResources(options) {
|
||||||
|
var OUT_FOLDER = path.join(REPO_ROOT, options.outFolder);
|
||||||
|
var OUT_RESOURCES_FOLDER = path.join(REPO_ROOT, options.outResourcesFolder);
|
||||||
|
var in_queue = Object.create(null);
|
||||||
|
var queue = [];
|
||||||
|
var enqueue = function (module) {
|
||||||
|
if (in_queue[module]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
in_queue[module] = true;
|
||||||
|
queue.push(module);
|
||||||
|
};
|
||||||
|
var seenDir = {};
|
||||||
|
var createDirectoryRecursive = function (dir) {
|
||||||
|
if (seenDir[dir]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var lastSlash = dir.lastIndexOf('/');
|
||||||
|
if (lastSlash === -1) {
|
||||||
|
lastSlash = dir.lastIndexOf('\\');
|
||||||
|
}
|
||||||
|
if (lastSlash !== -1) {
|
||||||
|
createDirectoryRecursive(dir.substring(0, lastSlash));
|
||||||
|
}
|
||||||
|
seenDir[dir] = true;
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(dir);
|
||||||
|
}
|
||||||
|
catch (err) { }
|
||||||
|
};
|
||||||
|
seenDir[REPO_ROOT] = true;
|
||||||
|
var toggleComments = function (fileContents) {
|
||||||
|
var lines = fileContents.split(/\r\n|\r|\n/);
|
||||||
|
var mode = 0;
|
||||||
|
for (var i = 0; i < lines.length; i++) {
|
||||||
|
var line = lines[i];
|
||||||
|
if (mode === 0) {
|
||||||
|
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||||
|
mode = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (/\/\/ ESM-uncomment-begin/.test(line)) {
|
||||||
|
mode = 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (mode === 1) {
|
||||||
|
if (/\/\/ ESM-comment-end/.test(line)) {
|
||||||
|
mode = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lines[i] = '// ' + line;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (mode === 2) {
|
||||||
|
if (/\/\/ ESM-uncomment-end/.test(line)) {
|
||||||
|
mode = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lines[i] = line.replace(/^(\s*)\/\/ ?/, function (_, indent) {
|
||||||
|
return indent;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lines.join('\n');
|
||||||
|
};
|
||||||
|
var write = function (filePath, contents) {
|
||||||
|
var absoluteFilePath;
|
||||||
|
if (/\.ts$/.test(filePath)) {
|
||||||
|
absoluteFilePath = path.join(OUT_FOLDER, filePath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
absoluteFilePath = path.join(OUT_RESOURCES_FOLDER, filePath);
|
||||||
|
}
|
||||||
|
createDirectoryRecursive(path.dirname(absoluteFilePath));
|
||||||
|
if (/(\.ts$)|(\.js$)/.test(filePath)) {
|
||||||
|
contents = toggleComments(contents.toString());
|
||||||
|
}
|
||||||
|
fs.writeFileSync(absoluteFilePath, contents);
|
||||||
|
};
|
||||||
|
options.entryPoints.forEach(function (entryPoint) { return enqueue(entryPoint); });
|
||||||
|
while (queue.length > 0) {
|
||||||
|
var module_1 = queue.shift();
|
||||||
|
if (transportCSS(options, module_1, enqueue, write)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (transportResource(options, module_1, enqueue, write)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (transportDTS(options, module_1, enqueue, write)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var filename = void 0;
|
||||||
|
if (options.redirects[module_1]) {
|
||||||
|
filename = path.join(SRC_DIR, options.redirects[module_1] + '.ts');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
filename = path.join(SRC_DIR, module_1 + '.ts');
|
||||||
|
}
|
||||||
|
var fileContents = fs.readFileSync(filename).toString();
|
||||||
|
var info = ts.preProcessFile(fileContents);
|
||||||
|
for (var i = info.importedFiles.length - 1; i >= 0; i--) {
|
||||||
|
var importedFilename = info.importedFiles[i].fileName;
|
||||||
|
var pos = info.importedFiles[i].pos;
|
||||||
|
var end = info.importedFiles[i].end;
|
||||||
|
var importedFilepath = void 0;
|
||||||
|
if (/^vs\/css!/.test(importedFilename)) {
|
||||||
|
importedFilepath = importedFilename.substr('vs/css!'.length) + '.css';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
importedFilepath = importedFilename;
|
||||||
|
}
|
||||||
|
if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) {
|
||||||
|
importedFilepath = path.join(path.dirname(module_1), importedFilepath);
|
||||||
|
}
|
||||||
|
enqueue(importedFilepath);
|
||||||
|
var relativePath = void 0;
|
||||||
|
if (importedFilepath === path.dirname(module_1)) {
|
||||||
|
relativePath = '../' + path.basename(path.dirname(module_1));
|
||||||
|
}
|
||||||
|
else if (importedFilepath === path.dirname(path.dirname(module_1))) {
|
||||||
|
relativePath = '../../' + path.basename(path.dirname(path.dirname(module_1)));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
relativePath = path.relative(path.dirname(module_1), importedFilepath);
|
||||||
|
}
|
||||||
|
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
||||||
|
relativePath = './' + relativePath;
|
||||||
|
}
|
||||||
|
fileContents = (fileContents.substring(0, pos + 1)
|
||||||
|
+ relativePath
|
||||||
|
+ fileContents.substring(end + 1));
|
||||||
|
}
|
||||||
|
fileContents = fileContents.replace(/import ([a-zA-z0-9]+) = require\(('[^']+')\);/g, function (_, m1, m2) {
|
||||||
|
return "import * as " + m1 + " from " + m2 + ";";
|
||||||
|
});
|
||||||
|
fileContents = fileContents.replace(/Thenable/g, 'PromiseLike');
|
||||||
|
write(module_1 + '.ts', fileContents);
|
||||||
|
}
|
||||||
|
var esm_opts = {
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": path.relative(path.dirname(OUT_FOLDER), OUT_RESOURCES_FOLDER),
|
||||||
|
"rootDir": "src",
|
||||||
|
"module": "es6",
|
||||||
|
"target": "es5",
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"es5",
|
||||||
|
"es2015.collection",
|
||||||
|
"es2015.promise"
|
||||||
|
],
|
||||||
|
"types": []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fs.writeFileSync(path.join(path.dirname(OUT_FOLDER), 'tsconfig.json'), JSON.stringify(esm_opts, null, '\t'));
|
||||||
|
var monacodts = fs.readFileSync(path.join(SRC_DIR, 'vs/monaco.d.ts')).toString();
|
||||||
|
fs.writeFileSync(path.join(OUT_FOLDER, 'vs/monaco.d.ts'), monacodts);
|
||||||
|
}
|
||||||
|
exports.createESMSourcesAndResources = createESMSourcesAndResources;
|
||||||
|
function transportCSS(options, module, enqueue, write) {
|
||||||
|
if (!/\.css/.test(module)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var filename = path.join(SRC_DIR, module);
|
||||||
|
var fileContents = fs.readFileSync(filename).toString();
|
||||||
|
var inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
|
||||||
|
var inlineResourcesLimit = 300000; //3000; // see https://github.com/Microsoft/monaco-editor/issues/336
|
||||||
|
var newContents = _rewriteOrInlineUrls(filename, fileContents, inlineResources === 'base64', inlineResourcesLimit);
|
||||||
|
write(module, newContents);
|
||||||
|
return true;
|
||||||
|
function _rewriteOrInlineUrls(originalFileFSPath, contents, forceBase64, inlineByteLimit) {
|
||||||
|
return _replaceURL(contents, function (url) {
|
||||||
|
var imagePath = path.join(path.dirname(module), url);
|
||||||
|
var fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
|
||||||
|
if (fileContents.length < inlineByteLimit) {
|
||||||
|
var MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
|
||||||
|
var DATA = ';base64,' + fileContents.toString('base64');
|
||||||
|
if (!forceBase64 && /\.svg$/.test(url)) {
|
||||||
|
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
|
||||||
|
var newText = fileContents.toString()
|
||||||
|
.replace(/"/g, '\'')
|
||||||
|
.replace(/</g, '%3C')
|
||||||
|
.replace(/>/g, '%3E')
|
||||||
|
.replace(/&/g, '%26')
|
||||||
|
.replace(/#/g, '%23')
|
||||||
|
.replace(/\s+/g, ' ');
|
||||||
|
var encodedData = ',' + newText;
|
||||||
|
if (encodedData.length < DATA.length) {
|
||||||
|
DATA = encodedData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '"data:' + MIME + DATA + '"';
|
||||||
|
}
|
||||||
|
enqueue(imagePath);
|
||||||
|
return url;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function _replaceURL(contents, replacer) {
|
||||||
|
// Use ")" as the terminator as quotes are oftentimes not used at all
|
||||||
|
return contents.replace(/url\(\s*([^\)]+)\s*\)?/g, function (_) {
|
||||||
|
var matches = [];
|
||||||
|
for (var _i = 1; _i < arguments.length; _i++) {
|
||||||
|
matches[_i - 1] = arguments[_i];
|
||||||
|
}
|
||||||
|
var url = matches[0];
|
||||||
|
// Eliminate starting quotes (the initial whitespace is not captured)
|
||||||
|
if (url.charAt(0) === '"' || url.charAt(0) === '\'') {
|
||||||
|
url = url.substring(1);
|
||||||
|
}
|
||||||
|
// The ending whitespace is captured
|
||||||
|
while (url.length > 0 && (url.charAt(url.length - 1) === ' ' || url.charAt(url.length - 1) === '\t')) {
|
||||||
|
url = url.substring(0, url.length - 1);
|
||||||
|
}
|
||||||
|
// Eliminate ending quotes
|
||||||
|
if (url.charAt(url.length - 1) === '"' || url.charAt(url.length - 1) === '\'') {
|
||||||
|
url = url.substring(0, url.length - 1);
|
||||||
|
}
|
||||||
|
if (!_startsWith(url, 'data:') && !_startsWith(url, 'http://') && !_startsWith(url, 'https://')) {
|
||||||
|
url = replacer(url);
|
||||||
|
}
|
||||||
|
return 'url(' + url + ')';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function _startsWith(haystack, needle) {
|
||||||
|
return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function transportResource(options, module, enqueue, write) {
|
||||||
|
if (!/\.svg/.test(module)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
write(module, fs.readFileSync(path.join(SRC_DIR, module)));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function transportDTS(options, module, enqueue, write) {
|
||||||
|
if (options.redirects[module] && fs.existsSync(path.join(SRC_DIR, options.redirects[module] + '.ts'))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!fs.existsSync(path.join(SRC_DIR, module + '.d.ts'))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
write(module + '.d.ts', fs.readFileSync(path.join(SRC_DIR, module + '.d.ts')));
|
||||||
|
var filename;
|
||||||
|
if (options.redirects[module]) {
|
||||||
|
write(module + '.js', fs.readFileSync(path.join(SRC_DIR, options.redirects[module] + '.js')));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
write(module + '.js', fs.readFileSync(path.join(SRC_DIR, module + '.js')));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
305
build/lib/standalone.ts
Normal file
305
build/lib/standalone.ts
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import * as ts from 'typescript';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
|
const SRC_DIR = path.join(REPO_ROOT, 'src');
|
||||||
|
const OUT_EDITOR = path.join(REPO_ROOT, 'out-editor');
|
||||||
|
|
||||||
|
export interface IOptions {
|
||||||
|
entryPoints: string[];
|
||||||
|
outFolder: string;
|
||||||
|
outResourcesFolder: string;
|
||||||
|
redirects: { [module: string]: string; };
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createESMSourcesAndResources(options: IOptions): void {
|
||||||
|
const OUT_FOLDER = path.join(REPO_ROOT, options.outFolder);
|
||||||
|
const OUT_RESOURCES_FOLDER = path.join(REPO_ROOT, options.outResourcesFolder);
|
||||||
|
|
||||||
|
let in_queue: { [module: string]: boolean; } = Object.create(null);
|
||||||
|
let queue: string[] = [];
|
||||||
|
|
||||||
|
const enqueue = (module: string) => {
|
||||||
|
if (in_queue[module]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
in_queue[module] = true;
|
||||||
|
queue.push(module);
|
||||||
|
};
|
||||||
|
|
||||||
|
const seenDir: { [key: string]: boolean; } = {};
|
||||||
|
const createDirectoryRecursive = (dir: string) => {
|
||||||
|
if (seenDir[dir]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let lastSlash = dir.lastIndexOf('/');
|
||||||
|
if (lastSlash === -1) {
|
||||||
|
lastSlash = dir.lastIndexOf('\\');
|
||||||
|
}
|
||||||
|
if (lastSlash !== -1) {
|
||||||
|
createDirectoryRecursive(dir.substring(0, lastSlash));
|
||||||
|
}
|
||||||
|
seenDir[dir] = true;
|
||||||
|
try { fs.mkdirSync(dir); } catch (err) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
seenDir[REPO_ROOT] = true;
|
||||||
|
|
||||||
|
const toggleComments = (fileContents: string) => {
|
||||||
|
let lines = fileContents.split(/\r\n|\r|\n/);
|
||||||
|
let mode = 0;
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
const line = lines[i];
|
||||||
|
|
||||||
|
if (mode === 0) {
|
||||||
|
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||||
|
mode = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (/\/\/ ESM-uncomment-begin/.test(line)) {
|
||||||
|
mode = 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode === 1) {
|
||||||
|
if (/\/\/ ESM-comment-end/.test(line)) {
|
||||||
|
mode = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lines[i] = '// ' + line;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode === 2) {
|
||||||
|
if (/\/\/ ESM-uncomment-end/.test(line)) {
|
||||||
|
mode = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lines[i] = line.replace(/^(\s*)\/\/ ?/, function (_, indent) {
|
||||||
|
return indent;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lines.join('\n');
|
||||||
|
};
|
||||||
|
|
||||||
|
const write = (filePath: string, contents: string | Buffer) => {
|
||||||
|
let absoluteFilePath: string;
|
||||||
|
if (/\.ts$/.test(filePath)) {
|
||||||
|
absoluteFilePath = path.join(OUT_FOLDER, filePath);
|
||||||
|
} else {
|
||||||
|
absoluteFilePath = path.join(OUT_RESOURCES_FOLDER, filePath);
|
||||||
|
}
|
||||||
|
createDirectoryRecursive(path.dirname(absoluteFilePath));
|
||||||
|
if (/(\.ts$)|(\.js$)/.test(filePath)) {
|
||||||
|
contents = toggleComments(contents.toString());
|
||||||
|
}
|
||||||
|
fs.writeFileSync(absoluteFilePath, contents);
|
||||||
|
};
|
||||||
|
|
||||||
|
options.entryPoints.forEach((entryPoint) => enqueue(entryPoint));
|
||||||
|
|
||||||
|
while (queue.length > 0) {
|
||||||
|
const module = queue.shift();
|
||||||
|
if (transportCSS(options, module, enqueue, write)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (transportResource(options, module, enqueue, write)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (transportDTS(options, module, enqueue, write)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let filename: string;
|
||||||
|
if (options.redirects[module]) {
|
||||||
|
filename = path.join(SRC_DIR, options.redirects[module] + '.ts');
|
||||||
|
} else {
|
||||||
|
filename = path.join(SRC_DIR, module + '.ts');
|
||||||
|
}
|
||||||
|
let fileContents = fs.readFileSync(filename).toString();
|
||||||
|
|
||||||
|
const info = ts.preProcessFile(fileContents);
|
||||||
|
|
||||||
|
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
||||||
|
const importedFilename = info.importedFiles[i].fileName;
|
||||||
|
const pos = info.importedFiles[i].pos;
|
||||||
|
const end = info.importedFiles[i].end;
|
||||||
|
|
||||||
|
let importedFilepath: string;
|
||||||
|
if (/^vs\/css!/.test(importedFilename)) {
|
||||||
|
importedFilepath = importedFilename.substr('vs/css!'.length) + '.css';
|
||||||
|
} else {
|
||||||
|
importedFilepath = importedFilename;
|
||||||
|
}
|
||||||
|
if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) {
|
||||||
|
importedFilepath = path.join(path.dirname(module), importedFilepath);
|
||||||
|
}
|
||||||
|
|
||||||
|
enqueue(importedFilepath);
|
||||||
|
|
||||||
|
let relativePath: string;
|
||||||
|
if (importedFilepath === path.dirname(module)) {
|
||||||
|
relativePath = '../' + path.basename(path.dirname(module));
|
||||||
|
} else if (importedFilepath === path.dirname(path.dirname(module))) {
|
||||||
|
relativePath = '../../' + path.basename(path.dirname(path.dirname(module)));
|
||||||
|
} else {
|
||||||
|
relativePath = path.relative(path.dirname(module), importedFilepath);
|
||||||
|
}
|
||||||
|
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
||||||
|
relativePath = './' + relativePath;
|
||||||
|
}
|
||||||
|
fileContents = (
|
||||||
|
fileContents.substring(0, pos + 1)
|
||||||
|
+ relativePath
|
||||||
|
+ fileContents.substring(end + 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fileContents = fileContents.replace(/import ([a-zA-z0-9]+) = require\(('[^']+')\);/g, function (_, m1, m2) {
|
||||||
|
return `import * as ${m1} from ${m2};`;
|
||||||
|
});
|
||||||
|
fileContents = fileContents.replace(/Thenable/g, 'PromiseLike');
|
||||||
|
|
||||||
|
write(module + '.ts', fileContents);
|
||||||
|
}
|
||||||
|
|
||||||
|
const esm_opts = {
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": path.relative(path.dirname(OUT_FOLDER), OUT_RESOURCES_FOLDER),
|
||||||
|
"rootDir": "src",
|
||||||
|
"module": "es6",
|
||||||
|
"target": "es5",
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"es5",
|
||||||
|
"es2015.collection",
|
||||||
|
"es2015.promise"
|
||||||
|
],
|
||||||
|
"types": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fs.writeFileSync(path.join(path.dirname(OUT_FOLDER), 'tsconfig.json'), JSON.stringify(esm_opts, null, '\t'));
|
||||||
|
|
||||||
|
const monacodts = fs.readFileSync(path.join(SRC_DIR, 'vs/monaco.d.ts')).toString();
|
||||||
|
fs.writeFileSync(path.join(OUT_FOLDER, 'vs/monaco.d.ts'), monacodts);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function transportCSS(options: IOptions, module: string, enqueue: (module: string) => void, write: (path: string, contents: string | Buffer) => void): boolean {
|
||||||
|
|
||||||
|
if (!/\.css/.test(module)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const filename = path.join(SRC_DIR, module);
|
||||||
|
const fileContents = fs.readFileSync(filename).toString();
|
||||||
|
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
|
||||||
|
const inlineResourcesLimit = 300000;//3000; // see https://github.com/Microsoft/monaco-editor/issues/336
|
||||||
|
|
||||||
|
const newContents = _rewriteOrInlineUrls(filename, fileContents, inlineResources === 'base64', inlineResourcesLimit);
|
||||||
|
write(module, newContents);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
function _rewriteOrInlineUrls(originalFileFSPath: string, contents: string, forceBase64: boolean, inlineByteLimit: number): string {
|
||||||
|
return _replaceURL(contents, (url) => {
|
||||||
|
let imagePath = path.join(path.dirname(module), url);
|
||||||
|
let fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
|
||||||
|
|
||||||
|
if (fileContents.length < inlineByteLimit) {
|
||||||
|
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
|
||||||
|
let DATA = ';base64,' + fileContents.toString('base64');
|
||||||
|
|
||||||
|
if (!forceBase64 && /\.svg$/.test(url)) {
|
||||||
|
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
|
||||||
|
let newText = fileContents.toString()
|
||||||
|
.replace(/"/g, '\'')
|
||||||
|
.replace(/</g, '%3C')
|
||||||
|
.replace(/>/g, '%3E')
|
||||||
|
.replace(/&/g, '%26')
|
||||||
|
.replace(/#/g, '%23')
|
||||||
|
.replace(/\s+/g, ' ');
|
||||||
|
let encodedData = ',' + newText;
|
||||||
|
if (encodedData.length < DATA.length) {
|
||||||
|
DATA = encodedData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '"data:' + MIME + DATA + '"';
|
||||||
|
}
|
||||||
|
|
||||||
|
enqueue(imagePath);
|
||||||
|
return url;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _replaceURL(contents: string, replacer: (url: string) => string): string {
|
||||||
|
// Use ")" as the terminator as quotes are oftentimes not used at all
|
||||||
|
return contents.replace(/url\(\s*([^\)]+)\s*\)?/g, (_: string, ...matches: string[]) => {
|
||||||
|
var url = matches[0];
|
||||||
|
// Eliminate starting quotes (the initial whitespace is not captured)
|
||||||
|
if (url.charAt(0) === '"' || url.charAt(0) === '\'') {
|
||||||
|
url = url.substring(1);
|
||||||
|
}
|
||||||
|
// The ending whitespace is captured
|
||||||
|
while (url.length > 0 && (url.charAt(url.length - 1) === ' ' || url.charAt(url.length - 1) === '\t')) {
|
||||||
|
url = url.substring(0, url.length - 1);
|
||||||
|
}
|
||||||
|
// Eliminate ending quotes
|
||||||
|
if (url.charAt(url.length - 1) === '"' || url.charAt(url.length - 1) === '\'') {
|
||||||
|
url = url.substring(0, url.length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_startsWith(url, 'data:') && !_startsWith(url, 'http://') && !_startsWith(url, 'https://')) {
|
||||||
|
url = replacer(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'url(' + url + ')';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _startsWith(haystack: string, needle: string): boolean {
|
||||||
|
return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function transportResource(options: IOptions, module: string, enqueue: (module: string) => void, write: (path: string, contents: string | Buffer) => void): boolean {
|
||||||
|
|
||||||
|
if (!/\.svg/.test(module)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
write(module, fs.readFileSync(path.join(SRC_DIR, module)));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function transportDTS(options: IOptions, module: string, enqueue: (module: string) => void, write: (path: string, contents: string | Buffer) => void): boolean {
|
||||||
|
|
||||||
|
if (options.redirects[module] && fs.existsSync(path.join(SRC_DIR, options.redirects[module] + '.ts'))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(path.join(SRC_DIR, module + '.d.ts'))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
write(module + '.d.ts', fs.readFileSync(path.join(SRC_DIR, module + '.d.ts')));
|
||||||
|
let filename: string;
|
||||||
|
if (options.redirects[module]) {
|
||||||
|
write(module + '.js', fs.readFileSync(path.join(SRC_DIR, options.redirects[module] + '.js')));
|
||||||
|
} else {
|
||||||
|
write(module + '.js', fs.readFileSync(path.join(SRC_DIR, module + '.js')));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
56
build/lib/test/util.test.js
Normal file
56
build/lib/test/util.test.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var assert = require("assert");
|
||||||
|
var util = require("../util");
|
||||||
|
function getMockTagExists(tags) {
|
||||||
|
return function (tag) { return tags.indexOf(tag) >= 0; };
|
||||||
|
}
|
||||||
|
suite('util tests', function () {
|
||||||
|
test('getPreviousVersion - patch', function () {
|
||||||
|
assert.equal(util.getPreviousVersion('1.2.3', getMockTagExists(['1.2.2', '1.2.1', '1.2.0', '1.1.0'])), '1.2.2');
|
||||||
|
});
|
||||||
|
test('getPreviousVersion - patch invalid', function () {
|
||||||
|
try {
|
||||||
|
util.getPreviousVersion('1.2.2', getMockTagExists(['1.2.0', '1.1.0']));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Error('Expected an exception');
|
||||||
|
});
|
||||||
|
test('getPreviousVersion - minor', function () {
|
||||||
|
assert.equal(util.getPreviousVersion('1.2.0', getMockTagExists(['1.1.0', '1.1.1', '1.1.2', '1.1.3'])), '1.1.3');
|
||||||
|
assert.equal(util.getPreviousVersion('1.2.0', getMockTagExists(['1.1.0', '1.0.0'])), '1.1.0');
|
||||||
|
});
|
||||||
|
test('getPreviousVersion - minor gap', function () {
|
||||||
|
assert.equal(util.getPreviousVersion('1.2.0', getMockTagExists(['1.1.0', '1.1.1', '1.1.3'])), '1.1.1');
|
||||||
|
});
|
||||||
|
test('getPreviousVersion - minor invalid', function () {
|
||||||
|
try {
|
||||||
|
util.getPreviousVersion('1.2.0', getMockTagExists(['1.0.0']));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Error('Expected an exception');
|
||||||
|
});
|
||||||
|
test('getPreviousVersion - major', function () {
|
||||||
|
assert.equal(util.getPreviousVersion('2.0.0', getMockTagExists(['1.0.0', '1.1.0', '1.2.0', '1.2.1', '1.2.2'])), '1.2.2');
|
||||||
|
});
|
||||||
|
test('getPreviousVersion - major invalid', function () {
|
||||||
|
try {
|
||||||
|
util.getPreviousVersion('3.0.0', getMockTagExists(['1.0.0']));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Error('Expected an exception');
|
||||||
|
});
|
||||||
|
});
|
||||||
79
build/lib/test/util.test.ts
Normal file
79
build/lib/test/util.test.ts
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import assert = require('assert');
|
||||||
|
import util = require('../util');
|
||||||
|
|
||||||
|
function getMockTagExists(tags: string[]) {
|
||||||
|
return (tag: string) => tags.indexOf(tag) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
suite('util tests', () => {
|
||||||
|
test('getPreviousVersion - patch', () => {
|
||||||
|
assert.equal(
|
||||||
|
util.getPreviousVersion('1.2.3', getMockTagExists(['1.2.2', '1.2.1', '1.2.0', '1.1.0'])),
|
||||||
|
'1.2.2'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('getPreviousVersion - patch invalid', () => {
|
||||||
|
try {
|
||||||
|
util.getPreviousVersion('1.2.2', getMockTagExists(['1.2.0', '1.1.0']));
|
||||||
|
} catch (e) {
|
||||||
|
// expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Expected an exception');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('getPreviousVersion - minor', () => {
|
||||||
|
assert.equal(
|
||||||
|
util.getPreviousVersion('1.2.0', getMockTagExists(['1.1.0', '1.1.1', '1.1.2', '1.1.3'])),
|
||||||
|
'1.1.3'
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
util.getPreviousVersion('1.2.0', getMockTagExists(['1.1.0', '1.0.0'])),
|
||||||
|
'1.1.0'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('getPreviousVersion - minor gap', () => {
|
||||||
|
assert.equal(
|
||||||
|
util.getPreviousVersion('1.2.0', getMockTagExists(['1.1.0', '1.1.1', '1.1.3'])),
|
||||||
|
'1.1.1'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('getPreviousVersion - minor invalid', () => {
|
||||||
|
try {
|
||||||
|
util.getPreviousVersion('1.2.0', getMockTagExists(['1.0.0']));
|
||||||
|
} catch (e) {
|
||||||
|
// expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Expected an exception');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('getPreviousVersion - major', () => {
|
||||||
|
assert.equal(
|
||||||
|
util.getPreviousVersion('2.0.0', getMockTagExists(['1.0.0', '1.1.0', '1.2.0', '1.2.1', '1.2.2'])),
|
||||||
|
'1.2.2'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('getPreviousVersion - major invalid', () => {
|
||||||
|
try {
|
||||||
|
util.getPreviousVersion('3.0.0', getMockTagExists(['1.0.0']));
|
||||||
|
} catch (e) {
|
||||||
|
// expected
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Expected an exception');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -71,7 +71,7 @@ var TranslationRemindRuleWalker = /** @class */ (function (_super) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!resourceDefined) {
|
if (!resourceDefined) {
|
||||||
this.addFailureAtNode(node, "Please add '" + resource + "' to ./builds/lib/i18n.resources.json file to use translations here.");
|
this.addFailureAtNode(node, "Please add '" + resource + "' to ./build/lib/i18n.resources.json file to use translations here.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
TranslationRemindRuleWalker.NLS_MODULE = 'vs/nls';
|
TranslationRemindRuleWalker.NLS_MODULE = 'vs/nls';
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!resourceDefined) {
|
if (!resourceDefined) {
|
||||||
this.addFailureAtNode(node, `Please add '${resource}' to ./builds/lib/i18n.resources.json file to use translations here.`);
|
this.addFailureAtNode(node, `Please add '${resource}' to ./build/lib/i18n.resources.json file to use translations here.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ var fs = require("fs");
|
|||||||
var _rimraf = require("rimraf");
|
var _rimraf = require("rimraf");
|
||||||
var git = require("./git");
|
var git = require("./git");
|
||||||
var VinylFile = require("vinyl");
|
var VinylFile = require("vinyl");
|
||||||
|
var cp = require("child_process");
|
||||||
var NoCancellationToken = { isCancellationRequested: function () { return false; } };
|
var NoCancellationToken = { isCancellationRequested: function () { return false; } };
|
||||||
function incremental(streamProvider, initial, supportsCancellation) {
|
function incremental(streamProvider, initial, supportsCancellation) {
|
||||||
var input = es.through();
|
var input = es.through();
|
||||||
@@ -210,3 +211,68 @@ function filter(fn) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
exports.filter = filter;
|
exports.filter = filter;
|
||||||
|
function tagExists(tagName) {
|
||||||
|
try {
|
||||||
|
cp.execSync("git rev-parse " + tagName, { stdio: 'ignore' });
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the version previous to the given version. Throws if a git tag for that version doesn't exist.
|
||||||
|
* Given 1.17.2, return 1.17.1
|
||||||
|
* 1.18.0 => 1.17.2. (or the highest 1.17.x)
|
||||||
|
* 2.0.0 => 1.18.0 (or the highest 1.x)
|
||||||
|
*/
|
||||||
|
function getPreviousVersion(versionStr, _tagExists) {
|
||||||
|
if (_tagExists === void 0) { _tagExists = tagExists; }
|
||||||
|
function getLatestTagFromBase(semverArr, componentToTest) {
|
||||||
|
var baseVersion = semverArr.join('.');
|
||||||
|
if (!_tagExists(baseVersion)) {
|
||||||
|
throw new Error('Failed to find git tag for base version, ' + baseVersion);
|
||||||
|
}
|
||||||
|
var goodTag;
|
||||||
|
do {
|
||||||
|
goodTag = semverArr.join('.');
|
||||||
|
semverArr[componentToTest]++;
|
||||||
|
} while (_tagExists(semverArr.join('.')));
|
||||||
|
return goodTag;
|
||||||
|
}
|
||||||
|
var semverArr = versionStringToNumberArray(versionStr);
|
||||||
|
if (semverArr[2] > 0) {
|
||||||
|
semverArr[2]--;
|
||||||
|
var previous = semverArr.join('.');
|
||||||
|
if (!_tagExists(previous)) {
|
||||||
|
throw new Error('Failed to find git tag for previous version, ' + previous);
|
||||||
|
}
|
||||||
|
return previous;
|
||||||
|
}
|
||||||
|
else if (semverArr[1] > 0) {
|
||||||
|
semverArr[1]--;
|
||||||
|
return getLatestTagFromBase(semverArr, 2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
semverArr[0]--;
|
||||||
|
// Find 1.x.0 for latest x
|
||||||
|
var latestMinorVersion = getLatestTagFromBase(semverArr, 1);
|
||||||
|
// Find 1.x.y for latest y
|
||||||
|
return getLatestTagFromBase(versionStringToNumberArray(latestMinorVersion), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.getPreviousVersion = getPreviousVersion;
|
||||||
|
function versionStringToNumberArray(versionStr) {
|
||||||
|
return versionStr
|
||||||
|
.split('.')
|
||||||
|
.map(function (s) { return parseInt(s); });
|
||||||
|
}
|
||||||
|
function versionStringToNumber(versionStr) {
|
||||||
|
var semverRegex = /(\d+)\.(\d+)\.(\d+)/;
|
||||||
|
var match = versionStr.match(semverRegex);
|
||||||
|
if (!match) {
|
||||||
|
throw new Error('Version string is not properly formatted: ' + versionStr);
|
||||||
|
}
|
||||||
|
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||||
|
}
|
||||||
|
exports.versionStringToNumber = versionStringToNumber;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import * as git from './git';
|
|||||||
import * as VinylFile from 'vinyl';
|
import * as VinylFile from 'vinyl';
|
||||||
import { ThroughStream } from 'through';
|
import { ThroughStream } from 'through';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
|
||||||
export interface ICancellationToken {
|
export interface ICancellationToken {
|
||||||
isCancellationRequested(): boolean;
|
isCancellationRequested(): boolean;
|
||||||
@@ -269,3 +270,73 @@ export function filter(fn: (data: any) => boolean): FilterStream {
|
|||||||
result.restore = es.through();
|
result.restore = es.through();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function tagExists(tagName: string): boolean {
|
||||||
|
try {
|
||||||
|
cp.execSync(`git rev-parse ${tagName}`, { stdio: 'ignore' });
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the version previous to the given version. Throws if a git tag for that version doesn't exist.
|
||||||
|
* Given 1.17.2, return 1.17.1
|
||||||
|
* 1.18.0 => 1.17.2. (or the highest 1.17.x)
|
||||||
|
* 2.0.0 => 1.18.0 (or the highest 1.x)
|
||||||
|
*/
|
||||||
|
export function getPreviousVersion(versionStr: string, _tagExists = tagExists) {
|
||||||
|
function getLatestTagFromBase(semverArr: number[], componentToTest: number): string {
|
||||||
|
const baseVersion = semverArr.join('.');
|
||||||
|
if (!_tagExists(baseVersion)) {
|
||||||
|
throw new Error('Failed to find git tag for base version, ' + baseVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
let goodTag;
|
||||||
|
do {
|
||||||
|
goodTag = semverArr.join('.');
|
||||||
|
semverArr[componentToTest]++;
|
||||||
|
} while (_tagExists(semverArr.join('.')));
|
||||||
|
|
||||||
|
return goodTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
const semverArr = versionStringToNumberArray(versionStr);
|
||||||
|
if (semverArr[2] > 0) {
|
||||||
|
semverArr[2]--;
|
||||||
|
const previous = semverArr.join('.');
|
||||||
|
if (!_tagExists(previous)) {
|
||||||
|
throw new Error('Failed to find git tag for previous version, ' + previous);
|
||||||
|
}
|
||||||
|
|
||||||
|
return previous;
|
||||||
|
} else if (semverArr[1] > 0) {
|
||||||
|
semverArr[1]--;
|
||||||
|
return getLatestTagFromBase(semverArr, 2);
|
||||||
|
} else {
|
||||||
|
semverArr[0]--;
|
||||||
|
|
||||||
|
// Find 1.x.0 for latest x
|
||||||
|
const latestMinorVersion = getLatestTagFromBase(semverArr, 1);
|
||||||
|
|
||||||
|
// Find 1.x.y for latest y
|
||||||
|
return getLatestTagFromBase(versionStringToNumberArray(latestMinorVersion), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function versionStringToNumberArray(versionStr: string): number[] {
|
||||||
|
return versionStr
|
||||||
|
.split('.')
|
||||||
|
.map(s => parseInt(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function versionStringToNumber(versionStr: string) {
|
||||||
|
const semverRegex = /(\d+)\.(\d+)\.(\d+)/;
|
||||||
|
const match = versionStr.match(semverRegex);
|
||||||
|
if (!match) {
|
||||||
|
throw new Error('Version string is not properly formatted: ' + versionStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The Source EULA
|
The Source EULA
|
||||||
|
|
||||||
Copyright (c) 2016 Microsoft Corporation
|
Copyright (c) 2016 - present Microsoft Corporation
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ END OF winjs NOTICES AND INFORMATION
|
|||||||
|
|
||||||
%% string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
|
%% string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
|
||||||
=========================================
|
=========================================
|
||||||
This software is released under the Source EULA:
|
This software is released under the MIT license:
|
||||||
|
|
||||||
Copyright (c) Joshaven Potter
|
Copyright (c) Joshaven Potter
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ END OF string_scorer NOTICES AND INFORMATION
|
|||||||
|
|
||||||
%% chjj-marked NOTICES AND INFORMATION BEGIN HERE
|
%% chjj-marked NOTICES AND INFORMATION BEGIN HERE
|
||||||
=========================================
|
=========================================
|
||||||
The Source EULA
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)
|
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)
|
||||||
|
|
||||||
|
|||||||
@@ -171,9 +171,7 @@ function format(text) {
|
|||||||
function getRuleProvider(options) {
|
function getRuleProvider(options) {
|
||||||
// Share this between multiple formatters using the same options.
|
// Share this between multiple formatters using the same options.
|
||||||
// This represents the bulk of the space the formatter uses.
|
// This represents the bulk of the space the formatter uses.
|
||||||
var ruleProvider = new ts.formatting.RulesProvider();
|
return ts.formatting.getFormatContext(options);
|
||||||
ruleProvider.ensureUpToDate(options);
|
|
||||||
return ruleProvider;
|
|
||||||
}
|
}
|
||||||
function applyEdits(text, edits) {
|
function applyEdits(text, edits) {
|
||||||
// Apply edits in reverse on the existing text
|
// Apply edits in reverse on the existing text
|
||||||
@@ -210,7 +208,8 @@ function createReplacer(data) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
function generateDeclarationFile(out, inputFiles, recipe) {
|
function generateDeclarationFile(out, inputFiles, recipe) {
|
||||||
var lines = recipe.split(/\r\n|\n|\r/);
|
var endl = /\r\n/.test(recipe) ? '\r\n' : '\n';
|
||||||
|
var lines = recipe.split(endl);
|
||||||
var result = [];
|
var result = [];
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||||
@@ -278,12 +277,11 @@ function generateDeclarationFile(out, inputFiles, recipe) {
|
|||||||
}
|
}
|
||||||
result.push(line);
|
result.push(line);
|
||||||
});
|
});
|
||||||
var resultTxt = result.join('\n');
|
var resultTxt = result.join(endl);
|
||||||
resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri');
|
resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri');
|
||||||
resultTxt = resultTxt.replace(/\bEvent</g, 'IEvent<');
|
resultTxt = resultTxt.replace(/\bEvent</g, 'IEvent<');
|
||||||
resultTxt = resultTxt.replace(/\bTPromise</g, 'Promise<');
|
resultTxt = resultTxt.replace(/\bTPromise</g, 'Promise<');
|
||||||
resultTxt = format(resultTxt);
|
resultTxt = format(resultTxt);
|
||||||
resultTxt = resultTxt.replace(/\r\n/g, '\n');
|
|
||||||
return resultTxt;
|
return resultTxt;
|
||||||
}
|
}
|
||||||
function getFilesToWatch(out) {
|
function getFilesToWatch(out) {
|
||||||
@@ -314,10 +312,13 @@ function run(out, inputFiles) {
|
|||||||
var result = generateDeclarationFile(out, inputFiles, recipe);
|
var result = generateDeclarationFile(out, inputFiles, recipe);
|
||||||
var currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
var currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
||||||
log('Finished monaco.d.ts generation');
|
log('Finished monaco.d.ts generation');
|
||||||
|
var one = currentContent.replace(/\r\n/gm, '\n');
|
||||||
|
var other = result.replace(/\r\n/gm, '\n');
|
||||||
|
var isTheSame = one === other;
|
||||||
return {
|
return {
|
||||||
content: result,
|
content: result,
|
||||||
filePath: DECLARATION_PATH,
|
filePath: DECLARATION_PATH,
|
||||||
isTheSame: currentContent === result
|
isTheSame: isTheSame
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.run = run;
|
exports.run = run;
|
||||||
|
|||||||
@@ -24,15 +24,15 @@ function logErr(message: any, ...rest: any[]): void {
|
|||||||
util.log(util.colors.red('[monaco.d.ts]'), message, ...rest);
|
util.log(util.colors.red('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
function moduleIdToPath(out:string, moduleId:string): string {
|
function moduleIdToPath(out: string, moduleId: string): string {
|
||||||
if (/\.d\.ts/.test(moduleId)) {
|
if (/\.d\.ts/.test(moduleId)) {
|
||||||
return path.join(SRC, moduleId);
|
return path.join(SRC, moduleId);
|
||||||
}
|
}
|
||||||
return path.join(OUT_ROOT, out, moduleId) + '.d.ts';
|
return path.join(OUT_ROOT, out, moduleId) + '.d.ts';
|
||||||
}
|
}
|
||||||
|
|
||||||
let SOURCE_FILE_MAP: {[moduleId:string]:ts.SourceFile;} = {};
|
let SOURCE_FILE_MAP: { [moduleId: string]: ts.SourceFile; } = {};
|
||||||
function getSourceFile(out:string, inputFiles: { [file: string]: string; }, moduleId:string): ts.SourceFile {
|
function getSourceFile(out: string, inputFiles: { [file: string]: string; }, moduleId: string): ts.SourceFile {
|
||||||
if (!SOURCE_FILE_MAP[moduleId]) {
|
if (!SOURCE_FILE_MAP[moduleId]) {
|
||||||
let filePath = path.normalize(moduleIdToPath(out, moduleId));
|
let filePath = path.normalize(moduleIdToPath(out, moduleId));
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ function getSourceFile(out:string, inputFiles: { [file: string]: string; }, modu
|
|||||||
type TSTopLevelDeclaration = ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ClassDeclaration | ts.TypeAliasDeclaration | ts.FunctionDeclaration | ts.ModuleDeclaration;
|
type TSTopLevelDeclaration = ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ClassDeclaration | ts.TypeAliasDeclaration | ts.FunctionDeclaration | ts.ModuleDeclaration;
|
||||||
type TSTopLevelDeclare = TSTopLevelDeclaration | ts.VariableStatement;
|
type TSTopLevelDeclare = TSTopLevelDeclaration | ts.VariableStatement;
|
||||||
|
|
||||||
function isDeclaration(a:TSTopLevelDeclare): a is TSTopLevelDeclaration {
|
function isDeclaration(a: TSTopLevelDeclare): a is TSTopLevelDeclaration {
|
||||||
return (
|
return (
|
||||||
a.kind === ts.SyntaxKind.InterfaceDeclaration
|
a.kind === ts.SyntaxKind.InterfaceDeclaration
|
||||||
|| a.kind === ts.SyntaxKind.EnumDeclaration
|
|| a.kind === ts.SyntaxKind.EnumDeclaration
|
||||||
@@ -64,7 +64,7 @@ function isDeclaration(a:TSTopLevelDeclare): a is TSTopLevelDeclaration {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function visitTopLevelDeclarations(sourceFile:ts.SourceFile, visitor:(node:TSTopLevelDeclare)=>boolean): void {
|
function visitTopLevelDeclarations(sourceFile: ts.SourceFile, visitor: (node: TSTopLevelDeclare) => boolean): void {
|
||||||
let stop = false;
|
let stop = false;
|
||||||
|
|
||||||
let visit = (node: ts.Node): void => {
|
let visit = (node: ts.Node): void => {
|
||||||
@@ -100,8 +100,8 @@ function visitTopLevelDeclarations(sourceFile:ts.SourceFile, visitor:(node:TSTop
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getAllTopLevelDeclarations(sourceFile:ts.SourceFile): TSTopLevelDeclare[] {
|
function getAllTopLevelDeclarations(sourceFile: ts.SourceFile): TSTopLevelDeclare[] {
|
||||||
let all:TSTopLevelDeclare[] = [];
|
let all: TSTopLevelDeclare[] = [];
|
||||||
visitTopLevelDeclarations(sourceFile, (node) => {
|
visitTopLevelDeclarations(sourceFile, (node) => {
|
||||||
if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) {
|
if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) {
|
||||||
let interfaceDeclaration = <ts.InterfaceDeclaration>node;
|
let interfaceDeclaration = <ts.InterfaceDeclaration>node;
|
||||||
@@ -128,8 +128,8 @@ function getAllTopLevelDeclarations(sourceFile:ts.SourceFile): TSTopLevelDeclare
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getTopLevelDeclaration(sourceFile:ts.SourceFile, typeName:string): TSTopLevelDeclare {
|
function getTopLevelDeclaration(sourceFile: ts.SourceFile, typeName: string): TSTopLevelDeclare {
|
||||||
let result:TSTopLevelDeclare = null;
|
let result: TSTopLevelDeclare = null;
|
||||||
visitTopLevelDeclarations(sourceFile, (node) => {
|
visitTopLevelDeclarations(sourceFile, (node) => {
|
||||||
if (isDeclaration(node)) {
|
if (isDeclaration(node)) {
|
||||||
if (node.name.text === typeName) {
|
if (node.name.text === typeName) {
|
||||||
@@ -149,12 +149,12 @@ function getTopLevelDeclaration(sourceFile:ts.SourceFile, typeName:string): TSTo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getNodeText(sourceFile:ts.SourceFile, node:{pos:number; end:number;}): string {
|
function getNodeText(sourceFile: ts.SourceFile, node: { pos: number; end: number; }): string {
|
||||||
return sourceFile.getFullText().substring(node.pos, node.end);
|
return sourceFile.getFullText().substring(node.pos, node.end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getMassagedTopLevelDeclarationText(sourceFile:ts.SourceFile, declaration: TSTopLevelDeclare): string {
|
function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declaration: TSTopLevelDeclare): string {
|
||||||
let result = getNodeText(sourceFile, declaration);
|
let result = getNodeText(sourceFile, declaration);
|
||||||
// if (result.indexOf('MonacoWorker') >= 0) {
|
// if (result.indexOf('MonacoWorker') >= 0) {
|
||||||
// console.log('here!');
|
// console.log('here!');
|
||||||
@@ -163,7 +163,7 @@ function getMassagedTopLevelDeclarationText(sourceFile:ts.SourceFile, declaratio
|
|||||||
if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) {
|
if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) {
|
||||||
let interfaceDeclaration = <ts.InterfaceDeclaration | ts.ClassDeclaration>declaration;
|
let interfaceDeclaration = <ts.InterfaceDeclaration | ts.ClassDeclaration>declaration;
|
||||||
|
|
||||||
let members:ts.NodeArray<ts.Node> = interfaceDeclaration.members;
|
let members: ts.NodeArray<ts.Node> = interfaceDeclaration.members;
|
||||||
members.forEach((member) => {
|
members.forEach((member) => {
|
||||||
try {
|
try {
|
||||||
let memberText = getNodeText(sourceFile, member);
|
let memberText = getNodeText(sourceFile, member);
|
||||||
@@ -182,7 +182,7 @@ function getMassagedTopLevelDeclarationText(sourceFile:ts.SourceFile, declaratio
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function format(text:string): string {
|
function format(text: string): string {
|
||||||
|
|
||||||
// Parse the source text
|
// Parse the source text
|
||||||
let sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true);
|
let sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true);
|
||||||
@@ -196,9 +196,7 @@ function format(text:string): string {
|
|||||||
function getRuleProvider(options: ts.FormatCodeSettings) {
|
function getRuleProvider(options: ts.FormatCodeSettings) {
|
||||||
// Share this between multiple formatters using the same options.
|
// Share this between multiple formatters using the same options.
|
||||||
// This represents the bulk of the space the formatter uses.
|
// This represents the bulk of the space the formatter uses.
|
||||||
let ruleProvider = new (<any>ts).formatting.RulesProvider();
|
return (ts as any).formatting.getFormatContext(options);
|
||||||
ruleProvider.ensureUpToDate(options);
|
|
||||||
return ruleProvider;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyEdits(text: string, edits: ts.TextChange[]): string {
|
function applyEdits(text: string, edits: ts.TextChange[]): string {
|
||||||
@@ -214,10 +212,10 @@ function format(text:string): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createReplacer(data:string): (str:string)=>string {
|
function createReplacer(data: string): (str: string) => string {
|
||||||
data = data || '';
|
data = data || '';
|
||||||
let rawDirectives = data.split(';');
|
let rawDirectives = data.split(';');
|
||||||
let directives: [RegExp,string][] = [];
|
let directives: [RegExp, string][] = [];
|
||||||
rawDirectives.forEach((rawDirective) => {
|
rawDirectives.forEach((rawDirective) => {
|
||||||
if (rawDirective.length === 0) {
|
if (rawDirective.length === 0) {
|
||||||
return;
|
return;
|
||||||
@@ -231,7 +229,7 @@ function createReplacer(data:string): (str:string)=>string {
|
|||||||
directives.push([new RegExp(findStr, 'g'), replaceStr]);
|
directives.push([new RegExp(findStr, 'g'), replaceStr]);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (str:string)=> {
|
return (str: string) => {
|
||||||
for (let i = 0; i < directives.length; i++) {
|
for (let i = 0; i < directives.length; i++) {
|
||||||
str = str.replace(directives[i][0], directives[i][1]);
|
str = str.replace(directives[i][0], directives[i][1]);
|
||||||
}
|
}
|
||||||
@@ -239,10 +237,11 @@ function createReplacer(data:string): (str:string)=>string {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateDeclarationFile(out: string, inputFiles: { [file: string]: string; }, recipe:string): string {
|
function generateDeclarationFile(out: string, inputFiles: { [file: string]: string; }, recipe: string): string {
|
||||||
let lines = recipe.split(/\r\n|\n|\r/);
|
const endl = /\r\n/.test(recipe) ? '\r\n' : '\n';
|
||||||
let result = [];
|
|
||||||
|
|
||||||
|
let lines = recipe.split(endl);
|
||||||
|
let result = [];
|
||||||
|
|
||||||
lines.forEach(line => {
|
lines.forEach(line => {
|
||||||
|
|
||||||
@@ -285,7 +284,7 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
|||||||
let replacer = createReplacer(m2[2]);
|
let replacer = createReplacer(m2[2]);
|
||||||
|
|
||||||
let typeNames = m2[3].split(/,/);
|
let typeNames = m2[3].split(/,/);
|
||||||
let typesToExcludeMap: {[typeName:string]:boolean;} = {};
|
let typesToExcludeMap: { [typeName: string]: boolean; } = {};
|
||||||
let typesToExcludeArr: string[] = [];
|
let typesToExcludeArr: string[] = [];
|
||||||
typeNames.forEach((typeName) => {
|
typeNames.forEach((typeName) => {
|
||||||
typeName = typeName.trim();
|
typeName = typeName.trim();
|
||||||
@@ -318,18 +317,17 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
|||||||
result.push(line);
|
result.push(line);
|
||||||
});
|
});
|
||||||
|
|
||||||
let resultTxt = result.join('\n');
|
let resultTxt = result.join(endl);
|
||||||
resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri');
|
resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri');
|
||||||
resultTxt = resultTxt.replace(/\bEvent</g, 'IEvent<');
|
resultTxt = resultTxt.replace(/\bEvent</g, 'IEvent<');
|
||||||
resultTxt = resultTxt.replace(/\bTPromise</g, 'Promise<');
|
resultTxt = resultTxt.replace(/\bTPromise</g, 'Promise<');
|
||||||
|
|
||||||
resultTxt = format(resultTxt);
|
resultTxt = format(resultTxt);
|
||||||
|
|
||||||
resultTxt = resultTxt.replace(/\r\n/g, '\n');
|
|
||||||
return resultTxt;
|
return resultTxt;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFilesToWatch(out:string): string[] {
|
export function getFilesToWatch(out: string): string[] {
|
||||||
let recipe = fs.readFileSync(RECIPE_PATH).toString();
|
let recipe = fs.readFileSync(RECIPE_PATH).toString();
|
||||||
let lines = recipe.split(/\r\n|\n|\r/);
|
let lines = recipe.split(/\r\n|\n|\r/);
|
||||||
let result = [];
|
let result = [];
|
||||||
@@ -370,10 +368,14 @@ export function run(out: string, inputFiles: { [file: string]: string; }): IMona
|
|||||||
let currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
let currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
||||||
log('Finished monaco.d.ts generation');
|
log('Finished monaco.d.ts generation');
|
||||||
|
|
||||||
|
const one = currentContent.replace(/\r\n/gm, '\n');
|
||||||
|
const other = result.replace(/\r\n/gm, '\n');
|
||||||
|
const isTheSame = one === other;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: result,
|
content: result,
|
||||||
filePath: DECLARATION_PATH,
|
filePath: DECLARATION_PATH,
|
||||||
isTheSame: currentContent === result
|
isTheSame
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
declare module monaco {
|
declare namespace monaco {
|
||||||
|
|
||||||
type Thenable<T> = PromiseLike<T>;
|
export type Thenable<T> = PromiseLike<T>;
|
||||||
|
|
||||||
export interface IDisposable {
|
export interface IDisposable {
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
@@ -32,6 +32,14 @@ declare module monaco {
|
|||||||
Error = 3,
|
Error = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum MarkerSeverity {
|
||||||
|
Hint = 1,
|
||||||
|
Info = 2,
|
||||||
|
Warning = 4,
|
||||||
|
Error = 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, Promise
|
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, Promise
|
||||||
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
||||||
#include(vs/base/common/uri): URI, UriComponents
|
#include(vs/base/common/uri): URI, UriComponents
|
||||||
@@ -46,7 +54,7 @@ declare module monaco {
|
|||||||
#include(vs/editor/common/core/token): Token
|
#include(vs/editor/common/core/token): Token
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.editor {
|
declare namespace monaco.editor {
|
||||||
|
|
||||||
#includeAll(vs/editor/standalone/browser/standaloneEditor;modes.=>languages.;editorCommon.=>):
|
#includeAll(vs/editor/standalone/browser/standaloneEditor;modes.=>languages.;editorCommon.=>):
|
||||||
#include(vs/editor/standalone/common/standaloneThemeService): BuiltinTheme, IStandaloneThemeData, IColors
|
#include(vs/editor/standalone/common/standaloneThemeService): BuiltinTheme, IStandaloneThemeData, IColors
|
||||||
@@ -58,7 +66,7 @@ export interface ICommandHandler {
|
|||||||
}
|
}
|
||||||
#include(vs/platform/contextkey/common/contextkey): IContextKey
|
#include(vs/platform/contextkey/common/contextkey): IContextKey
|
||||||
#include(vs/editor/standalone/browser/standaloneServices): IEditorOverrideServices
|
#include(vs/editor/standalone/browser/standaloneServices): IEditorOverrideServices
|
||||||
#include(vs/platform/markers/common/markers): IMarker, IMarkerData
|
#include(vs/platform/markers/common/markers): IMarker, IMarkerData, IRelatedInformation
|
||||||
#include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions
|
#include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions
|
||||||
#include(vs/base/common/scrollable): ScrollbarVisibility
|
#include(vs/base/common/scrollable): ScrollbarVisibility
|
||||||
#include(vs/platform/theme/common/themeService): ThemeColor
|
#include(vs/platform/theme/common/themeService): ThemeColor
|
||||||
@@ -75,7 +83,7 @@ export type IReadOnlyModel = ITextModel;
|
|||||||
export type IModel = ITextModel;
|
export type IModel = ITextModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.languages {
|
declare namespace monaco.languages {
|
||||||
|
|
||||||
#includeAll(vs/editor/standalone/browser/standaloneLanguages;modes.=>;editorCommon.=>editor.;model.=>editor.;IMarkerData=>editor.IMarkerData):
|
#includeAll(vs/editor/standalone/browser/standaloneLanguages;modes.=>;editorCommon.=>editor.;model.=>editor.;IMarkerData=>editor.IMarkerData):
|
||||||
#includeAll(vs/editor/common/modes/languageConfiguration):
|
#includeAll(vs/editor/common/modes/languageConfiguration):
|
||||||
@@ -85,7 +93,7 @@ declare module monaco.languages {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module monaco.worker {
|
declare namespace monaco.worker {
|
||||||
|
|
||||||
#includeAll(vs/editor/common/services/editorSimpleWorker;):
|
#includeAll(vs/editor/common/services/editorSimpleWorker;):
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "monaco-editor-core",
|
"name": "monaco-editor-core",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.9.0",
|
"version": "0.12.0",
|
||||||
"description": "A browser based code editor",
|
"description": "A browser based code editor",
|
||||||
"author": "Microsoft Corporation",
|
"author": "Microsoft Corporation",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"typings": "./esm/vs/editor/editor.api.d.ts",
|
||||||
|
"module": "./esm/vs/editor/editor.main.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Microsoft/vscode"
|
"url": "https://github.com/Microsoft/vscode"
|
||||||
|
|||||||
@@ -23,21 +23,15 @@ function yarnInstall(location, opts) {
|
|||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
yarnInstall('extensions'); // node modules shared by all extensions
|
yarnInstall('extensions'); // node modules shared by all extensions
|
||||||
|
|
||||||
const extensions = [
|
const allExtensionFolders = fs.readdirSync('extensions');
|
||||||
'vscode-colorize-tests',
|
const extensions = allExtensionFolders.filter(e => {
|
||||||
'json',
|
try {
|
||||||
'mssql',
|
let packageJSON = JSON.parse(fs.readFileSync(path.join('extensions', e, 'package.json')).toString());
|
||||||
'configuration-editing',
|
return packageJSON && (packageJSON.dependencies || packageJSON.devDependencies);
|
||||||
'extension-editing',
|
} catch (e) {
|
||||||
'markdown',
|
return false;
|
||||||
'markdown-basics',
|
}
|
||||||
'git',
|
});
|
||||||
'merge-conflict',
|
|
||||||
'insights-default',
|
|
||||||
'account-provider-azure',
|
|
||||||
'agent',
|
|
||||||
'profiler'
|
|
||||||
];
|
|
||||||
|
|
||||||
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
|
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"@types/mime": "0.0.29",
|
"@types/mime": "0.0.29",
|
||||||
"@types/node": "8.0.33",
|
"@types/node": "8.0.33",
|
||||||
"@types/xml2js": "0.0.33",
|
"@types/xml2js": "0.0.33",
|
||||||
|
"@types/request": "^2.47.0",
|
||||||
"azure-storage": "^2.1.0",
|
"azure-storage": "^2.1.0",
|
||||||
"decompress": "^4.2.0",
|
"decompress": "^4.2.0",
|
||||||
"documentdb": "1.13.0",
|
"documentdb": "1.13.0",
|
||||||
@@ -16,9 +17,11 @@
|
|||||||
"fs-extra-promise": "^1.0.1",
|
"fs-extra-promise": "^1.0.1",
|
||||||
"mime": "^1.3.4",
|
"mime": "^1.3.4",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"typescript": "2.6.1",
|
"typescript": "2.8.1",
|
||||||
"vscode": "^1.0.1",
|
"vscode": "^1.0.1",
|
||||||
"xml2js": "^0.4.17"
|
"xml2js": "^0.4.17",
|
||||||
|
"github-releases": "^0.4.1",
|
||||||
|
"request": "^2.85.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "tsc -p tsconfig.build.json",
|
"compile": "tsc -p tsconfig.build.json",
|
||||||
|
|||||||
219
build/tfs/common/symbols.ts
Normal file
219
build/tfs/common/symbols.ts
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as request from 'request';
|
||||||
|
import { createReadStream, createWriteStream, unlink, mkdir } from 'fs';
|
||||||
|
import * as github from 'github-releases';
|
||||||
|
import { join } from 'path';
|
||||||
|
import { tmpdir } from 'os';
|
||||||
|
import { promisify } from 'util';
|
||||||
|
|
||||||
|
const BASE_URL = 'https://rink.hockeyapp.net/api/2/';
|
||||||
|
const HOCKEY_APP_TOKEN_HEADER = 'X-HockeyAppToken';
|
||||||
|
|
||||||
|
export interface IVersions {
|
||||||
|
app_versions: IVersion[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IVersion {
|
||||||
|
id: number;
|
||||||
|
version: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IApplicationAccessor {
|
||||||
|
accessToken: string;
|
||||||
|
appId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IVersionAccessor extends IApplicationAccessor {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Platform {
|
||||||
|
WIN_32 = 'win32-ia32',
|
||||||
|
WIN_64 = 'win32-x64',
|
||||||
|
LINUX_32 = 'linux-ia32',
|
||||||
|
LINUX_64 = 'linux-x64',
|
||||||
|
MAC_OS = 'darwin-x64'
|
||||||
|
}
|
||||||
|
|
||||||
|
function symbolsZipName(platform: Platform, electronVersion: string, insiders: boolean): string {
|
||||||
|
return `${insiders ? 'insiders' : 'stable'}-symbols-v${electronVersion}-${platform}.zip`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SEED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
async function tmpFile(name: string): Promise<string> {
|
||||||
|
let res = '';
|
||||||
|
for (let i = 0; i < 8; i++) {
|
||||||
|
res += SEED.charAt(Math.floor(Math.random() * SEED.length));
|
||||||
|
}
|
||||||
|
|
||||||
|
const tmpParent = join(tmpdir(), res);
|
||||||
|
|
||||||
|
await promisify(mkdir)(tmpParent);
|
||||||
|
|
||||||
|
return join(tmpParent, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getVersions(accessor: IApplicationAccessor): Promise<IVersions> {
|
||||||
|
return asyncRequest<IVersions>({
|
||||||
|
url: `${BASE_URL}/apps/${accessor.appId}/app_versions`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
[HOCKEY_APP_TOKEN_HEADER]: accessor.accessToken
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function createVersion(accessor: IApplicationAccessor, version: string): Promise<IVersion> {
|
||||||
|
return asyncRequest<IVersion>({
|
||||||
|
url: `${BASE_URL}/apps/${accessor.appId}/app_versions/new`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
[HOCKEY_APP_TOKEN_HEADER]: accessor.accessToken
|
||||||
|
},
|
||||||
|
formData: {
|
||||||
|
bundle_version: version
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateVersion(accessor: IVersionAccessor, symbolsPath: string) {
|
||||||
|
return asyncRequest<IVersions>({
|
||||||
|
url: `${BASE_URL}/apps/${accessor.appId}/app_versions/${accessor.id}`,
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
[HOCKEY_APP_TOKEN_HEADER]: accessor.accessToken
|
||||||
|
},
|
||||||
|
formData: {
|
||||||
|
dsym: createReadStream(symbolsPath)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function asyncRequest<T>(options: request.UrlOptions & request.CoreOptions): Promise<T> {
|
||||||
|
return new Promise<T>((resolve, reject) => {
|
||||||
|
request(options, (error, response, body) => {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
resolve(JSON.parse(body));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadAsset(repository, assetName: string, targetPath: string, electronVersion: string) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
repository.getReleases({ tag_name: `v${electronVersion}` }, (err, releases) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
const asset = releases[0].assets.filter(asset => asset.name === assetName)[0];
|
||||||
|
if (!asset) {
|
||||||
|
reject(new Error(`Asset with name ${assetName} not found`));
|
||||||
|
} else {
|
||||||
|
repository.downloadAsset(asset, (err, reader) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
const writer = createWriteStream(targetPath);
|
||||||
|
writer.on('error', reject);
|
||||||
|
writer.on('close', resolve);
|
||||||
|
reader.on('error', reject);
|
||||||
|
|
||||||
|
reader.pipe(writer);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IOptions {
|
||||||
|
repository: string;
|
||||||
|
platform: Platform;
|
||||||
|
versions: { code: string; insiders: boolean; electron: string; };
|
||||||
|
access: { hockeyAppToken: string; hockeyAppId: string; githubToken: string };
|
||||||
|
}
|
||||||
|
|
||||||
|
async function ensureVersionAndSymbols(options: IOptions) {
|
||||||
|
|
||||||
|
// Check version does not exist
|
||||||
|
console.log(`HockeyApp: checking for existing version ${options.versions.code} (${options.platform})`);
|
||||||
|
const versions = await getVersions({ accessToken: options.access.hockeyAppToken, appId: options.access.hockeyAppId });
|
||||||
|
if (versions.app_versions.some(v => v.version === options.versions.code)) {
|
||||||
|
console.log(`HockeyApp: Returning without uploading symbols because version ${options.versions.code} (${options.platform}) was already found`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Download symbols for platform and electron version
|
||||||
|
const symbolsName = symbolsZipName(options.platform, options.versions.electron, options.versions.insiders);
|
||||||
|
const symbolsPath = await tmpFile('symbols.zip');
|
||||||
|
console.log(`HockeyApp: downloading symbols ${symbolsName} for electron ${options.versions.electron} (${options.platform}) into ${symbolsPath}`);
|
||||||
|
await downloadAsset(new github({ repo: options.repository, token: options.access.githubToken }), symbolsName, symbolsPath, options.versions.electron);
|
||||||
|
|
||||||
|
// Create version
|
||||||
|
console.log(`HockeyApp: creating new version ${options.versions.code} (${options.platform})`);
|
||||||
|
const version = await createVersion({ accessToken: options.access.hockeyAppToken, appId: options.access.hockeyAppId }, options.versions.code);
|
||||||
|
|
||||||
|
// Upload symbols
|
||||||
|
console.log(`HockeyApp: uploading symbols for version ${options.versions.code} (${options.platform})`);
|
||||||
|
await updateVersion({ id: String(version.id), accessToken: options.access.hockeyAppToken, appId: options.access.hockeyAppId }, symbolsPath);
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
await promisify(unlink)(symbolsPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Environment
|
||||||
|
const pakage = require('../../../package.json');
|
||||||
|
const product = require('../../../product.json');
|
||||||
|
const repository = product.electronRepository;
|
||||||
|
const electronVersion = require('../../lib/electron').getElectronVersion();
|
||||||
|
const insiders = product.quality !== 'stable';
|
||||||
|
let codeVersion = pakage.version;
|
||||||
|
if (insiders) {
|
||||||
|
codeVersion = `${codeVersion}-insider`;
|
||||||
|
}
|
||||||
|
const githubToken = process.argv[2];
|
||||||
|
const hockeyAppToken = process.argv[3];
|
||||||
|
const is64 = process.argv[4] === 'x64';
|
||||||
|
const hockeyAppId = process.argv[5];
|
||||||
|
|
||||||
|
let platform: Platform;
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
platform = Platform.MAC_OS;
|
||||||
|
} else if (process.platform === 'win32') {
|
||||||
|
platform = is64 ? Platform.WIN_64 : Platform.WIN_32;
|
||||||
|
} else {
|
||||||
|
platform = is64 ? Platform.LINUX_64 : Platform.LINUX_32;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create version and upload symbols in HockeyApp
|
||||||
|
if (repository && codeVersion && electronVersion && (product.quality === 'stable' || product.quality === 'insider')) {
|
||||||
|
ensureVersionAndSymbols({
|
||||||
|
repository,
|
||||||
|
platform,
|
||||||
|
versions: {
|
||||||
|
code: codeVersion,
|
||||||
|
insiders,
|
||||||
|
electron: electronVersion
|
||||||
|
},
|
||||||
|
access: {
|
||||||
|
githubToken,
|
||||||
|
hockeyAppToken,
|
||||||
|
hockeyAppId
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
console.log('HockeyApp: done');
|
||||||
|
}).catch(error => {
|
||||||
|
console.error(`HockeyApp: error (${error})`);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log(`HockeyApp: skipping due to unexpected context (repository: ${repository}, codeVersion: ${codeVersion}, electronVersion: ${electronVersion}, quality: ${product.quality})`);
|
||||||
|
}
|
||||||
100
build/tfs/continuous-build.yml
Normal file
100
build/tfs/continuous-build.yml
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
phases:
|
||||||
|
- phase: Windows
|
||||||
|
queue: Hosted VS2017
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
yarn
|
||||||
|
.\node_modules\.bin\gulp electron
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
.\node_modules\.bin\tsc -p .\src\tsconfig.monaco.json --noEmit
|
||||||
|
npm run compile
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
name: build
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
.\scripts\test.bat --tfs
|
||||||
|
.\scripts\test-integration.bat
|
||||||
|
yarn smoketest --screenshots "$(Build.ArtifactStagingDirectory)\artifacts" --log "$(Build.ArtifactStagingDirectory)\artifacts\smoketest.log"
|
||||||
|
name: test
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'
|
||||||
|
ArtifactName: build-artifacts-win32
|
||||||
|
publishLocation: Container
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
|
- phase: Linux
|
||||||
|
queue: Hosted Linux Preview
|
||||||
|
steps:
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 libgconf-2-4 dbus xvfb libgtk-3-0
|
||||||
|
cp build/tfs/linux/x64/xvfb.init /etc/init.d/xvfb
|
||||||
|
chmod +x /etc/init.d/xvfb
|
||||||
|
update-rc.d xvfb defaults
|
||||||
|
ln -sf /bin/dbus-daemon /usr/bin/dbus-daemon
|
||||||
|
service xvfb start
|
||||||
|
service dbus start
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
yarn
|
||||||
|
npm run gulp -- electron-x64
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
./node_modules/.bin/tsc -p ./src/tsconfig.monaco.json --noEmit
|
||||||
|
npm run compile
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
name: build
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --tfs
|
||||||
|
# DISPLAY=:10 ./scripts/test-integration.sh
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- phase: macOS
|
||||||
|
queue: Hosted macOS Preview
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
yarn
|
||||||
|
npm run gulp -- electron-x64
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
./node_modules/.bin/tsc -p ./src/tsconfig.monaco.json --noEmit
|
||||||
|
npm run compile
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
name: build
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
./scripts/test.sh --tfs
|
||||||
|
./scripts/test-integration.sh
|
||||||
|
yarn smoketest --screenshots "$(Build.ArtifactStagingDirectory)/artifacts" --log "$(Build.ArtifactStagingDirectory)/artifacts/smoketest.log"
|
||||||
|
name: test
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'
|
||||||
|
ArtifactName: build-artifacts-darwin
|
||||||
|
publishLocation: Container
|
||||||
|
condition: succeededOrFailed()
|
||||||
51
build/tfs/darwin/build.yml
Normal file
51
build/tfs/darwin/build.yml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
steps:
|
||||||
|
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin electron
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-darwin-min
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
./scripts/test.sh --build --tfs
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
# archive the unsigned build
|
||||||
|
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin-unsigned.zip * && popd
|
||||||
|
|
||||||
|
# publish the unsigned build
|
||||||
|
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
||||||
|
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||||
|
node build/tfs/common/publish.js \
|
||||||
|
"$(VSCODE_QUALITY)" \
|
||||||
|
darwin \
|
||||||
|
archive-unsigned \
|
||||||
|
"VSCode-darwin-$(VSCODE_QUALITY)-unsigned.zip" \
|
||||||
|
$VERSION \
|
||||||
|
false \
|
||||||
|
../VSCode-darwin-unsigned.zip
|
||||||
|
|
||||||
|
# enqueue the unsigned build
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
node build/tfs/common/enqueue.js "$(VSCODE_QUALITY)"
|
||||||
|
|
||||||
|
npm run gulp -- upload-vscode-configuration
|
||||||
103
build/tfs/linux/build.yml
Normal file
103
build/tfs/linux/build.yml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
steps:
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
# dependencies
|
||||||
|
dpkg --add-architecture i386
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
DEPS=" \
|
||||||
|
gcc-multilib g++-multilib \
|
||||||
|
pkg-config \
|
||||||
|
dbus \
|
||||||
|
xvfb \
|
||||||
|
fakeroot \
|
||||||
|
bc \
|
||||||
|
bsdmainutils \
|
||||||
|
rpm \
|
||||||
|
"
|
||||||
|
|
||||||
|
if [[ "$(VSCODE_ARCH)" == "x64" ]]; then
|
||||||
|
DEPS="$DEPS \
|
||||||
|
dpkg-dev \
|
||||||
|
libgconf-2-4 \
|
||||||
|
libnss3 \
|
||||||
|
libasound2 \
|
||||||
|
libxtst6 \
|
||||||
|
libx11-dev \
|
||||||
|
libxkbfile-dev \
|
||||||
|
libxss1 \
|
||||||
|
libx11-xcb-dev \
|
||||||
|
libsecret-1-dev \
|
||||||
|
"
|
||||||
|
else
|
||||||
|
DEPS="$DEPS \
|
||||||
|
dpkg-dev:i386 \
|
||||||
|
libgconf-2-4:i386 \
|
||||||
|
libnss3:i386 \
|
||||||
|
libasound2:i386 \
|
||||||
|
libxtst6:i386 \
|
||||||
|
libnotify4:i386 \
|
||||||
|
libx11-dev:i386 \
|
||||||
|
libxkbfile-dev:i386 \
|
||||||
|
libxss1:i386 \
|
||||||
|
libx11-xcb-dev:i386 \
|
||||||
|
libgl1-mesa-glx:i386 libgl1-mesa-dri:i386 \
|
||||||
|
libgirepository-1.0-1:i386 \
|
||||||
|
gir1.2-glib-2.0:i386 \
|
||||||
|
gir1.2-secret-1:i386 \
|
||||||
|
libsecret-1-dev:i386 \
|
||||||
|
libgtk2.0-0:i386 \
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
|
apt-get install -y $DEPS
|
||||||
|
|
||||||
|
# setup xvfb
|
||||||
|
cp build/tfs/linux/$(VSCODE_ARCH)/xvfb.init /etc/init.d/xvfb
|
||||||
|
chmod +x /etc/init.d/xvfb
|
||||||
|
update-rc.d xvfb defaults
|
||||||
|
service xvfb start
|
||||||
|
|
||||||
|
# setup dbus
|
||||||
|
ln -sf /bin/dbus-daemon /usr/bin/dbus-daemon
|
||||||
|
service dbus start
|
||||||
|
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
export npm_config_arch="$(VSCODE_ARCH)"
|
||||||
|
if [[ "$(VSCODE_ARCH)" == "ia32" ]]; then
|
||||||
|
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --build --tfs
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
|
||||||
|
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
|
||||||
|
#npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-snap"
|
||||||
|
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||||
|
./build/tfs/linux/release2.sh "$(VSCODE_ARCH)" "$(LINUX_REPO_PASSWORD)"
|
||||||
67
build/tfs/linux/release2.sh
Executable file
67
build/tfs/linux/release2.sh
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Arguments
|
||||||
|
ARCH="$1"
|
||||||
|
LINUX_REPO_PASSWORD="$2"
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
PLATFORM_LINUX="linux-$ARCH"
|
||||||
|
PLATFORM_DEB="linux-deb-$ARCH"
|
||||||
|
PLATFORM_RPM="linux-rpm-$ARCH"
|
||||||
|
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||||
|
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||||
|
REPO="`pwd`"
|
||||||
|
ROOT="$REPO/.."
|
||||||
|
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
||||||
|
BUILD="$ROOT/$BUILDNAME"
|
||||||
|
BUILD_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\.deb$//g')"
|
||||||
|
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
|
||||||
|
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
||||||
|
PACKAGEJSON="$BUILD/resources/app/package.json"
|
||||||
|
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||||
|
|
||||||
|
rm -rf $ROOT/code-*.tar.*
|
||||||
|
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
||||||
|
|
||||||
|
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_LINUX archive-unsigned $TARBALL_FILENAME $VERSION true $TARBALL_PATH
|
||||||
|
|
||||||
|
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||||
|
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||||
|
|
||||||
|
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_DEB package $DEB_FILENAME $VERSION true $DEB_PATH
|
||||||
|
|
||||||
|
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||||
|
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||||
|
|
||||||
|
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
|
||||||
|
# Write config files needed by API, use eval to force environment variable expansion
|
||||||
|
pushd build/tfs/linux
|
||||||
|
# Submit to apt repo
|
||||||
|
if [ "$DEB_ARCH" = "amd64" ]; then
|
||||||
|
eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"username\": \"vscode\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > apt-config.json
|
||||||
|
|
||||||
|
./repoapi_client.sh -config apt-config.json -addfile $DEB_PATH
|
||||||
|
fi
|
||||||
|
# Submit to yum repo (disabled as it's manual until signing is automated)
|
||||||
|
# eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"username\": \"vscode\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > yum-config.json
|
||||||
|
|
||||||
|
# ./repoapi_client.sh -config yum-config.json -addfile $RPM_PATH
|
||||||
|
popd
|
||||||
|
echo "To check repo publish status run ./repoapi_client.sh -config config.json -check <id>"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
413
build/tfs/product-build.yml
Normal file
413
build/tfs/product-build.yml
Normal file
@@ -0,0 +1,413 @@
|
|||||||
|
phases:
|
||||||
|
- phase: Windows
|
||||||
|
condition: eq(variables['VSCODE_BUILD_WIN32'], 'true')
|
||||||
|
queue:
|
||||||
|
name: Hosted VS2017
|
||||||
|
parallel: 2
|
||||||
|
matrix:
|
||||||
|
x64:
|
||||||
|
VSCODE_ARCH: x64
|
||||||
|
ia32:
|
||||||
|
VSCODE_ARCH: ia32
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
"machine monacotools.visualstudio.com password $(VSO_PAT)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||||
|
$env:npm_config_arch="$(VSCODE_ARCH)"
|
||||||
|
$env:CHILD_CONCURRENCY="1"
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||||
|
npm run gulp -- mixin
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||||
|
npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min"
|
||||||
|
npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-copy-inno-updater"
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
||||||
|
.\scripts\test.bat --build --tfs
|
||||||
|
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
|
inputs:
|
||||||
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
|
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)'
|
||||||
|
Pattern: '*.dll,*.exe,*.node'
|
||||||
|
signConfigType: inlineSignParams
|
||||||
|
inlineOperation: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"keyCode": "CP-229803",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "VS Code"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "https://code.visualstudio.com/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/t \"http://ts4096.gtm.microsoft.com/TSS/AuthenticodeTS\""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "VS Code"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "https://code.visualstudio.com/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "Append",
|
||||||
|
"parameterValue": "/as"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "FileDigest",
|
||||||
|
"parameterValue": "/fd \"SHA256\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolVerify",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "VerifyAll",
|
||||||
|
"parameterValue": "/all"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
SessionTimeout: 120
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-setup"
|
||||||
|
|
||||||
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
|
inputs:
|
||||||
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
|
FolderPath: '$(agent.builddirectory)'
|
||||||
|
Pattern: VSCodeSetup.exe
|
||||||
|
signConfigType: inlineSignParams
|
||||||
|
inlineOperation: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"keyCode": "CP-229803",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "VS Code"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "https://code.visualstudio.com/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/t \"http://ts4096.gtm.microsoft.com/TSS/AuthenticodeTS\""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "VS Code"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "https://code.visualstudio.com/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "Append",
|
||||||
|
"parameterValue": "/as"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "FileDigest",
|
||||||
|
"parameterValue": "/fd \"SHA256\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolVerify",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "VerifyAll",
|
||||||
|
"parameterValue": "/all"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
SessionTimeout: 120
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$Repo = "$(pwd)"
|
||||||
|
$Root = "$Repo\.."
|
||||||
|
$Exe = "$Repo\.build\win32-$(VSCODE_ARCH)\setup\VSCodeSetup.exe"
|
||||||
|
$Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
|
||||||
|
$Build = "$Root\VSCode-win32-$(VSCODE_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 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
|
||||||
|
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
|
||||||
|
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
|
||||||
|
|
||||||
|
$assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }
|
||||||
|
|
||||||
|
node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip
|
||||||
|
node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $Exe
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
$hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
|
||||||
|
node build/tfs/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId
|
||||||
|
|
||||||
|
- phase: Linux
|
||||||
|
condition: eq(variables['VSCODE_BUILD_LINUX'], 'true')
|
||||||
|
queue: linux-x64
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: x64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
export npm_config_arch="$(VSCODE_ARCH)"
|
||||||
|
if [[ "$(VSCODE_ARCH)" == "ia32" ]]; then
|
||||||
|
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --build --tfs
|
||||||
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
|
||||||
|
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
|
||||||
|
#npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-snap"
|
||||||
|
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||||
|
./build/tfs/linux/release2.sh "$(VSCODE_ARCH)" "$(LINUX_REPO_PASSWORD)"
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
node build/tfs/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_LINUX64)"
|
||||||
|
|
||||||
|
- phase: Linux32
|
||||||
|
condition: eq(variables['VSCODE_BUILD_LINUX'], 'true')
|
||||||
|
queue: linux-ia32
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: ia32
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
export npm_config_arch="$(VSCODE_ARCH)"
|
||||||
|
if [[ "$(VSCODE_ARCH)" == "ia32" ]]; then
|
||||||
|
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
||||||
|
DISPLAY=:10 ./scripts/test.sh --build --tfs
|
||||||
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
|
||||||
|
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
|
||||||
|
#npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-snap"
|
||||||
|
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||||
|
./build/tfs/linux/release2.sh "$(VSCODE_ARCH)" "$(LINUX_REPO_PASSWORD)"
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
node build/tfs/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_LINUX32)"
|
||||||
|
|
||||||
|
- phase: macOS
|
||||||
|
condition: eq(variables['VSCODE_BUILD_MACOS'], 'true')
|
||||||
|
queue: Hosted macOS Preview
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
echo "machine monacotools.visualstudio.com password $(VSO_PAT)" > ~/.netrc
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
node build/lib/builtInExtensions.js
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||||
|
npm run gulp -- vscode-darwin-min upload-vscode-sourcemaps
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
./scripts/test.sh --build --tfs
|
||||||
|
APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
|
||||||
|
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
# archive the unsigned build
|
||||||
|
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin-unsigned.zip * && popd
|
||||||
|
|
||||||
|
# publish the unsigned build
|
||||||
|
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
||||||
|
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||||
|
node build/tfs/common/publish.js \
|
||||||
|
"$(VSCODE_QUALITY)" \
|
||||||
|
darwin \
|
||||||
|
archive-unsigned \
|
||||||
|
"VSCode-darwin-$(VSCODE_QUALITY)-unsigned.zip" \
|
||||||
|
$VERSION \
|
||||||
|
false \
|
||||||
|
../VSCode-darwin-unsigned.zip
|
||||||
|
|
||||||
|
# publish hockeyapp symbols
|
||||||
|
node build/tfs/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_MACOS)"
|
||||||
|
|
||||||
|
# enqueue the unsigned build
|
||||||
|
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||||
|
node build/tfs/common/enqueue.js "$(VSCODE_QUALITY)"
|
||||||
|
|
||||||
|
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||||
|
npm run gulp -- upload-vscode-configuration
|
||||||
212
build/tfs/win32/build.yml
Normal file
212
build/tfs/win32/build.yml
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
steps:
|
||||||
|
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: "8.9.1"
|
||||||
|
|
||||||
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
inputs:
|
||||||
|
versionSpec: "1.3.2"
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
"machine monacotools.visualstudio.com password $(VSO_PAT)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||||
|
$env:npm_config_arch="$(VSCODE_ARCH)"
|
||||||
|
$env:CHILD_CONCURRENCY="1"
|
||||||
|
yarn
|
||||||
|
npm run gulp -- hygiene
|
||||||
|
npm run monaco-compile-check
|
||||||
|
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||||
|
npm run gulp -- mixin
|
||||||
|
node build/tfs/common/installDistro.js
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||||
|
npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min"
|
||||||
|
npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-copy-inno-updater"
|
||||||
|
name: build
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
||||||
|
.\scripts\test.bat --build --tfs
|
||||||
|
name: test
|
||||||
|
|
||||||
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
|
inputs:
|
||||||
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
|
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)'
|
||||||
|
Pattern: '*.dll,*.exe,*.node'
|
||||||
|
signConfigType: inlineSignParams
|
||||||
|
inlineOperation: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"keyCode": "CP-229803",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "Microsoft"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "http://www.microsoft.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/t \"http://ts4096.gtm.microsoft.com/TSS/AuthenticodeTS\""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "Microsoft"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "http://www.microsoft.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "Append",
|
||||||
|
"parameterValue": "/as"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "FileDigest",
|
||||||
|
"parameterValue": "/fd \"SHA256\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolVerify",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "VerifyAll",
|
||||||
|
"parameterValue": "/all"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
SessionTimeout: 120
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-setup"
|
||||||
|
|
||||||
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
|
inputs:
|
||||||
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
|
FolderPath: '$(agent.builddirectory)'
|
||||||
|
Pattern: VSCodeSetup.exe
|
||||||
|
signConfigType: inlineSignParams
|
||||||
|
inlineOperation: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"keyCode": "CP-229803",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "Microsoft"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "http://www.microsoft.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/t \"http://ts4096.gtm.microsoft.com/TSS/AuthenticodeTS\""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolSign",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "OpusName",
|
||||||
|
"parameterValue": "Microsoft"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "OpusInfo",
|
||||||
|
"parameterValue": "http://www.microsoft.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "Append",
|
||||||
|
"parameterValue": "/as"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "FileDigest",
|
||||||
|
"parameterValue": "/fd \"SHA256\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "PageHash",
|
||||||
|
"parameterValue": "/NPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameterName": "TimeStamp",
|
||||||
|
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyCode": "CP-230012",
|
||||||
|
"operationSetCode": "SigntoolVerify",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"parameterName": "VerifyAll",
|
||||||
|
"parameterValue": "/all"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"toolName": "sign",
|
||||||
|
"toolVersion": "1.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
SessionTimeout: 120
|
||||||
|
|
||||||
|
- powershell: |
|
||||||
|
$Repo = "$(pwd)"
|
||||||
|
$Root = "$Repo\.."
|
||||||
|
$Exe = "$Repo\.build\win32-$(VSCODE_ARCH)\setup\VSCodeSetup.exe"
|
||||||
|
$Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
|
||||||
|
$Build = "$Root\VSCode-win32-$(VSCODE_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 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
|
||||||
|
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
|
||||||
|
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
|
||||||
|
|
||||||
|
$assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }
|
||||||
|
|
||||||
|
node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip
|
||||||
|
node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $Exe
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"newLine": "LF",
|
|
||||||
// enable JavaScript type checking for the language service
|
// enable JavaScript type checking for the language service
|
||||||
// use the tsconfig.build.json for compiling wich disable JavaScript
|
// use the tsconfig.build.json for compiling wich disable JavaScript
|
||||||
// type checking so that JavaScript file are not transpiled
|
// type checking so that JavaScript file are not transpiled
|
||||||
|
|||||||
814
build/win32/OSSREADME.json
Normal file → Executable file
814
build/win32/OSSREADME.json
Normal file → Executable file
@@ -1,198 +1,10 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "dtolnay/isatty",
|
"name": "Amanieu/thread_local-rs",
|
||||||
"version": "0.1.6",
|
"version": "0.3.5",
|
||||||
"repositoryUrl": "https://github.com/dtolnay/isatty",
|
"repositoryUrl": "https://github.com/Amanieu/thread_local-rs",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"Copyright (c) 2016",
|
"Copyright (c) 2016 The Rust Project Developers",
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rust-num/num-integer",
|
|
||||||
"version": "0.1.35",
|
|
||||||
"repositoryUrl": "https://github.com/rust-num/num-integer",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rust-lang-nursery/lazy-static.rs",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"repositoryUrl": "https://github.com/rust-lang-nursery/lazy-static.rs",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2010 The Rust Project Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rust-lang/libc",
|
|
||||||
"version": "0.2.36",
|
|
||||||
"repositoryUrl": "https://github.com/rust-lang/libc",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "retep998/winapi-rs",
|
|
||||||
"version": "0.2.2",
|
|
||||||
"repositoryUrl": "https://github.com/retep998/winapi-rs",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2015 The winapi-rs Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mrhooray/crc-rs",
|
|
||||||
"version": "1.7.0",
|
|
||||||
"repositoryUrl": "https://github.com/mrhooray/crc-rs.git",
|
|
||||||
"licenseDetail": [
|
|
||||||
"MIT License",
|
|
||||||
"",
|
|
||||||
"Copyright (c) 2017 crc-rs Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rust-num/num",
|
|
||||||
"version": "0.1.41",
|
|
||||||
"repositoryUrl": "https://github.com/rust-num/num",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
|
||||||
"",
|
"",
|
||||||
"Permission is hereby granted, free of charge, to any",
|
"Permission is hereby granted, free of charge, to any",
|
||||||
"person obtaining a copy of this software and associated",
|
"person obtaining a copy of this software and associated",
|
||||||
@@ -250,141 +62,13 @@
|
|||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "rust-num/num-traits",
|
"name": "Sgeo/take_mut",
|
||||||
"version": "0.1.42",
|
|
||||||
"repositoryUrl": "https://github.com/rust-num/num-traits",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "slog-rs/slog",
|
|
||||||
"version": "2.1.1",
|
|
||||||
"repositoryUrl": "https://github.com/slog-rs/slog",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rust-num/num-iter",
|
|
||||||
"version": "0.1.34",
|
|
||||||
"repositoryUrl": "https://github.com/rust-num/num-iter",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vitiral/build_const",
|
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"repositoryUrl": "https://github.com/vitiral/build_const",
|
"repositoryUrl": "https://github.com/Sgeo/take_mut",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"The Source EULA",
|
"The Source EULA",
|
||||||
"",
|
"",
|
||||||
"Copyright (c) 2017 Garrett Berg, vitiral@gmail.com",
|
"Copyright (c) 2016 Sgeo",
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "redox-os/termios",
|
|
||||||
"version": "0.1.1",
|
|
||||||
"repositoryUrl": "https://github.com/redox-os/termios",
|
|
||||||
"licenseDetail": [
|
|
||||||
"MIT License",
|
|
||||||
"",
|
|
||||||
"Copyright (c) 2017 Redox OS",
|
|
||||||
"",
|
"",
|
||||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||||
"of this software and associated documentation files (the \"Software\"), to deal",
|
"of this software and associated documentation files (the \"Software\"), to deal",
|
||||||
@@ -406,36 +90,6 @@
|
|||||||
],
|
],
|
||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "redox-os/syscall",
|
|
||||||
"version": "0.1.37",
|
|
||||||
"repositoryUrl": "https://github.com/redox-os/syscall",
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (c) 2017 Redox OS Developers",
|
|
||||||
"",
|
|
||||||
"MIT License",
|
|
||||||
"",
|
|
||||||
"Permission is hereby granted, free of charge, to any person obtaining",
|
|
||||||
"a copy of this software and associated documentation files (the",
|
|
||||||
"\"Software\"), to deal in the Software without restriction, including",
|
|
||||||
"without limitation the rights to use, copy, modify, merge, publish,",
|
|
||||||
"distribute, sublicense, and/or sell copies of the Software, and to",
|
|
||||||
"permit persons to whom the Software is furnished to do so, subject to",
|
|
||||||
"the following conditions:",
|
|
||||||
"",
|
|
||||||
"The above copyright notice and this permission notice shall be",
|
|
||||||
"included in all copies or substantial portions of the Software.",
|
|
||||||
"",
|
|
||||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
|
|
||||||
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF",
|
|
||||||
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
|
|
||||||
"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE",
|
|
||||||
"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION",
|
|
||||||
"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION",
|
|
||||||
"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Stebalien/term",
|
"name": "Stebalien/term",
|
||||||
"version": "0.4.6",
|
"version": "0.4.6",
|
||||||
@@ -717,11 +371,11 @@
|
|||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Amanieu/thread_local-rs",
|
"name": "dtolnay/isatty",
|
||||||
"version": "0.3.5",
|
"version": "0.1.6",
|
||||||
"repositoryUrl": "https://github.com/Amanieu/thread_local-rs",
|
"repositoryUrl": "https://github.com/dtolnay/isatty",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"Copyright (c) 2016 The Rust Project Developers",
|
"Copyright (c) 2016",
|
||||||
"",
|
"",
|
||||||
"Permission is hereby granted, free of charge, to any",
|
"Permission is hereby granted, free of charge, to any",
|
||||||
"person obtaining a copy of this software and associated",
|
"person obtaining a copy of this software and associated",
|
||||||
@@ -750,13 +404,13 @@
|
|||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Sgeo/take_mut",
|
"name": "mrhooray/crc-rs",
|
||||||
"version": "0.2.0",
|
"version": "1.7.0",
|
||||||
"repositoryUrl": "https://github.com/Sgeo/take_mut",
|
"repositoryUrl": "https://github.com/mrhooray/crc-rs.git",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"The Source EULA",
|
"MIT License",
|
||||||
"",
|
"",
|
||||||
"Copyright (c) 2016 Sgeo",
|
"Copyright (c) 2017 crc-rs Developers",
|
||||||
"",
|
"",
|
||||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||||
"of this software and associated documentation files (the \"Software\"), to deal",
|
"of this software and associated documentation files (the \"Software\"), to deal",
|
||||||
@@ -779,11 +433,43 @@
|
|||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "reem/rust-void",
|
"name": "redox-os/syscall",
|
||||||
"version": "1.0.2",
|
"version": "0.1.37",
|
||||||
"repositoryUrl": "https://github.com/reem/rust-void.git",
|
"repositoryUrl": "https://github.com/redox-os/syscall",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"Copyright (c) 2015 The rust-void Developers",
|
"Copyright (c) 2017 Redox OS Developers",
|
||||||
|
"",
|
||||||
|
"MIT License",
|
||||||
|
"",
|
||||||
|
"Permission is hereby granted, free of charge, to any person obtaining",
|
||||||
|
"a copy of this software and associated documentation files (the",
|
||||||
|
"\"Software\"), to deal in the Software without restriction, including",
|
||||||
|
"without limitation the rights to use, copy, modify, merge, publish,",
|
||||||
|
"distribute, sublicense, and/or sell copies of the Software, and to",
|
||||||
|
"permit persons to whom the Software is furnished to do so, subject to",
|
||||||
|
"the following conditions:",
|
||||||
|
"",
|
||||||
|
"The above copyright notice and this permission notice shall be",
|
||||||
|
"included in all copies or substantial portions of the Software.",
|
||||||
|
"",
|
||||||
|
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
|
||||||
|
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF",
|
||||||
|
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
|
||||||
|
"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE",
|
||||||
|
"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION",
|
||||||
|
"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION",
|
||||||
|
"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "redox-os/termios",
|
||||||
|
"version": "0.1.1",
|
||||||
|
"repositoryUrl": "https://github.com/redox-os/termios",
|
||||||
|
"licenseDetail": [
|
||||||
|
"MIT License",
|
||||||
|
"",
|
||||||
|
"Copyright (c) 2017 Redox OS",
|
||||||
"",
|
"",
|
||||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||||
"of this software and associated documentation files (the \"Software\"), to deal",
|
"of this software and associated documentation files (the \"Software\"), to deal",
|
||||||
@@ -833,46 +519,11 @@
|
|||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "rust-lang/time",
|
"name": "reem/rust-void",
|
||||||
"version": "0.1.39",
|
"version": "1.0.2",
|
||||||
"repositoryUrl": "https://github.com/rust-lang/time",
|
"repositoryUrl": "https://github.com/reem/rust-void.git",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"Copyright (c) 2014 The Rust Project Developers",
|
"Copyright (c) 2015 The rust-void Developers",
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"isProd": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ticki/termion",
|
|
||||||
"version": "1.5.1",
|
|
||||||
"repositoryUrl": "https://github.com/ticki/termion",
|
|
||||||
"licenseDetail": [
|
|
||||||
"The Source EULA",
|
|
||||||
"",
|
|
||||||
"Copyright (c) 2016 Ticki",
|
|
||||||
"",
|
"",
|
||||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||||
"of this software and associated documentation files (the \"Software\"), to deal",
|
"of this software and associated documentation files (the \"Software\"), to deal",
|
||||||
@@ -896,7 +547,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "retep998/winapi-rs",
|
"name": "retep998/winapi-rs",
|
||||||
"version": "0.2.8",
|
"version": "0.3.4",
|
||||||
"repositoryUrl": "https://github.com/retep998/winapi-rs",
|
"repositoryUrl": "https://github.com/retep998/winapi-rs",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"Copyright (c) 2015 The winapi-rs Developers",
|
"Copyright (c) 2015 The winapi-rs Developers",
|
||||||
@@ -923,7 +574,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "retep998/winapi-rs",
|
"name": "retep998/winapi-rs",
|
||||||
"version": "0.3.4",
|
"version": "0.2.8",
|
||||||
"repositoryUrl": "https://github.com/retep998/winapi-rs",
|
"repositoryUrl": "https://github.com/retep998/winapi-rs",
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
"Copyright (c) 2015 The winapi-rs Developers",
|
"Copyright (c) 2015 The winapi-rs Developers",
|
||||||
@@ -1029,6 +680,264 @@
|
|||||||
],
|
],
|
||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "retep998/winapi-rs",
|
||||||
|
"version": "0.2.2",
|
||||||
|
"repositoryUrl": "https://github.com/retep998/winapi-rs",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2015 The winapi-rs Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-lang-nursery/lazy-static.rs",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"repositoryUrl": "https://github.com/rust-lang-nursery/lazy-static.rs",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2010 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-lang/libc",
|
||||||
|
"version": "0.2.36",
|
||||||
|
"repositoryUrl": "https://github.com/rust-lang/libc",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-lang/time",
|
||||||
|
"version": "0.1.39",
|
||||||
|
"repositoryUrl": "https://github.com/rust-lang/time",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-num/num",
|
||||||
|
"version": "0.1.41",
|
||||||
|
"repositoryUrl": "https://github.com/rust-num/num",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-num/num-integer",
|
||||||
|
"version": "0.1.35",
|
||||||
|
"repositoryUrl": "https://github.com/rust-num/num-integer",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-num/num-iter",
|
||||||
|
"version": "0.1.34",
|
||||||
|
"repositoryUrl": "https://github.com/rust-num/num-iter",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rust-num/num-traits",
|
||||||
|
"version": "0.1.42",
|
||||||
|
"repositoryUrl": "https://github.com/rust-num/num-traits",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "slog-rs/async",
|
"name": "slog-rs/async",
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
@@ -1410,6 +1319,39 @@
|
|||||||
],
|
],
|
||||||
"isProd": true
|
"isProd": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "slog-rs/slog",
|
||||||
|
"version": "2.1.1",
|
||||||
|
"repositoryUrl": "https://github.com/slog-rs/slog",
|
||||||
|
"licenseDetail": [
|
||||||
|
"Copyright (c) 2014 The Rust Project Developers",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "slog-rs/term",
|
"name": "slog-rs/term",
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
@@ -1790,5 +1732,63 @@
|
|||||||
" defined by the Mozilla Public License, v. 2.0."
|
" defined by the Mozilla Public License, v. 2.0."
|
||||||
],
|
],
|
||||||
"isProd": true
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ticki/termion",
|
||||||
|
"version": "1.5.1",
|
||||||
|
"repositoryUrl": "https://github.com/ticki/termion",
|
||||||
|
"licenseDetail": [
|
||||||
|
"The MIT License (MIT)",
|
||||||
|
"",
|
||||||
|
"Copyright (c) 2016 Ticki",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vitiral/build_const",
|
||||||
|
"version": "0.2.0",
|
||||||
|
"repositoryUrl": "https://github.com/vitiral/build_const",
|
||||||
|
"licenseDetail": [
|
||||||
|
"The MIT License (MIT)",
|
||||||
|
"",
|
||||||
|
"Copyright (c) 2017 Garrett Berg, vitiral@gmail.com",
|
||||||
|
"",
|
||||||
|
"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."
|
||||||
|
],
|
||||||
|
"isProd": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Binary file not shown.
145
build/yarn.lock
145
build/yarn.lock
@@ -8,6 +8,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/caseless@*":
|
||||||
|
version "0.12.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.1.tgz#9794c69c8385d0192acc471a540d1f8e0d16218a"
|
||||||
|
|
||||||
"@types/documentdb@1.10.2":
|
"@types/documentdb@1.10.2":
|
||||||
version "1.10.2"
|
version "1.10.2"
|
||||||
resolved "https://registry.yarnpkg.com/@types/documentdb/-/documentdb-1.10.2.tgz#6795025cdc51577af5ed531b6f03bd44404f5350"
|
resolved "https://registry.yarnpkg.com/@types/documentdb/-/documentdb-1.10.2.tgz#6795025cdc51577af5ed531b6f03bd44404f5350"
|
||||||
@@ -22,6 +26,12 @@
|
|||||||
version "0.0.33"
|
version "0.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/@types/es6-promise/-/es6-promise-0.0.33.tgz#280a707e62b1b6bef1a86cc0861ec63cd06c7ff3"
|
resolved "https://registry.yarnpkg.com/@types/es6-promise/-/es6-promise-0.0.33.tgz#280a707e62b1b6bef1a86cc0861ec63cd06c7ff3"
|
||||||
|
|
||||||
|
"@types/form-data@*":
|
||||||
|
version "2.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/mime@0.0.29":
|
"@types/mime@0.0.29":
|
||||||
version "0.0.29"
|
version "0.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b"
|
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b"
|
||||||
@@ -34,6 +44,19 @@
|
|||||||
version "8.0.33"
|
version "8.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd"
|
||||||
|
|
||||||
|
"@types/request@^2.47.0":
|
||||||
|
version "2.47.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/request/-/request-2.47.0.tgz#76a666cee4cb85dcffea6cd4645227926d9e114e"
|
||||||
|
dependencies:
|
||||||
|
"@types/caseless" "*"
|
||||||
|
"@types/form-data" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
"@types/tough-cookie" "*"
|
||||||
|
|
||||||
|
"@types/tough-cookie@*":
|
||||||
|
version "2.3.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.3.tgz#7f226d67d654ec9070e755f46daebf014628e9d9"
|
||||||
|
|
||||||
"@types/xml2js@0.0.33":
|
"@types/xml2js@0.0.33":
|
||||||
version "0.0.33"
|
version "0.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.0.33.tgz#20c5dd6460245284d64a55690015b95e409fb7de"
|
resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.0.33.tgz#20c5dd6460245284d64a55690015b95e409fb7de"
|
||||||
@@ -331,6 +354,10 @@ color-support@^1.1.3:
|
|||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
|
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
|
||||||
|
|
||||||
|
colors@^1.1.2:
|
||||||
|
version "1.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.0.tgz#5f20c9fef6945cb1134260aab33bfbdc8295e04e"
|
||||||
|
|
||||||
combined-stream@1.0.6:
|
combined-stream@1.0.6:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
|
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
|
||||||
@@ -707,6 +734,15 @@ getpass@^0.1.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
assert-plus "^1.0.0"
|
assert-plus "^1.0.0"
|
||||||
|
|
||||||
|
github-releases@^0.4.1:
|
||||||
|
version "0.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/github-releases/-/github-releases-0.4.1.tgz#4a13bdf85c4161344271db3d81db08e7379102ff"
|
||||||
|
dependencies:
|
||||||
|
minimatch "3.0.4"
|
||||||
|
optimist "0.6.1"
|
||||||
|
prettyjson "1.2.1"
|
||||||
|
request "2.81.0"
|
||||||
|
|
||||||
glob-base@^0.3.0:
|
glob-base@^0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
|
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
|
||||||
@@ -1362,7 +1398,7 @@ mime@^1.3.4:
|
|||||||
version "1.4.1"
|
version "1.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
|
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
|
||||||
|
|
||||||
"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4:
|
"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -1376,6 +1412,10 @@ minimist@^1.1.0, minimist@^1.2.0:
|
|||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||||
|
|
||||||
|
minimist@~0.0.1:
|
||||||
|
version "0.0.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
|
||||||
|
|
||||||
mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1:
|
mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1:
|
||||||
version "0.5.1"
|
version "0.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||||
@@ -1453,6 +1493,13 @@ once@^1.3.0, once@^1.4.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
wrappy "1"
|
wrappy "1"
|
||||||
|
|
||||||
|
optimist@0.6.1:
|
||||||
|
version "0.6.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
|
||||||
|
dependencies:
|
||||||
|
minimist "~0.0.1"
|
||||||
|
wordwrap "~0.0.2"
|
||||||
|
|
||||||
ordered-read-streams@^0.3.0:
|
ordered-read-streams@^0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b"
|
resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b"
|
||||||
@@ -1531,6 +1578,13 @@ preserve@^0.2.0:
|
|||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||||
|
|
||||||
|
prettyjson@1.2.1:
|
||||||
|
version "1.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/prettyjson/-/prettyjson-1.2.1.tgz#fcffab41d19cab4dfae5e575e64246619b12d289"
|
||||||
|
dependencies:
|
||||||
|
colors "^1.1.2"
|
||||||
|
minimist "^1.2.0"
|
||||||
|
|
||||||
priorityqueuejs@1.0.0:
|
priorityqueuejs@1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/priorityqueuejs/-/priorityqueuejs-1.0.0.tgz#2ee4f23c2560913e08c07ce5ccdd6de3df2c5af8"
|
resolved "https://registry.yarnpkg.com/priorityqueuejs/-/priorityqueuejs-1.0.0.tgz#2ee4f23c2560913e08c07ce5ccdd6de3df2c5af8"
|
||||||
@@ -1649,6 +1703,33 @@ replace-ext@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
|
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
|
||||||
|
|
||||||
|
request@2.81.0, request@~2.81.0:
|
||||||
|
version "2.81.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
|
||||||
|
dependencies:
|
||||||
|
aws-sign2 "~0.6.0"
|
||||||
|
aws4 "^1.2.1"
|
||||||
|
caseless "~0.12.0"
|
||||||
|
combined-stream "~1.0.5"
|
||||||
|
extend "~3.0.0"
|
||||||
|
forever-agent "~0.6.1"
|
||||||
|
form-data "~2.1.1"
|
||||||
|
har-validator "~4.2.1"
|
||||||
|
hawk "~3.1.3"
|
||||||
|
http-signature "~1.1.0"
|
||||||
|
is-typedarray "~1.0.0"
|
||||||
|
isstream "~0.1.2"
|
||||||
|
json-stringify-safe "~5.0.1"
|
||||||
|
mime-types "~2.1.7"
|
||||||
|
oauth-sign "~0.8.1"
|
||||||
|
performance-now "^0.2.0"
|
||||||
|
qs "~6.4.0"
|
||||||
|
safe-buffer "^5.0.1"
|
||||||
|
stringstream "~0.0.4"
|
||||||
|
tough-cookie "~2.3.0"
|
||||||
|
tunnel-agent "^0.6.0"
|
||||||
|
uuid "^3.0.0"
|
||||||
|
|
||||||
request@^2.83.0:
|
request@^2.83.0:
|
||||||
version "2.85.0"
|
version "2.85.0"
|
||||||
resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa"
|
resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa"
|
||||||
@@ -1676,6 +1757,31 @@ request@^2.83.0:
|
|||||||
tunnel-agent "^0.6.0"
|
tunnel-agent "^0.6.0"
|
||||||
uuid "^3.1.0"
|
uuid "^3.1.0"
|
||||||
|
|
||||||
|
request@^2.85.0:
|
||||||
|
version "2.87.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
|
||||||
|
dependencies:
|
||||||
|
aws-sign2 "~0.7.0"
|
||||||
|
aws4 "^1.6.0"
|
||||||
|
caseless "~0.12.0"
|
||||||
|
combined-stream "~1.0.5"
|
||||||
|
extend "~3.0.1"
|
||||||
|
forever-agent "~0.6.1"
|
||||||
|
form-data "~2.3.1"
|
||||||
|
har-validator "~5.0.3"
|
||||||
|
http-signature "~1.2.0"
|
||||||
|
is-typedarray "~1.0.0"
|
||||||
|
isstream "~0.1.2"
|
||||||
|
json-stringify-safe "~5.0.1"
|
||||||
|
mime-types "~2.1.17"
|
||||||
|
oauth-sign "~0.8.2"
|
||||||
|
performance-now "^2.1.0"
|
||||||
|
qs "~6.5.1"
|
||||||
|
safe-buffer "^5.1.1"
|
||||||
|
tough-cookie "~2.3.3"
|
||||||
|
tunnel-agent "^0.6.0"
|
||||||
|
uuid "^3.1.0"
|
||||||
|
|
||||||
request@~2.79.0:
|
request@~2.79.0:
|
||||||
version "2.79.0"
|
version "2.79.0"
|
||||||
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
|
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
|
||||||
@@ -1701,33 +1807,6 @@ request@~2.79.0:
|
|||||||
tunnel-agent "~0.4.1"
|
tunnel-agent "~0.4.1"
|
||||||
uuid "^3.0.0"
|
uuid "^3.0.0"
|
||||||
|
|
||||||
request@~2.81.0:
|
|
||||||
version "2.81.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
|
|
||||||
dependencies:
|
|
||||||
aws-sign2 "~0.6.0"
|
|
||||||
aws4 "^1.2.1"
|
|
||||||
caseless "~0.12.0"
|
|
||||||
combined-stream "~1.0.5"
|
|
||||||
extend "~3.0.0"
|
|
||||||
forever-agent "~0.6.1"
|
|
||||||
form-data "~2.1.1"
|
|
||||||
har-validator "~4.2.1"
|
|
||||||
hawk "~3.1.3"
|
|
||||||
http-signature "~1.1.0"
|
|
||||||
is-typedarray "~1.0.0"
|
|
||||||
isstream "~0.1.2"
|
|
||||||
json-stringify-safe "~5.0.1"
|
|
||||||
mime-types "~2.1.7"
|
|
||||||
oauth-sign "~0.8.1"
|
|
||||||
performance-now "^0.2.0"
|
|
||||||
qs "~6.4.0"
|
|
||||||
safe-buffer "^5.0.1"
|
|
||||||
stringstream "~0.0.4"
|
|
||||||
tough-cookie "~2.3.0"
|
|
||||||
tunnel-agent "^0.6.0"
|
|
||||||
uuid "^3.0.0"
|
|
||||||
|
|
||||||
requires-port@~1.0.0:
|
requires-port@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||||
@@ -1978,9 +2057,9 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
|||||||
version "0.14.5"
|
version "0.14.5"
|
||||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||||
|
|
||||||
typescript@2.6.1:
|
typescript@2.8.1:
|
||||||
version "2.6.1"
|
version "2.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624"
|
||||||
|
|
||||||
unbzip2-stream@^1.0.9:
|
unbzip2-stream@^1.0.9:
|
||||||
version "1.2.5"
|
version "1.2.5"
|
||||||
@@ -2129,6 +2208,10 @@ vscode@^1.0.1:
|
|||||||
url-parse "^1.1.9"
|
url-parse "^1.1.9"
|
||||||
vinyl-source-stream "^1.1.0"
|
vinyl-source-stream "^1.1.0"
|
||||||
|
|
||||||
|
wordwrap@~0.0.2:
|
||||||
|
version "0.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
||||||
|
|
||||||
wrappy@1:
|
wrappy@1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
"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."
|
"Once accepted there, we are happy to receive an update request."
|
||||||
],
|
],
|
||||||
"version": "https://github.com/mmims/language-batchfile/commit/3dd105c31484e5975144478dac1aa91d8f51e528",
|
"version": "https://github.com/mmims/language-batchfile/commit/6235c491be4dff49cd3966b50142874d7f79580a",
|
||||||
"name": "Batch File",
|
"name": "Batch File",
|
||||||
"scopeName": "source.batchfile",
|
"scopeName": "source.batchfile",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
@@ -46,14 +46,17 @@
|
|||||||
"commands": {
|
"commands": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setlocal|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
|
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
|
||||||
"name": "keyword.command.batchfile"
|
"name": "keyword.command.batchfile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"begin": "(?<=^|[\\s@])(?i:echo)(?=$|\\s|\\.)",
|
"begin": "(?i)(?<=^|[\\s@])(echo)(?:(?=$|\\.|:)|\\s+(?:(on|off)(?=\\s*$))?)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
"0": {
|
"1": {
|
||||||
"name": "keyword.command.batchfile"
|
"name": "keyword.command.batchfile"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "keyword.other.special-method.batchfile"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"end": "(?=$\\n|[&|><)])",
|
"end": "(?=$\\n|[&|><)])",
|
||||||
@@ -72,6 +75,17 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)(?<=^|[\\s@])(setlocal)(?:\\s*$|\\s+(EnableExtensions|DisableExtensions|EnableDelayedExpansion|DisableDelayedExpansion)(?=\\s*$))",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "keyword.command.batchfile"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "keyword.other.special-method.batchfile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"include": "#command_set"
|
"include": "#command_set"
|
||||||
}
|
}
|
||||||
@@ -110,35 +124,7 @@
|
|||||||
"include": "#parens"
|
"include": "#parens"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"begin": "(\")\\s*([^ ][^=]*)(=)\"?",
|
"include": "#command_set_strings"
|
||||||
"beginCaptures": {
|
|
||||||
"1": {
|
|
||||||
"name": "punctuation.definition.string.begin.batchfile"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "variable.other.readwrite.batchfile"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "keyword.operator.assignment.batchfile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"end": "\"",
|
|
||||||
"endCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "string.quoted.double.batchfile"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "#variables"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#numbers"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#parens"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"include": "#strings"
|
"include": "#strings"
|
||||||
@@ -215,6 +201,9 @@
|
|||||||
"begin": "\\s+/[pP]\\s+",
|
"begin": "\\s+/[pP]\\s+",
|
||||||
"end": "(?=$\\n|[&|><)])",
|
"end": "(?=$\\n|[&|><)])",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#command_set_strings"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"begin": "([^ ][^=]*)(=)",
|
"begin": "([^ ][^=]*)(=)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
@@ -294,6 +283,42 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"command_set_strings": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"begin": "(\")\\s*([^ ][^=]*)(=)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "punctuation.definition.string.begin.batchfile"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "variable.other.readwrite.batchfile"
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"name": "keyword.operator.assignment.batchfile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\"",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.string.end.batchfile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "string.quoted.double.batchfile",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#variables"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#numbers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#escaped_characters"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"comments": {
|
"comments": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
@@ -359,7 +384,7 @@
|
|||||||
"controls": {
|
"controls": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "(?<=^|\\s)(?i)(?:goto|call|exit)(?=$|\\s)",
|
"match": "(?i)(?<=^|\\s)(?:call|exit(?=$|\\s)|goto(?=$|\\s|:))",
|
||||||
"name": "keyword.control.statement.batchfile"
|
"name": "keyword.control.statement.batchfile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -389,7 +414,7 @@
|
|||||||
"escaped_characters": {
|
"escaped_characters": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "%%|\\^\\^!|\\^.|\\^\\n",
|
"match": "%%|\\^\\^!|\\^(?=.)|\\^\\n",
|
||||||
"name": "constant.character.escape.batchfile"
|
"name": "constant.character.escape.batchfile"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -397,7 +422,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "^\\s*(:)([^+=,;:\\s].*)$",
|
"match": "(?i)(?:^\\s*|(?<=goto)\\s*)(:)([^+=,;:\\s].*)$",
|
||||||
"captures": {
|
"captures": {
|
||||||
"1": {
|
"1": {
|
||||||
"name": "punctuation.separator.batchfile"
|
"name": "punctuation.separator.batchfile"
|
||||||
@@ -432,11 +457,11 @@
|
|||||||
"name": "keyword.operator.logical.batchfile"
|
"name": "keyword.operator.logical.batchfile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": "&&?|\\|\\|",
|
"match": "(?<!\\^)&&?|\\|\\|",
|
||||||
"name": "keyword.operator.conditional.batchfile"
|
"name": "keyword.operator.conditional.batchfile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": "\\|",
|
"match": "(?<!\\^)\\|",
|
||||||
"name": "keyword.operator.pipe.batchfile"
|
"name": "keyword.operator.pipe.batchfile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -493,6 +518,10 @@
|
|||||||
},
|
},
|
||||||
"name": "string.quoted.double.batchfile",
|
"name": "string.quoted.double.batchfile",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "%%",
|
||||||
|
"name": "constant.character.escape.batchfile"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"include": "#variables"
|
"include": "#variables"
|
||||||
}
|
}
|
||||||
@@ -507,9 +536,11 @@
|
|||||||
"captures": {
|
"captures": {
|
||||||
"1": {
|
"1": {
|
||||||
"name": "punctuation.definition.variable.batchfile"
|
"name": "punctuation.definition.variable.batchfile"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
"2": {
|
||||||
"name": "variable.parameter.batchfile"
|
"name": "variable.parameter.batchfile"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"include": "#variable"
|
"include": "#variable"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"c": " off",
|
"c": " ",
|
||||||
"t": "source.batchfile",
|
"t": "source.batchfile",
|
||||||
"r": {
|
"r": {
|
||||||
"dark_plus": "default: #D4D4D4",
|
"dark_plus": "default: #D4D4D4",
|
||||||
@@ -32,6 +32,17 @@
|
|||||||
"hc_black": "default: #FFFFFF"
|
"hc_black": "default: #FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"c": "off",
|
||||||
|
"t": "source.batchfile keyword.other.special-method.batchfile",
|
||||||
|
"r": {
|
||||||
|
"dark_plus": "keyword: #569CD6",
|
||||||
|
"light_plus": "keyword: #0000FF",
|
||||||
|
"dark_vs": "keyword: #569CD6",
|
||||||
|
"light_vs": "keyword: #0000FF",
|
||||||
|
"hc_black": "keyword: #569CD6"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"c": "setlocal",
|
"c": "setlocal",
|
||||||
"t": "source.batchfile keyword.command.batchfile",
|
"t": "source.batchfile keyword.command.batchfile",
|
||||||
@@ -89,13 +100,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"c": "%",
|
"c": "%",
|
||||||
"t": "source.batchfile variable.parameter.batchfile punctuation.definition.variable.batchfile",
|
"t": "source.batchfile punctuation.definition.variable.batchfile",
|
||||||
"r": {
|
"r": {
|
||||||
"dark_plus": "variable: #9CDCFE",
|
"dark_plus": "default: #D4D4D4",
|
||||||
"light_plus": "variable: #001080",
|
"light_plus": "default: #000000",
|
||||||
"dark_vs": "default: #D4D4D4",
|
"dark_vs": "default: #D4D4D4",
|
||||||
"light_vs": "default: #000000",
|
"light_vs": "default: #000000",
|
||||||
"hc_black": "variable: #9CDCFE"
|
"hc_black": "default: #FFFFFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.0.0"
|
"vscode": "^1.0.0"
|
||||||
},
|
},
|
||||||
"categories": [
|
|
||||||
"Languages",
|
|
||||||
"Other"
|
|
||||||
],
|
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
"onLanguage:json",
|
"onLanguage:json",
|
||||||
"onLanguage:jsonc"
|
"onLanguage:jsonc"
|
||||||
|
|||||||
@@ -70,9 +70,14 @@ function autoFixSettingsJSON(willSaveEvent: vscode.TextDocumentWillSaveEvent): v
|
|||||||
onError(error: ParseErrorCode, offset: number, length: number): void {
|
onError(error: ParseErrorCode, offset: number, length: number): void {
|
||||||
if (error === ParseErrorCode.CommaExpected && lastEndOfSomething > -1) {
|
if (error === ParseErrorCode.CommaExpected && lastEndOfSomething > -1) {
|
||||||
const fixPosition = document.positionAt(lastEndOfSomething);
|
const fixPosition = document.positionAt(lastEndOfSomething);
|
||||||
|
|
||||||
|
// Don't insert a comma immediately before a : or ' :'
|
||||||
|
const colonRange = document.getWordRangeAtPosition(fixPosition, / *:/);
|
||||||
|
if (!colonRange) {
|
||||||
edit.insert(document.uri, fixPosition, ',');
|
edit.insert(document.uri, fixPosition, ',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
willSaveEvent.waitUntil(
|
willSaveEvent.waitUntil(
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "Apache2",
|
"license": "Apache2",
|
||||||
"repositoryURL": "https://github.com/moby/moby",
|
"repositoryURL": "https://github.com/moby/moby",
|
||||||
"description": "The file syntaxes/Dockerfile.tmLanguage was included from https://github.com/moby/moby/blob/master/contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage."
|
"description": "The file syntaxes/docker.tmLanguage was included from https://github.com/moby/moby/blob/master/contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage."
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.4.0"
|
"vscode": "^1.4.0"
|
||||||
},
|
},
|
||||||
"categories": [
|
|
||||||
"Languages",
|
|
||||||
"Other"
|
|
||||||
],
|
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
"onLanguage:json",
|
"onLanguage:json",
|
||||||
"onLanguage:markdown",
|
"onLanguage:markdown",
|
||||||
|
|||||||
@@ -834,6 +834,23 @@
|
|||||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
|
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"editor/context": [
|
||||||
|
{
|
||||||
|
"command": "git.stageSelectedRanges",
|
||||||
|
"group": "2_git@1",
|
||||||
|
"when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "git.unstageSelectedRanges",
|
||||||
|
"group": "2_git@2",
|
||||||
|
"when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "git.revertSelectedRanges",
|
||||||
|
"group": "2_git@3",
|
||||||
|
"when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
|
||||||
|
}
|
||||||
|
],
|
||||||
"scm/change/title": [
|
"scm/change/title": [
|
||||||
{
|
{
|
||||||
"command": "git.stageChange",
|
"command": "git.stageChange",
|
||||||
@@ -861,7 +878,7 @@
|
|||||||
],
|
],
|
||||||
"description": "%config.path%",
|
"description": "%config.path%",
|
||||||
"default": null,
|
"default": null,
|
||||||
"isExecutable": true
|
"scope": "application"
|
||||||
},
|
},
|
||||||
"git.autoRepositoryDetection": {
|
"git.autoRepositoryDetection": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -964,6 +981,12 @@
|
|||||||
"scope": "resource",
|
"scope": "resource",
|
||||||
"default": true,
|
"default": true,
|
||||||
"description": "%config.detectSubmodules%"
|
"description": "%config.detectSubmodules%"
|
||||||
|
},
|
||||||
|
"git.detectSubmodulesLimit": {
|
||||||
|
"type": "number",
|
||||||
|
"scope": "resource",
|
||||||
|
"default": 10,
|
||||||
|
"description": "%config.detectSubmodulesLimit%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1090,7 +1113,8 @@
|
|||||||
"byline": "^5.0.0",
|
"byline": "^5.0.0",
|
||||||
"file-type": "^7.2.0",
|
"file-type": "^7.2.0",
|
||||||
"iconv-lite": "0.4.19",
|
"iconv-lite": "0.4.19",
|
||||||
"vscode-extension-telemetry": "0.0.15",
|
"jschardet": "^1.6.0",
|
||||||
|
"vscode-extension-telemetry": "0.0.17",
|
||||||
"vscode-nls": "^3.2.1",
|
"vscode-nls": "^3.2.1",
|
||||||
"which": "^1.3.0"
|
"which": "^1.3.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
"config.showInlineOpenFileAction": "Controls whether to show an inline Open File action in the Git changes view.",
|
"config.showInlineOpenFileAction": "Controls whether to show an inline Open File action in the Git changes view.",
|
||||||
"config.inputValidation": "Controls when to show commit message input validation.",
|
"config.inputValidation": "Controls when to show commit message input validation.",
|
||||||
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
|
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
|
||||||
|
"config.detectSubmodulesLimit": "Controls the limit of git submodules detected.",
|
||||||
"colors.modified": "Color for modified resources.",
|
"colors.modified": "Color for modified resources.",
|
||||||
"colors.deleted": "Color for deleted resources.",
|
"colors.deleted": "Color for deleted resources.",
|
||||||
"colors.untracked": "Color for untracked resources.",
|
"colors.untracked": "Color for untracked resources.",
|
||||||
|
|||||||
@@ -6,37 +6,55 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { Model } from './model';
|
import { Model } from './model';
|
||||||
import { Uri } from 'vscode';
|
import { Repository as ModelRepository } from './repository';
|
||||||
|
import { Uri, SourceControlInputBox } from 'vscode';
|
||||||
|
|
||||||
export interface InputBox {
|
export interface InputBox {
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class InputBoxImpl implements InputBox {
|
||||||
|
set value(value: string) { this.inputBox.value = value; }
|
||||||
|
get value(): string { return this.inputBox.value; }
|
||||||
|
constructor(private inputBox: SourceControlInputBox) { }
|
||||||
|
}
|
||||||
|
|
||||||
export interface Repository {
|
export interface Repository {
|
||||||
readonly rootUri: Uri;
|
readonly rootUri: Uri;
|
||||||
readonly inputBox: InputBox;
|
readonly inputBox: InputBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class RepositoryImpl implements Repository {
|
||||||
|
|
||||||
|
readonly rootUri: Uri;
|
||||||
|
readonly inputBox: InputBox;
|
||||||
|
|
||||||
|
constructor(repository: ModelRepository) {
|
||||||
|
this.rootUri = Uri.file(repository.root);
|
||||||
|
this.inputBox = new InputBoxImpl(repository.inputBox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface API {
|
export interface API {
|
||||||
getRepositories(): Promise<Repository[]>;
|
getRepositories(): Promise<Repository[]>;
|
||||||
|
getGitPath(): Promise<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createApi(modelPromise: Promise<Model>) {
|
export class APIImpl implements API {
|
||||||
return {
|
|
||||||
|
constructor(private modelPromise: Promise<Model>) { }
|
||||||
|
|
||||||
|
async getGitPath(): Promise<string> {
|
||||||
|
const model = await this.modelPromise;
|
||||||
|
return model.git.path;
|
||||||
|
}
|
||||||
|
|
||||||
async getRepositories(): Promise<Repository[]> {
|
async getRepositories(): Promise<Repository[]> {
|
||||||
const model = await modelPromise;
|
const model = await this.modelPromise;
|
||||||
|
return model.repositories.map(repository => new RepositoryImpl(repository));
|
||||||
return model.repositories.map(repository => ({
|
|
||||||
rootUri: Uri.file(repository.root),
|
|
||||||
inputBox: {
|
|
||||||
set value(value: string) {
|
|
||||||
repository.inputBox.value = value;
|
|
||||||
},
|
|
||||||
get value(): string {
|
|
||||||
return repository.inputBox.value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
}
|
export function createApi(modelPromise: Promise<Model>): API {
|
||||||
};
|
return new APIImpl(modelPromise);
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, CancellationTokenSource, StatusBarAlignment } from 'vscode';
|
import { Uri, commands, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn, ProgressLocation, TextEditor, MessageOptions } from 'vscode';
|
||||||
import { Ref, RefType, Git, GitErrorCodes, Branch } from './git';
|
import { Ref, RefType, Git, GitErrorCodes, Branch } from './git';
|
||||||
import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository';
|
import { Repository, Resource, Status, CommitOptions, ResourceGroupType } from './repository';
|
||||||
import { Model } from './model';
|
import { Model } from './model';
|
||||||
@@ -328,8 +328,6 @@ export class CommandCenter {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private static cloneId = 0;
|
|
||||||
|
|
||||||
@command('git.clone')
|
@command('git.clone')
|
||||||
async clone(url?: string): Promise<void> {
|
async clone(url?: string): Promise<void> {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@@ -350,15 +348,18 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const config = workspace.getConfiguration('git');
|
const config = workspace.getConfiguration('git');
|
||||||
let value = config.get<string>('defaultCloneDirectory') || os.homedir();
|
let defaultCloneDirectory = config.get<string>('defaultCloneDirectory') || os.homedir();
|
||||||
|
defaultCloneDirectory = defaultCloneDirectory.replace(/^~/, os.homedir());
|
||||||
|
|
||||||
const parentPath = await window.showInputBox({
|
const uris = await window.showOpenDialog({
|
||||||
prompt: localize('parent', "Parent Directory"),
|
canSelectFiles: false,
|
||||||
value,
|
canSelectFolders: true,
|
||||||
ignoreFocusOut: true
|
canSelectMany: false,
|
||||||
|
defaultUri: Uri.file(defaultCloneDirectory),
|
||||||
|
openLabel: localize('selectFolder', "Select Repository Location")
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!parentPath) {
|
if (!uris || uris.length === 0) {
|
||||||
/* __GDPR__
|
/* __GDPR__
|
||||||
"clone" : {
|
"clone" : {
|
||||||
"outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
"outcome" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
@@ -368,25 +369,33 @@ export class CommandCenter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tokenSource = new CancellationTokenSource();
|
const uri = uris[0];
|
||||||
const cancelCommandId = `cancelClone${CommandCenter.cloneId++}`;
|
const parentPath = uri.fsPath;
|
||||||
const commandDisposable = commands.registerCommand(cancelCommandId, () => tokenSource.cancel());
|
|
||||||
|
|
||||||
const statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
|
|
||||||
statusBarItem.text = localize('cancel', "$(sync~spin) Cloning repository... Click to cancel");
|
|
||||||
statusBarItem.tooltip = localize('cancel tooltip', "Cancel clone");
|
|
||||||
statusBarItem.command = cancelCommandId;
|
|
||||||
statusBarItem.show();
|
|
||||||
|
|
||||||
const clonePromise = this.git.clone(url, parentPath.replace(/^~/, os.homedir()), tokenSource.token);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
window.withProgress({ location: ProgressLocation.SourceControl, title: localize('cloning', "Cloning git repository...") }, () => clonePromise);
|
const opts = {
|
||||||
|
location: ProgressLocation.Notification,
|
||||||
|
title: localize('cloning', "Cloning git repository '{0}'...", url),
|
||||||
|
cancellable: true
|
||||||
|
};
|
||||||
|
|
||||||
const repositoryPath = await clonePromise;
|
const repositoryPath = await window.withProgress(
|
||||||
|
opts,
|
||||||
|
(_, token) => this.git.clone(url!, parentPath, token)
|
||||||
|
);
|
||||||
|
|
||||||
|
const choices = [];
|
||||||
|
let message = localize('proposeopen', "Would you like to open the cloned repository?");
|
||||||
const open = localize('openrepo', "Open Repository");
|
const open = localize('openrepo', "Open Repository");
|
||||||
const result = await window.showInformationMessage(localize('proposeopen', "Would you like to open the cloned repository?"), open);
|
choices.push(open);
|
||||||
|
|
||||||
|
const addToWorkspace = localize('add', "Add to Workspace");
|
||||||
|
if (workspace.workspaceFolders) {
|
||||||
|
message = localize('proposeopen2', "Would you like to open the cloned repository, or add it to the current workspace?");
|
||||||
|
choices.push(addToWorkspace);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await window.showInformationMessage(message, ...choices);
|
||||||
|
|
||||||
const openFolder = result === open;
|
const openFolder = result === open;
|
||||||
/* __GDPR__
|
/* __GDPR__
|
||||||
@@ -396,8 +405,13 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'success' }, { openFolder: openFolder ? 1 : 0 });
|
this.telemetryReporter.sendTelemetryEvent('clone', { outcome: 'success' }, { openFolder: openFolder ? 1 : 0 });
|
||||||
|
|
||||||
|
const uri = Uri.file(repositoryPath);
|
||||||
|
|
||||||
if (openFolder) {
|
if (openFolder) {
|
||||||
commands.executeCommand('vscode.openFolder', Uri.file(repositoryPath));
|
commands.executeCommand('vscode.openFolder', uri);
|
||||||
|
} else if (result === addToWorkspace) {
|
||||||
|
workspace.updateWorkspaceFolders(workspace.workspaceFolders!.length, 0, { uri });
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (/already exists and is not an empty directory/.test(err && err.stderr || '')) {
|
if (/already exists and is not an empty directory/.test(err && err.stderr || '')) {
|
||||||
@@ -419,9 +433,6 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
throw err;
|
throw err;
|
||||||
} finally {
|
|
||||||
commandDisposable.dispose();
|
|
||||||
statusBarItem.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1205,7 +1216,7 @@ export class CommandCenter {
|
|||||||
|
|
||||||
const message = localize('confirm force delete branch', "The branch '{0}' is not fully merged. Delete anyway?", name);
|
const message = localize('confirm force delete branch', "The branch '{0}' is not fully merged. Delete anyway?", name);
|
||||||
const yes = localize('delete branch', "Delete Branch");
|
const yes = localize('delete branch', "Delete Branch");
|
||||||
const pick = await window.showWarningMessage(message, yes);
|
const pick = await window.showWarningMessage(message, { modal: true }, yes);
|
||||||
|
|
||||||
if (pick === yes) {
|
if (pick === yes) {
|
||||||
await run(true);
|
await run(true);
|
||||||
@@ -1333,7 +1344,7 @@ export class CommandCenter {
|
|||||||
|
|
||||||
const remoteCharCnt = remotePick.label.length;
|
const remoteCharCnt = remotePick.label.length;
|
||||||
|
|
||||||
repository.pull(false, remotePick.label, branchPick.label.slice(remoteCharCnt + 1));
|
repository.pullFrom(false, remotePick.label, branchPick.label.slice(remoteCharCnt + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@command('git.pull', { repository: true })
|
@command('git.pull', { repository: true })
|
||||||
@@ -1345,7 +1356,7 @@ export class CommandCenter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await repository.pull();
|
await repository.pull(repository.HEAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@command('git.pullRebase', { repository: true })
|
@command('git.pullRebase', { repository: true })
|
||||||
@@ -1357,7 +1368,7 @@ export class CommandCenter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await repository.pullWithRebase();
|
await repository.pullWithRebase(repository.HEAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@command('git.push', { repository: true })
|
@command('git.push', { repository: true })
|
||||||
@@ -1375,7 +1386,7 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await repository.push();
|
await repository.push(repository.HEAD);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.gitErrorCode !== GitErrorCodes.NoUpstreamBranch) {
|
if (err.gitErrorCode !== GitErrorCodes.NoUpstreamBranch) {
|
||||||
throw err;
|
throw err;
|
||||||
@@ -1443,7 +1454,7 @@ export class CommandCenter {
|
|||||||
const shouldPrompt = config.get<boolean>('confirmSync') === true;
|
const shouldPrompt = config.get<boolean>('confirmSync') === true;
|
||||||
|
|
||||||
if (shouldPrompt) {
|
if (shouldPrompt) {
|
||||||
const message = localize('sync is unpredictable', "This action will push and pull commits to and from '{0}'.", HEAD.upstream);
|
const message = localize('sync is unpredictable', "This action will push and pull commits to and from '{0}/{1}'.", HEAD.upstream.remote, HEAD.upstream.name);
|
||||||
const yes = localize('ok', "OK");
|
const yes = localize('ok', "OK");
|
||||||
const neverAgain = localize('never again', "OK, Don't Show Again");
|
const neverAgain = localize('never again', "OK, Don't Show Again");
|
||||||
const pick = await window.showWarningMessage(message, { modal: true }, yes, neverAgain);
|
const pick = await window.showWarningMessage(message, { modal: true }, yes, neverAgain);
|
||||||
@@ -1456,9 +1467,9 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rebase) {
|
if (rebase) {
|
||||||
await repository.syncRebase();
|
await repository.syncRebase(HEAD);
|
||||||
} else {
|
} else {
|
||||||
await repository.sync();
|
await repository.sync(HEAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1476,7 +1487,7 @@ export class CommandCenter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await repository.sync();
|
await repository.sync(HEAD);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1635,6 +1646,10 @@ export class CommandCenter {
|
|||||||
this.telemetryReporter.sendTelemetryEvent('git.command', { command: id });
|
this.telemetryReporter.sendTelemetryEvent('git.command', { command: id });
|
||||||
|
|
||||||
return result.catch(async err => {
|
return result.catch(async err => {
|
||||||
|
const options: MessageOptions = {
|
||||||
|
modal: err.gitErrorCode === GitErrorCodes.DirtyWorkTree
|
||||||
|
};
|
||||||
|
|
||||||
let message: string;
|
let message: string;
|
||||||
|
|
||||||
switch (err.gitErrorCode) {
|
switch (err.gitErrorCode) {
|
||||||
@@ -1664,9 +1679,11 @@ export class CommandCenter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.modal = true;
|
||||||
|
|
||||||
const outputChannel = this.outputChannel as OutputChannel;
|
const outputChannel = this.outputChannel as OutputChannel;
|
||||||
const openOutputChannelChoice = localize('open git log', "Open Git Log");
|
const openOutputChannelChoice = localize('open git log', "Open Git Log");
|
||||||
const choice = await window.showErrorMessage(message, openOutputChannelChoice);
|
const choice = await window.showErrorMessage(message, options, openOutputChannelChoice);
|
||||||
|
|
||||||
if (choice === openOutputChannelChoice) {
|
if (choice === openOutputChannelChoice) {
|
||||||
outputChannel.show();
|
outputChannel.show();
|
||||||
|
|||||||
81
extensions/git/src/encoding.ts
Normal file
81
extensions/git/src/encoding.ts
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import * as jschardet from 'jschardet';
|
||||||
|
|
||||||
|
jschardet.Constants.MINIMUM_THRESHOLD = 0.2;
|
||||||
|
|
||||||
|
function detectEncodingByBOM(buffer: NodeBuffer): string | null {
|
||||||
|
if (!buffer || buffer.length < 2) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const b0 = buffer.readUInt8(0);
|
||||||
|
const b1 = buffer.readUInt8(1);
|
||||||
|
|
||||||
|
// UTF-16 BE
|
||||||
|
if (b0 === 0xFE && b1 === 0xFF) {
|
||||||
|
return 'utf16be';
|
||||||
|
}
|
||||||
|
|
||||||
|
// UTF-16 LE
|
||||||
|
if (b0 === 0xFF && b1 === 0xFE) {
|
||||||
|
return 'utf16le';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buffer.length < 3) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const b2 = buffer.readUInt8(2);
|
||||||
|
|
||||||
|
// UTF-8
|
||||||
|
if (b0 === 0xEF && b1 === 0xBB && b2 === 0xBF) {
|
||||||
|
return 'utf8';
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const IGNORE_ENCODINGS = [
|
||||||
|
'ascii',
|
||||||
|
'utf-8',
|
||||||
|
'utf-16',
|
||||||
|
'utf-32'
|
||||||
|
];
|
||||||
|
|
||||||
|
const JSCHARDET_TO_ICONV_ENCODINGS: { [name: string]: string } = {
|
||||||
|
'ibm866': 'cp866',
|
||||||
|
'big5': 'cp950'
|
||||||
|
};
|
||||||
|
|
||||||
|
export function detectEncoding(buffer: Buffer): string | null {
|
||||||
|
let result = detectEncodingByBOM(buffer);
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const detected = jschardet.detect(buffer);
|
||||||
|
|
||||||
|
if (!detected || !detected.encoding) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const encoding = detected.encoding;
|
||||||
|
|
||||||
|
// Ignore encodings that cannot guess correctly
|
||||||
|
// (http://chardet.readthedocs.io/en/latest/supported-encodings.html)
|
||||||
|
if (0 <= IGNORE_ENCODINGS.indexOf(encoding.toLowerCase())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const normalizedEncodingName = encoding.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
|
||||||
|
const mapped = JSCHARDET_TO_ICONV_ENCODINGS[normalizedEncodingName];
|
||||||
|
|
||||||
|
return mapped || normalizedEncodingName;
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import iconv = require('iconv-lite');
|
|||||||
import * as filetype from 'file-type';
|
import * as filetype from 'file-type';
|
||||||
import { assign, uniqBy, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent } from './util';
|
import { assign, uniqBy, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent } from './util';
|
||||||
import { CancellationToken } from 'vscode';
|
import { CancellationToken } from 'vscode';
|
||||||
|
import { detectEncoding } from './encoding';
|
||||||
|
|
||||||
const readfile = denodeify<string, string | null, string>(fs.readFile);
|
const readfile = denodeify<string, string | null, string>(fs.readFile);
|
||||||
|
|
||||||
@@ -53,8 +54,13 @@ export interface Ref {
|
|||||||
remote?: string;
|
remote?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UpstreamRef {
|
||||||
|
remote: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Branch extends Ref {
|
export interface Branch extends Ref {
|
||||||
upstream?: string;
|
upstream?: UpstreamRef;
|
||||||
ahead?: number;
|
ahead?: number;
|
||||||
behind?: number;
|
behind?: number;
|
||||||
}
|
}
|
||||||
@@ -361,14 +367,14 @@ function getGitErrorCode(stderr: string): string | undefined {
|
|||||||
|
|
||||||
export class Git {
|
export class Git {
|
||||||
|
|
||||||
private gitPath: string;
|
readonly path: string;
|
||||||
private env: any;
|
private env: any;
|
||||||
|
|
||||||
private _onOutput = new EventEmitter();
|
private _onOutput = new EventEmitter();
|
||||||
get onOutput(): EventEmitter { return this._onOutput; }
|
get onOutput(): EventEmitter { return this._onOutput; }
|
||||||
|
|
||||||
constructor(options: IGitOptions) {
|
constructor(options: IGitOptions) {
|
||||||
this.gitPath = options.gitPath;
|
this.path = options.gitPath;
|
||||||
this.env = options.env || {};
|
this.env = options.env || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,11 +388,29 @@ export class Git {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clone(url: string, parentPath: string, cancellationToken?: CancellationToken): Promise<string> {
|
async clone(url: string, parentPath: string, cancellationToken?: CancellationToken): Promise<string> {
|
||||||
const folderName = decodeURI(url).replace(/^.*\//, '').replace(/\.git$/, '') || 'repository';
|
let baseFolderName = decodeURI(url).replace(/^.*\//, '').replace(/\.git$/, '') || 'repository';
|
||||||
const folderPath = path.join(parentPath, folderName);
|
let folderName = baseFolderName;
|
||||||
|
let folderPath = path.join(parentPath, folderName);
|
||||||
|
let count = 1;
|
||||||
|
|
||||||
|
while (count < 20 && await new Promise(c => fs.exists(folderPath, c))) {
|
||||||
|
folderName = `${baseFolderName}-${count++}`;
|
||||||
|
folderPath = path.join(parentPath, folderName);
|
||||||
|
}
|
||||||
|
|
||||||
await mkdirp(parentPath);
|
await mkdirp(parentPath);
|
||||||
|
|
||||||
|
try {
|
||||||
await this.exec(parentPath, ['clone', url, folderPath], { cancellationToken });
|
await this.exec(parentPath, ['clone', url, folderPath], { cancellationToken });
|
||||||
|
} catch (err) {
|
||||||
|
if (err.stderr) {
|
||||||
|
err.stderr = err.stderr.replace(/^Cloning.+$/m, '').trim();
|
||||||
|
err.stderr = err.stderr.replace(/^ERROR:\s+/, '').trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
return folderPath;
|
return folderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +466,7 @@ export class Git {
|
|||||||
}
|
}
|
||||||
|
|
||||||
spawn(args: string[], options: SpawnOptions = {}): cp.ChildProcess {
|
spawn(args: string[], options: SpawnOptions = {}): cp.ChildProcess {
|
||||||
if (!this.gitPath) {
|
if (!this.path) {
|
||||||
throw new Error('git could not be found in the system.');
|
throw new Error('git could not be found in the system.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +488,7 @@ export class Git {
|
|||||||
this.log(`> git ${args.join(' ')}\n`);
|
this.log(`> git ${args.join(' ')}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cp.spawn(this.gitPath, args, options);
|
return cp.spawn(this.path, args, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
private log(output: string): void {
|
private log(output: string): void {
|
||||||
@@ -654,9 +678,16 @@ export class Repository {
|
|||||||
return result.stdout;
|
return result.stdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
async bufferString(object: string, encoding: string = 'utf8'): Promise<string> {
|
async bufferString(object: string, encoding: string = 'utf8', autoGuessEncoding = false): Promise<string> {
|
||||||
const stdout = await this.buffer(object);
|
const stdout = await this.buffer(object);
|
||||||
return iconv.decode(stdout, iconv.encodingExists(encoding) ? encoding : 'utf8');
|
|
||||||
|
if (autoGuessEncoding) {
|
||||||
|
encoding = detectEncoding(stdout) || encoding;
|
||||||
|
}
|
||||||
|
|
||||||
|
encoding = iconv.encodingExists(encoding) ? encoding : 'utf8';
|
||||||
|
|
||||||
|
return iconv.decode(stdout, encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
async buffer(object: string): Promise<Buffer> {
|
async buffer(object: string): Promise<Buffer> {
|
||||||
@@ -988,7 +1019,7 @@ export class Repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
|
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
|
||||||
const args = ['pull'];
|
const args = ['pull', '--tags'];
|
||||||
|
|
||||||
if (rebase) {
|
if (rebase) {
|
||||||
args.push('-r');
|
args.push('-r');
|
||||||
@@ -1008,7 +1039,8 @@ export class Repository {
|
|||||||
err.gitErrorCode = GitErrorCodes.NoUserNameConfigured;
|
err.gitErrorCode = GitErrorCodes.NoUserNameConfigured;
|
||||||
} else if (/Could not read from remote repository/.test(err.stderr || '')) {
|
} else if (/Could not read from remote repository/.test(err.stderr || '')) {
|
||||||
err.gitErrorCode = GitErrorCodes.RemoteConnectionError;
|
err.gitErrorCode = GitErrorCodes.RemoteConnectionError;
|
||||||
} else if (/Pull is not possible because you have unmerged files|Cannot pull with rebase: You have unstaged changes|Your local changes to the following files would be overwritten|Please, commit your changes before you can merge/.test(err.stderr)) {
|
} else if (/Pull is not possible because you have unmerged files|Cannot pull with rebase: You have unstaged changes|Your local changes to the following files would be overwritten|Please, commit your changes before you can merge/i.test(err.stderr)) {
|
||||||
|
err.stderr = err.stderr.replace(/Cannot pull with rebase: You have unstaged changes/i, 'Cannot pull with rebase, you have unstaged changes');
|
||||||
err.gitErrorCode = GitErrorCodes.DirtyWorkTree;
|
err.gitErrorCode = GitErrorCodes.DirtyWorkTree;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1218,10 +1250,16 @@ export class Repository {
|
|||||||
const commit = result.stdout.trim();
|
const commit = result.stdout.trim();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res2 = await this.run(['rev-parse', '--symbolic-full-name', '--abbrev-ref', name + '@{u}']);
|
const res2 = await this.run(['rev-parse', '--symbolic-full-name', name + '@{u}']);
|
||||||
const upstream = res2.stdout.trim();
|
const fullUpstream = res2.stdout.trim();
|
||||||
|
const match = /^refs\/remotes\/([^/]+)\/(.+)$/.exec(fullUpstream);
|
||||||
|
|
||||||
const res3 = await this.run(['rev-list', '--left-right', name + '...' + upstream]);
|
if (!match) {
|
||||||
|
throw new Error(`Could not parse upstream branch: ${fullUpstream}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const upstream = { remote: match[1], name: match[2] };
|
||||||
|
const res3 = await this.run(['rev-list', '--left-right', name + '...' + fullUpstream]);
|
||||||
|
|
||||||
let ahead = 0, behind = 0;
|
let ahead = 0, behind = 0;
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { Askpass } from './askpass';
|
|||||||
import { toDisposable, filterEvent, eventToPromise } from './util';
|
import { toDisposable, filterEvent, eventToPromise } from './util';
|
||||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||||
import { API, createApi } from './api';
|
import { API, createApi } from './api';
|
||||||
|
import { GitProtocolHandler } from './protocolHandler';
|
||||||
|
|
||||||
let telemetryReporter: TelemetryReporter;
|
let telemetryReporter: TelemetryReporter;
|
||||||
|
|
||||||
@@ -51,7 +52,8 @@ async function init(context: ExtensionContext, outputChannel: OutputChannel, dis
|
|||||||
disposables.push(
|
disposables.push(
|
||||||
new CommandCenter(git, model, outputChannel, telemetryReporter),
|
new CommandCenter(git, model, outputChannel, telemetryReporter),
|
||||||
new GitContentProvider(model),
|
new GitContentProvider(model),
|
||||||
new GitDecorations(model)
|
new GitDecorations(model),
|
||||||
|
new GitProtocolHandler()
|
||||||
);
|
);
|
||||||
|
|
||||||
await checkGitVersion(info);
|
await checkGitVersion(info);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export class Model {
|
|||||||
|
|
||||||
private disposables: Disposable[] = [];
|
private disposables: Disposable[] = [];
|
||||||
|
|
||||||
constructor(private git: Git, private globalState: Memento, private outputChannel: OutputChannel) {
|
constructor(readonly git: Git, private globalState: Memento, private outputChannel: OutputChannel) {
|
||||||
workspace.onDidChangeWorkspaceFolders(this.onDidChangeWorkspaceFolders, this, this.disposables);
|
workspace.onDidChangeWorkspaceFolders(this.onDidChangeWorkspaceFolders, this, this.disposables);
|
||||||
this.onDidChangeWorkspaceFolders({ added: workspace.workspaceFolders || [], removed: [] });
|
this.onDidChangeWorkspaceFolders({ added: workspace.workspaceFolders || [], removed: [] });
|
||||||
|
|
||||||
@@ -227,14 +227,17 @@ export class Model {
|
|||||||
const changeListener = repository.onDidChangeRepository(uri => this._onDidChangeRepository.fire({ repository, uri }));
|
const changeListener = repository.onDidChangeRepository(uri => this._onDidChangeRepository.fire({ repository, uri }));
|
||||||
const originalResourceChangeListener = repository.onDidChangeOriginalResource(uri => this._onDidChangeOriginalResource.fire({ repository, uri }));
|
const originalResourceChangeListener = repository.onDidChangeOriginalResource(uri => this._onDidChangeOriginalResource.fire({ repository, uri }));
|
||||||
|
|
||||||
|
const submodulesLimit = workspace
|
||||||
|
.getConfiguration('git', Uri.file(repository.root))
|
||||||
|
.get<number>('detectSubmodulesLimit') as number;
|
||||||
|
|
||||||
const checkForSubmodules = () => {
|
const checkForSubmodules = () => {
|
||||||
if (repository.submodules.length > 10) {
|
if (repository.submodules.length > submodulesLimit) {
|
||||||
window.showWarningMessage(localize('too many submodules', "The '{0}' repository has {1} submodules which won't be opened automatically. You can still open each one individually by opening a file within.", path.basename(repository.root), repository.submodules.length));
|
window.showWarningMessage(localize('too many submodules', "The '{0}' repository has {1} submodules which won't be opened automatically. You can still open each one individually by opening a file within.", path.basename(repository.root), repository.submodules.length));
|
||||||
statusListener.dispose();
|
statusListener.dispose();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scanSubmodules(repository);
|
this.scanSubmodules(repository, submodulesLimit);
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusListener = repository.onDidRunGitStatus(checkForSubmodules);
|
const statusListener = repository.onDidRunGitStatus(checkForSubmodules);
|
||||||
@@ -256,7 +259,7 @@ export class Model {
|
|||||||
this._onDidOpenRepository.fire(repository);
|
this._onDidOpenRepository.fire(repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
private scanSubmodules(repository: Repository): void {
|
private scanSubmodules(repository: Repository, limit: number): void {
|
||||||
const shouldScanSubmodules = workspace
|
const shouldScanSubmodules = workspace
|
||||||
.getConfiguration('git', Uri.file(repository.root))
|
.getConfiguration('git', Uri.file(repository.root))
|
||||||
.get<boolean>('detectSubmodules') === true;
|
.get<boolean>('detectSubmodules') === true;
|
||||||
@@ -266,6 +269,7 @@ export class Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repository.submodules
|
repository.submodules
|
||||||
|
.slice(0, limit)
|
||||||
.map(r => path.join(repository.root, r.path))
|
.map(r => path.join(repository.root, r.path))
|
||||||
.forEach(p => this.eventuallyScanPossibleGitRepository(p));
|
.forEach(p => this.eventuallyScanPossibleGitRepository(p));
|
||||||
}
|
}
|
||||||
|
|||||||
39
extensions/git/src/protocolHandler.ts
Normal file
39
extensions/git/src/protocolHandler.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import { ProtocolHandler, Uri, window, Disposable, commands } from 'vscode';
|
||||||
|
import { dispose } from './util';
|
||||||
|
import * as querystring from 'querystring';
|
||||||
|
|
||||||
|
export class GitProtocolHandler implements ProtocolHandler {
|
||||||
|
|
||||||
|
private disposables: Disposable[] = [];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.disposables.push(window.registerProtocolHandler(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
handleUri(uri: Uri): void {
|
||||||
|
switch (uri.path) {
|
||||||
|
case '/clone': this.clone(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private clone(uri: Uri): void {
|
||||||
|
const data = querystring.parse(uri.query);
|
||||||
|
|
||||||
|
if (!data.url) {
|
||||||
|
console.warn('Failed to open URI:', uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
commands.executeCommand('git.clone', data.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose(): void {
|
||||||
|
this.disposables = dispose(this.disposables);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -728,24 +728,48 @@ export class Repository implements Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
@throttle
|
||||||
async pullWithRebase(): Promise<void> {
|
async pullWithRebase(head: Branch | undefined): Promise<void> {
|
||||||
await this.run(Operation.Pull, () => this.repository.pull(true));
|
let remote: string | undefined;
|
||||||
|
let branch: string | undefined;
|
||||||
|
|
||||||
|
if (head && head.name && head.upstream) {
|
||||||
|
remote = head.upstream.remote;
|
||||||
|
branch = `${head.upstream.name}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.run(Operation.Pull, () => this.repository.pull(true, remote, branch));
|
||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
@throttle
|
||||||
async pull(rebase?: boolean, remote?: string, name?: string): Promise<void> {
|
async pull(head: Branch | undefined): Promise<void> {
|
||||||
await this.run(Operation.Pull, () => this.repository.pull(rebase, remote, name));
|
let remote: string | undefined;
|
||||||
|
let branch: string | undefined;
|
||||||
|
|
||||||
|
if (head && head.name && head.upstream) {
|
||||||
|
remote = head.upstream.remote;
|
||||||
|
branch = `${head.upstream.name}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
await this.run(Operation.Pull, () => this.repository.pull(false, remote, branch));
|
||||||
async push(): Promise<void> {
|
|
||||||
await this.run(Operation.Push, () => this.repository.push());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async pullFrom(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
|
async pullFrom(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
|
||||||
await this.run(Operation.Pull, () => this.repository.pull(rebase, remote, branch));
|
await this.run(Operation.Pull, () => this.repository.pull(rebase, remote, branch));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@throttle
|
||||||
|
async push(head: Branch): Promise<void> {
|
||||||
|
let remote: string | undefined;
|
||||||
|
let branch: string | undefined;
|
||||||
|
|
||||||
|
if (head && head.name && head.upstream) {
|
||||||
|
remote = head.upstream.remote;
|
||||||
|
branch = `${head.name}:${head.upstream.name}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.run(Operation.Push, () => this.repository.push(remote, branch));
|
||||||
|
}
|
||||||
|
|
||||||
async pushTo(remote?: string, name?: string, setUpstream: boolean = false): Promise<void> {
|
async pushTo(remote?: string, name?: string, setUpstream: boolean = false): Promise<void> {
|
||||||
await this.run(Operation.Push, () => this.repository.push(remote, name, setUpstream));
|
await this.run(Operation.Push, () => this.repository.push(remote, name, setUpstream));
|
||||||
}
|
}
|
||||||
@@ -754,47 +778,53 @@ export class Repository implements Disposable {
|
|||||||
await this.run(Operation.Push, () => this.repository.push(remote, undefined, false, true));
|
await this.run(Operation.Push, () => this.repository.push(remote, undefined, false, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _sync(rebase: boolean): Promise<void> {
|
@throttle
|
||||||
|
sync(head: Branch): Promise<void> {
|
||||||
|
return this._sync(head, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@throttle
|
||||||
|
async syncRebase(head: Branch): Promise<void> {
|
||||||
|
return this._sync(head, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _sync(head: Branch, rebase: boolean): Promise<void> {
|
||||||
|
let remote: string | undefined;
|
||||||
|
let pullBranch: string | undefined;
|
||||||
|
let pushBranch: string | undefined;
|
||||||
|
|
||||||
|
if (head.name && head.upstream) {
|
||||||
|
remote = head.upstream.remote;
|
||||||
|
pullBranch = `${head.upstream.name}`;
|
||||||
|
pushBranch = `${head.name}:${head.upstream.name}`;
|
||||||
|
}
|
||||||
|
|
||||||
await this.run(Operation.Sync, async () => {
|
await this.run(Operation.Sync, async () => {
|
||||||
await this.repository.pull(rebase);
|
await this.repository.pull(rebase, remote, pullBranch);
|
||||||
|
|
||||||
const shouldPush = this.HEAD && typeof this.HEAD.ahead === 'number' ? this.HEAD.ahead > 0 : true;
|
const shouldPush = this.HEAD && typeof this.HEAD.ahead === 'number' ? this.HEAD.ahead > 0 : true;
|
||||||
|
|
||||||
if (shouldPush) {
|
if (shouldPush) {
|
||||||
await this.repository.push();
|
await this.repository.push(remote, pushBranch);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
|
||||||
sync(): Promise<void> {
|
|
||||||
return this._sync(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@throttle
|
|
||||||
async syncRebase(): Promise<void> {
|
|
||||||
return this._sync(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
async show(ref: string, filePath: string): Promise<string> {
|
async show(ref: string, filePath: string): Promise<string> {
|
||||||
return await this.run(Operation.Show, async () => {
|
return this.run(Operation.Show, () => {
|
||||||
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
|
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
|
||||||
const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
|
const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
|
||||||
const encoding = configFiles.get<string>('encoding');
|
const defaultEncoding = configFiles.get<string>('encoding');
|
||||||
|
const autoGuessEncoding = configFiles.get<boolean>('autoGuessEncoding');
|
||||||
|
|
||||||
// TODO@joao: Resource config api
|
return this.repository.bufferString(`${ref}:${relativePath}`, defaultEncoding, autoGuessEncoding);
|
||||||
return await this.repository.bufferString(`${ref}:${relativePath}`, encoding);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async buffer(ref: string, filePath: string): Promise<Buffer> {
|
async buffer(ref: string, filePath: string): Promise<Buffer> {
|
||||||
return await this.run(Operation.Show, async () => {
|
return this.run(Operation.Show, () => {
|
||||||
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
|
const relativePath = path.relative(this.repository.root, filePath).replace(/\\/g, '/');
|
||||||
// const configFiles = workspace.getConfiguration('files', Uri.file(filePath));
|
return this.repository.buffer(`${ref}:${relativePath}`);
|
||||||
// const encoding = configFiles.get<string>('encoding');
|
|
||||||
|
|
||||||
// TODO@joao: REsource config api
|
|
||||||
return await this.repository.buffer(`${ref}:${relativePath}`);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
extensions/git/src/typings/jschardet.d.ts
vendored
Normal file
11
extensions/git/src/typings/jschardet.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
declare module 'jschardet' {
|
||||||
|
export interface IDetectedMap {
|
||||||
|
encoding: string,
|
||||||
|
confidence: number
|
||||||
|
}
|
||||||
|
export function detect(buffer: NodeBuffer): IDetectedMap;
|
||||||
|
|
||||||
|
export const Constants: {
|
||||||
|
MINIMUM_THRESHOLD: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -303,6 +303,10 @@ export function detectUnicodeEncoding(buffer: Buffer): Encoding | null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isWindowsPath(path: string): boolean {
|
||||||
|
return /^[a-zA-Z]:\\/.test(path);
|
||||||
|
}
|
||||||
|
|
||||||
export function isDescendant(parent: string, descendant: string): boolean {
|
export function isDescendant(parent: string, descendant: string): boolean {
|
||||||
if (parent === descendant) {
|
if (parent === descendant) {
|
||||||
return true;
|
return true;
|
||||||
@@ -312,5 +316,11 @@ export function isDescendant(parent: string, descendant: string): boolean {
|
|||||||
parent += sep;
|
parent += sep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Windows is case insensitive
|
||||||
|
if (isWindowsPath(parent)) {
|
||||||
|
parent = parent.toLowerCase();
|
||||||
|
descendant = descendant.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
return descendant.startsWith(parent);
|
return descendant.startsWith(parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ isexe@^2.0.0:
|
|||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||||
|
|
||||||
|
jschardet@^1.6.0:
|
||||||
|
version "1.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.6.0.tgz#c7d1a71edcff2839db2f9ec30fc5d5ebd3c1a678"
|
||||||
|
|
||||||
json3@3.3.2:
|
json3@3.3.2:
|
||||||
version "3.3.2"
|
version "3.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
|
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
|
||||||
@@ -253,9 +257,9 @@ supports-color@3.1.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
has-flag "^1.0.0"
|
has-flag "^1.0.0"
|
||||||
|
|
||||||
vscode-extension-telemetry@0.0.15:
|
vscode-extension-telemetry@0.0.17:
|
||||||
version "0.0.15"
|
version "0.0.17"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.15.tgz#685c32f3b67e8fb85ba689c1d7f88ff90ff87856"
|
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.17.tgz#15123e7edb34e7b9724b6056f54a869bbb922cb7"
|
||||||
dependencies:
|
dependencies:
|
||||||
applicationinsights "1.0.1"
|
applicationinsights "1.0.1"
|
||||||
|
|
||||||
|
|||||||
7
extensions/json-language-features/.vscodeignore
Normal file
7
extensions/json-language-features/.vscodeignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
test/**
|
||||||
|
client/tsconfig.json
|
||||||
|
client/src/**
|
||||||
|
server/bin
|
||||||
|
server/tsconfig.json
|
||||||
|
server/src/**
|
||||||
|
server/node_modules/@types/**
|
||||||
@@ -8,11 +8,11 @@ import * as path from 'path';
|
|||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
import { workspace, languages, ExtensionContext, extensions, Uri, LanguageConfiguration, TextDocument, FoldingRangeList, FoldingRange, Disposable } from 'vscode';
|
import { workspace, languages, ExtensionContext, extensions, Uri, LanguageConfiguration, TextDocument, FoldingRangeKind, FoldingRange, Disposable, FoldingContext } from 'vscode';
|
||||||
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification } from 'vscode-languageclient';
|
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, CancellationToken } from 'vscode-languageclient';
|
||||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||||
|
|
||||||
import { FoldingRangesRequest } from './protocol/foldingProvider.proposed';
|
import { FoldingRangeRequest, FoldingRangeRequestParam, FoldingRangeClientCapabilities, FoldingRangeKind as LSFoldingRangeKind } from 'vscode-languageserver-protocol-foldingprovider';
|
||||||
|
|
||||||
import { hash } from './utils/hash';
|
import { hash } from './utils/hash';
|
||||||
|
|
||||||
@@ -57,9 +57,6 @@ interface JSONSchemaSettings {
|
|||||||
|
|
||||||
let telemetryReporter: TelemetryReporter | undefined;
|
let telemetryReporter: TelemetryReporter | undefined;
|
||||||
|
|
||||||
let foldingProviderRegistration: Disposable | undefined = void 0;
|
|
||||||
const foldingSetting = 'json.experimental.syntaxFolding';
|
|
||||||
|
|
||||||
export function activate(context: ExtensionContext) {
|
export function activate(context: ExtensionContext) {
|
||||||
|
|
||||||
let toDispose = context.subscriptions;
|
let toDispose = context.subscriptions;
|
||||||
@@ -70,7 +67,7 @@ export function activate(context: ExtensionContext) {
|
|||||||
// The server is implemented in node
|
// The server is implemented in node
|
||||||
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'jsonServerMain.js'));
|
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'jsonServerMain.js'));
|
||||||
// The debug options for the server
|
// The debug options for the server
|
||||||
let debugOptions = { execArgv: ['--nolazy', '--inspect=6046'] };
|
let debugOptions = { execArgv: ['--nolazy', '--inspect=' + (9000 + Math.round(Math.random() * 10000))] };
|
||||||
|
|
||||||
// If the extension is launch in debug mode the debug server options are use
|
// If the extension is launch in debug mode the debug server options are use
|
||||||
// Otherwise the run options are used
|
// Otherwise the run options are used
|
||||||
@@ -100,6 +97,21 @@ export function activate(context: ExtensionContext) {
|
|||||||
// Create the language client and start the client.
|
// Create the language client and start the client.
|
||||||
let client = new LanguageClient('json', localize('jsonserver.name', 'JSON Language Server'), serverOptions, clientOptions);
|
let client = new LanguageClient('json', localize('jsonserver.name', 'JSON Language Server'), serverOptions, clientOptions);
|
||||||
client.registerProposedFeatures();
|
client.registerProposedFeatures();
|
||||||
|
client.registerFeature({
|
||||||
|
fillClientCapabilities(capabilities: FoldingRangeClientCapabilities): void {
|
||||||
|
let textDocumentCap = capabilities.textDocument;
|
||||||
|
if (!textDocumentCap) {
|
||||||
|
textDocumentCap = capabilities.textDocument = {};
|
||||||
|
}
|
||||||
|
textDocumentCap.foldingRange = {
|
||||||
|
dynamicRegistration: false,
|
||||||
|
rangeLimit: 5000,
|
||||||
|
lineFoldingOnly: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
initialize(capabilities, documentSelector): void {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let disposable = client.start();
|
let disposable = client.start();
|
||||||
toDispose.push(disposable);
|
toDispose.push(disposable);
|
||||||
@@ -130,13 +142,7 @@ export function activate(context: ExtensionContext) {
|
|||||||
|
|
||||||
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context));
|
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context));
|
||||||
|
|
||||||
initFoldingProvider();
|
toDispose.push(initFoldingProvider());
|
||||||
toDispose.push(workspace.onDidChangeConfiguration(c => {
|
|
||||||
if (c.affectsConfiguration(foldingSetting)) {
|
|
||||||
initFoldingProvider();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
toDispose.push({ dispose: () => foldingProviderRegistration && foldingProviderRegistration.dispose() });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let languageConfiguration: LanguageConfiguration = {
|
let languageConfiguration: LanguageConfiguration = {
|
||||||
@@ -149,28 +155,37 @@ export function activate(context: ExtensionContext) {
|
|||||||
languages.setLanguageConfiguration('json', languageConfiguration);
|
languages.setLanguageConfiguration('json', languageConfiguration);
|
||||||
languages.setLanguageConfiguration('jsonc', languageConfiguration);
|
languages.setLanguageConfiguration('jsonc', languageConfiguration);
|
||||||
|
|
||||||
function initFoldingProvider() {
|
function initFoldingProvider(): Disposable {
|
||||||
let enable = workspace.getConfiguration().get(foldingSetting);
|
function getKind(kind: string | undefined): FoldingRangeKind | undefined {
|
||||||
if (enable) {
|
if (kind) {
|
||||||
if (!foldingProviderRegistration) {
|
switch (kind) {
|
||||||
foldingProviderRegistration = languages.registerFoldingProvider(documentSelector, {
|
case LSFoldingRangeKind.Comment:
|
||||||
provideFoldingRanges(document: TextDocument) {
|
return FoldingRangeKind.Comment;
|
||||||
return client.sendRequest(FoldingRangesRequest.type, { textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document) }).then(res => {
|
case LSFoldingRangeKind.Imports:
|
||||||
if (res && Array.isArray(res.ranges)) {
|
return FoldingRangeKind.Imports;
|
||||||
return new FoldingRangeList(res.ranges.map(r => new FoldingRange(r.startLine, r.endLine, r.type)));
|
case LSFoldingRangeKind.Region:
|
||||||
|
return FoldingRangeKind.Region;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
}
|
||||||
|
return languages.registerFoldingRangeProvider(documentSelector, {
|
||||||
|
provideFoldingRanges(document: TextDocument, context: FoldingContext, token: CancellationToken) {
|
||||||
|
const param: FoldingRangeRequestParam = {
|
||||||
|
textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)
|
||||||
|
};
|
||||||
|
return client.sendRequest(FoldingRangeRequest.type, param, token).then(ranges => {
|
||||||
|
if (Array.isArray(ranges)) {
|
||||||
|
return ranges.map(r => new FoldingRange(r.startLine, r.endLine, getKind(r.kind)));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}, error => {
|
||||||
|
client.logFailedRequest(FoldingRangeRequest.type, error);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (foldingProviderRegistration) {
|
|
||||||
foldingProviderRegistration.dispose();
|
|
||||||
foldingProviderRegistration = void 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deactivate(): Promise<any> {
|
export function deactivate(): Promise<any> {
|
||||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
111
extensions/json-language-features/package.json
Normal file
111
extensions/json-language-features/package.json
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
{
|
||||||
|
"name": "json-language-features",
|
||||||
|
"displayName": "%displayName%",
|
||||||
|
"description": "%description%",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"publisher": "vscode",
|
||||||
|
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
|
||||||
|
"engines": {
|
||||||
|
"vscode": "0.10.x"
|
||||||
|
},
|
||||||
|
"icon": "icons/json.png",
|
||||||
|
"activationEvents": [
|
||||||
|
"onLanguage:json",
|
||||||
|
"onLanguage:jsonc"
|
||||||
|
],
|
||||||
|
"enableProposedApi": true,
|
||||||
|
"main": "./client/out/jsonMain",
|
||||||
|
"scripts": {
|
||||||
|
"compile": "gulp compile-extension:json-language-features-client && gulp compile-extension:json-language-features-server",
|
||||||
|
"postinstall": "cd server && yarn install",
|
||||||
|
"install-client-next": "yarn add vscode-languageclient@next"
|
||||||
|
},
|
||||||
|
"categories": [
|
||||||
|
"Programming Languages"
|
||||||
|
],
|
||||||
|
"contributes": {
|
||||||
|
"configuration": {
|
||||||
|
"id": "json",
|
||||||
|
"order": 20,
|
||||||
|
"type": "object",
|
||||||
|
"title": "JSON",
|
||||||
|
"properties": {
|
||||||
|
"json.schemas": {
|
||||||
|
"type": "array",
|
||||||
|
"scope": "resource",
|
||||||
|
"description": "%json.schemas.desc%",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"default": {
|
||||||
|
"fileMatch": [
|
||||||
|
"/myfile"
|
||||||
|
],
|
||||||
|
"url": "schemaURL"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "/user.schema.json",
|
||||||
|
"description": "%json.schemas.url.desc%"
|
||||||
|
},
|
||||||
|
"fileMatch": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "MyFile.json",
|
||||||
|
"description": "%json.schemas.fileMatch.item.desc%"
|
||||||
|
},
|
||||||
|
"minItems": 1,
|
||||||
|
"description": "%json.schemas.fileMatch.desc%"
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"$ref": "http://json-schema.org/draft-04/schema#",
|
||||||
|
"description": "%json.schemas.schema.desc%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"json.format.enable": {
|
||||||
|
"type": "boolean",
|
||||||
|
"scope": "window",
|
||||||
|
"default": true,
|
||||||
|
"description": "%json.format.enable.desc%"
|
||||||
|
},
|
||||||
|
"json.trace.server": {
|
||||||
|
"type": "string",
|
||||||
|
"scope": "window",
|
||||||
|
"enum": [
|
||||||
|
"off",
|
||||||
|
"messages",
|
||||||
|
"verbose"
|
||||||
|
],
|
||||||
|
"default": "off",
|
||||||
|
"description": "%json.tracing.desc%"
|
||||||
|
},
|
||||||
|
"json.colorDecorators.enable": {
|
||||||
|
"type": "boolean",
|
||||||
|
"scope": "window",
|
||||||
|
"default": true,
|
||||||
|
"description": "%json.colorDecorators.enable.desc%",
|
||||||
|
"deprecationMessage": "%json.colorDecorators.enable.deprecationMessage%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"configurationDefaults": {
|
||||||
|
"[json]": {
|
||||||
|
"editor.quickSuggestions": {
|
||||||
|
"strings": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"vscode-extension-telemetry": "0.0.17",
|
||||||
|
"vscode-languageclient": "^4.0.0",
|
||||||
|
"vscode-languageserver-protocol-foldingprovider": "^2.0.0-next.2",
|
||||||
|
"vscode-nls": "^3.2.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "7.0.43"
|
||||||
|
}
|
||||||
|
}
|
||||||
13
extensions/json-language-features/package.nls.json
Normal file
13
extensions/json-language-features/package.nls.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"displayName": "JSON Language Features",
|
||||||
|
"description": "Provides rich language support for JSON files.",
|
||||||
|
"json.schemas.desc": "Associate schemas to JSON files in the current project",
|
||||||
|
"json.schemas.url.desc": "A URL to a schema or a relative path to a schema in the current directory",
|
||||||
|
"json.schemas.fileMatch.desc": "An array of file patterns to match against when resolving JSON files to schemas.",
|
||||||
|
"json.schemas.fileMatch.item.desc": "A file pattern that can contain '*' to match against when resolving JSON files to schemas.",
|
||||||
|
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
|
||||||
|
"json.format.enable.desc": "Enable/disable default JSON formatter (requires restart)",
|
||||||
|
"json.tracing.desc": "Traces the communication between VS Code and the JSON language server.",
|
||||||
|
"json.colorDecorators.enable.desc": "Enables or disables color decorators",
|
||||||
|
"json.colorDecorators.enable.deprecationMessage": "The setting `json.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`."
|
||||||
|
}
|
||||||
7
extensions/json-language-features/server/.npmignore
Normal file
7
extensions/json-language-features/server/.npmignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.vscode/
|
||||||
|
out/test/
|
||||||
|
out/**/*.js.map
|
||||||
|
src/
|
||||||
|
test/
|
||||||
|
tsconfig.json
|
||||||
|
.gitignore
|
||||||
@@ -8,7 +8,8 @@
|
|||||||
"request": "attach",
|
"request": "attach",
|
||||||
"port": 6004,
|
"port": 6004,
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"outDir": "${workspaceFolder}/out"
|
"outFiles": ["${workspaceFolder}/out/**/*js"],
|
||||||
|
"preLaunchTask": "npm: compile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Unit Tests",
|
"name": "Unit Tests",
|
||||||
@@ -26,7 +27,8 @@
|
|||||||
"runtimeArgs": [],
|
"runtimeArgs": [],
|
||||||
"env": {},
|
"env": {},
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"outDir": "${workspaceFolder}/out"
|
"outFiles": ["${workspaceFolder}/out/**/*js"],
|
||||||
|
"preLaunchTask": "npm: compile"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
20
extensions/json-language-features/server/.vscode/tasks.json
vendored
Normal file
20
extensions/json-language-features/server/.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "compile",
|
||||||
|
"problemMatcher": "$tsc-watch",
|
||||||
|
"isBackground": true,
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "never"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
173
extensions/json-language-features/server/README.md
Normal file
173
extensions/json-language-features/server/README.md
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
# VSCode JSON Language Server
|
||||||
|
|
||||||
|
[](https://npmjs.org/package/vscode-json-languageserver)
|
||||||
|
[](https://npmjs.org/package/vscode-json-languageserver)
|
||||||
|
[](https://npmjs.org/package/vscode-json-languageserver)
|
||||||
|
|
||||||
|
The JSON Language server provides language-specific smarts for editing, validating and understanding JSON documents. It runs as a separate executable and implements the [language server protocol](https://microsoft.github.io/language-server-protocol/overview) to be connected by any code editor or IDE.
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
### Server capabilities
|
||||||
|
|
||||||
|
The JSON language server supports requests on documents of language id `json` and `jsonc`.
|
||||||
|
- `json` documents are parsed and validated following the [JSON specification](https://tools.ietf.org/html/rfc7159).
|
||||||
|
- `jsonc` documents additionally accept single line (`//`) and multi-line comments (`/* ... */`) and accepts trailing commas. JSONC is a VSCode specific file format, intended for VSCode configuration files, without any aspirations to define a new common file format.
|
||||||
|
|
||||||
|
The server implements the following capabilities of the language server protocol:
|
||||||
|
|
||||||
|
- [Code completion](https://microsoft.github.io/language-server-protocol/specification#textDocument_completion) for JSON properties and values based on the document's [JSON schema](http://json-schema.org/) or based on existing properties and values used at other places in the document. JSON schemas are configured through the server configuration options.
|
||||||
|
- [Hover](https://microsoft.github.io/language-server-protocol/specification#textDocument_hover) for values based on descriptions in the document's [JSON schema](http://json-schema.org/).
|
||||||
|
- [Document Symbols](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) for quick navigation to properties in the document.
|
||||||
|
- [Document Colors](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentColor) for showing color decorators on values representing colors and [Color Presentation](https://microsoft.github.io/language-server-protocol/specification#textDocument_colorPresentation) for color presentation information to support color pickers. The location of colors is defined by the document's [JSON schema](http://json-schema.org/). All values marked with `"format": "color-hex"` (VSCode specific, non-standard JSON Schema extension) are considered color values. The supported color formats are `#rgb[a]` and `#rrggbb[aa]`.
|
||||||
|
- [Code Formatting](https://microsoft.github.io/language-server-protocol/specification#textDocument_rangeFormatting) supporting ranges and formatting the whole document.
|
||||||
|
- [Diagnostics (Validation)](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics) are pushed for all open documents
|
||||||
|
- syntax errors
|
||||||
|
- structural validation based on the document's [JSON schema](http://json-schema.org/).
|
||||||
|
|
||||||
|
In order to load JSON schemas, the JSON server uses NodeJS `http` and `fs` modules. For all other features, the JSON server only relies on the documents and settings provided by the client through the LSP.
|
||||||
|
|
||||||
|
### Client requirements:
|
||||||
|
|
||||||
|
The JSON language server expects the client to only send requests and notifications for documents of language id `json` and `jsonc`.
|
||||||
|
|
||||||
|
The JSON language server has the following dependencies on the client's capabilities:
|
||||||
|
|
||||||
|
- Code completion requires that the client capability has *snippetSupport*. If not supported by the client, the server will not offer the completion capability.
|
||||||
|
- Formatting support requires the client to support *dynamicRegistration* for *rangeFormatting*. If not supported by the client, the server will not offer the format capability.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Settings
|
||||||
|
|
||||||
|
Clients may send a `workspace/didChangeConfiguration` notification to notify the server of settings changes.
|
||||||
|
The server supports the following settings:
|
||||||
|
|
||||||
|
- http
|
||||||
|
- `proxy`: The URL of the proxy server to use when fetching schema. When undefined or empty, no proxy is used.
|
||||||
|
- `proxyStrictSSL`: Whether the proxy server certificate should be verified against the list of supplied CAs.
|
||||||
|
|
||||||
|
- json
|
||||||
|
- `format`
|
||||||
|
- `enable`: Whether the server should register the formatting support. This option is only applicable if the client supports *dynamicRegistration* for *rangeFormatting*
|
||||||
|
- `schema`: Configures association of file names to schema URL or schemas and/or associations of schema URL to schema content.
|
||||||
|
- `fileMatch`: an array or file names or paths (separated by `/`). `*` can be used as a wildcard.
|
||||||
|
- `url`: The URL of the schema, optional when also a schema is provided.
|
||||||
|
- `schema`: The schema content.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"http": {
|
||||||
|
"proxy": "",
|
||||||
|
"proxyStrictSSL": true
|
||||||
|
},
|
||||||
|
"json": {
|
||||||
|
"format": {
|
||||||
|
"enable": true
|
||||||
|
},
|
||||||
|
"schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"foo.json",
|
||||||
|
"*.superfoo.json"
|
||||||
|
],
|
||||||
|
"url": "http://json.schemastore.org/foo",
|
||||||
|
"schema": {
|
||||||
|
"type": "array"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Schema configuration and custom schema content delivery
|
||||||
|
|
||||||
|
[JSON schemas](http://json-schema.org/) are essential for code assist, hovers, color decorators to work and are required for structural validation.
|
||||||
|
|
||||||
|
To find the schema for a given JSON document, the server uses the following mechanisms:
|
||||||
|
- JSON documents can define the schema URL using a `$schema` property
|
||||||
|
- The settings define a schema association based on the documents URL. Settings can either associate a schema URL to a file or path pattern, and they can directly provide a schema.
|
||||||
|
- Additionally, schema associations can also be provided by a custom 'schemaAssociations' configuration call.
|
||||||
|
|
||||||
|
Schemas are identified by URLs. To load the content of a schema, the JSON language server tries to load from that URL or path. The following URL schemas are supported:
|
||||||
|
- `http`, `https`: Loaded using NodeJS's HTTP support. Proxies can be configured through the settings.
|
||||||
|
- `file`: Loaded using NodeJS's `fs` support.
|
||||||
|
- `vscode`: Loaded by an LSP call to the client.
|
||||||
|
|
||||||
|
#### Schema associations notification
|
||||||
|
|
||||||
|
In addition to the settings, schemas associations can also be provided through a notification from the client to the server. This notification is a JSON language server specific, non-standardized, extension to the LSP.
|
||||||
|
|
||||||
|
Notification:
|
||||||
|
- method: 'json/schemaAssociations'
|
||||||
|
- params: `ISchemaAssociations` defined as follows
|
||||||
|
|
||||||
|
```ts
|
||||||
|
interface ISchemaAssociations {
|
||||||
|
[pattern: string]: string[];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- keys: a file names or file path (separated by `/`). `*` can be used as a wildcard.
|
||||||
|
- values: An array of schema URLs
|
||||||
|
|
||||||
|
#### Schema content request
|
||||||
|
|
||||||
|
The schema content for schema URLs that start with `vscode://` will be requested from the client through an LSP request. This request is a JSON language server specific, non-standardized, extension to the LSP.
|
||||||
|
|
||||||
|
Request:
|
||||||
|
- method: 'vscode/content'
|
||||||
|
- params: `string` - The schema URL to request. The server will only ask for URLs that start with `vscode://`
|
||||||
|
- response: `string` - The content of the schema with the given URL
|
||||||
|
|
||||||
|
#### Schema content change notification
|
||||||
|
|
||||||
|
When the client is aware that a schema content has changed, it will notify the server through a notification. This notification is a JSON language server specific, non-standardized, extension to the LSP.
|
||||||
|
The server will, as a response, clear the schema content from the cache and reload the schema content when required again.
|
||||||
|
|
||||||
|
Notification:
|
||||||
|
- method: 'json/schemaContent'
|
||||||
|
- params: `string` the URL of the schema that has changed.
|
||||||
|
|
||||||
|
## Try
|
||||||
|
|
||||||
|
The JSON language server is shipped with [Visual Studio Code](https://code.visualstudio.com/) as part of the built-in VSCode extension `json-language-features`. The server is started when the first JSON file is opened. The [VSCode JSON documentation](https://code.visualstudio.com/docs/languages/json) for detailed information on the user experience and has more information on how to configure the language support.
|
||||||
|
|
||||||
|
## Integrate
|
||||||
|
|
||||||
|
If you plan to integrate the JSON language server into an editor and IDE, check out [this page](https://microsoft.github.io/language-server-protocol/implementors/tools/) if there's already an LSP client integration available.
|
||||||
|
|
||||||
|
You can also launch the language server as a command and connect to it.
|
||||||
|
For that, install the `json-language-server` npm module:
|
||||||
|
|
||||||
|
`npm install -g json-language-server`
|
||||||
|
|
||||||
|
Start the language server with the `json-language-server` command. Use a command line argument to specify the prefered communication channel:
|
||||||
|
|
||||||
|
```
|
||||||
|
json-language-server --node-ipc
|
||||||
|
json-language-server --stdio
|
||||||
|
json-language-server --socket=<port>
|
||||||
|
```
|
||||||
|
|
||||||
|
To connect to the server from NodeJS, see Remy Suen's great write-up on [how to communicate with the server](https://github.com/rcjsuen/dockerfile-language-server-nodejs#communicating-with-the-server) through the available communication channels.
|
||||||
|
|
||||||
|
## Participate
|
||||||
|
|
||||||
|
The source code of the JSON language server can be found [VSCode repository](https://github.com/Microsoft/vscode) at [extensions/json-language-features/server](https://github.com/Microsoft/vscode/tree/master/extensions/json-language-features/server).
|
||||||
|
File issues and pull requests in the [VSCode GitHub Issues](https://github.com/Microsoft/vscode/issues). See the document [How to Contribute](https://github.com/Microsoft/vscode/wiki/How-to-Contribute) on how to build and run from source.
|
||||||
|
|
||||||
|
Most of the functionality of the server is located in libraries:
|
||||||
|
- [jsonc-parser](https://github.com/Microsoft/node-jsonc-parser) contains the JSON parser and scanner.
|
||||||
|
- [vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice) contains the implementation of all features as a re-usable library.
|
||||||
|
- [vscode-languageserver-node](https://github.com/Microsoft/vscode-languageserver-node) contains the implementation of language server for NodeJS.
|
||||||
|
|
||||||
|
Help on any of these projects is very welcome.
|
||||||
|
|
||||||
|
Please see also our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the [MIT](LICENSE.txt) License.
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
require("../out/jsonServerMain");
|
||||||
.htmlPreviewPart {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
38
extensions/json-language-features/server/package.json
Normal file
38
extensions/json-language-features/server/package.json
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"name": "vscode-json-languageserver",
|
||||||
|
"description": "JSON language server",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"author": "Microsoft Corporation",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"vscode-json-languageserver": "./bin/vscode-json-languageserver"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"jsonc-parser": "^2.0.0-next.1",
|
||||||
|
"request-light": "^0.2.2",
|
||||||
|
"vscode-json-languageservice": "^3.1.2-next.2",
|
||||||
|
"vscode-languageserver": "^4.0.0",
|
||||||
|
"vscode-languageserver-protocol-foldingprovider": "^2.0.0-next.2",
|
||||||
|
"vscode-nls": "^3.2.2",
|
||||||
|
"vscode-uri": "^1.0.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/mocha": "2.2.33",
|
||||||
|
"@types/node": "7.0.43"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublishOnly": "npm run clean && npm run test",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"compile": "gulp compile-extension:json-language-features-server",
|
||||||
|
"watch": "gulp watch-extension:json-language-features-server",
|
||||||
|
"clean": "../../../node_modules/.bin/rimraf out",
|
||||||
|
"install-service-next": "yarn add vscode-json-languageservice@next",
|
||||||
|
"install-service-local": "yarn link vscode-json-languageservice",
|
||||||
|
"install-server-next": "yarn add vscode-languageserver@next",
|
||||||
|
"install-server-local": "yarn link vscode-languageserver-server",
|
||||||
|
"version": "git commit -m \"JSON Language Server $npm_package_version\" package.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,19 +10,16 @@ import {
|
|||||||
DocumentRangeFormattingRequest, Disposable, ServerCapabilities
|
DocumentRangeFormattingRequest, Disposable, ServerCapabilities
|
||||||
} from 'vscode-languageserver';
|
} from 'vscode-languageserver';
|
||||||
|
|
||||||
import { DocumentColorRequest, ServerCapabilities as CPServerCapabilities, ColorPresentationRequest } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed';
|
|
||||||
|
|
||||||
import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light';
|
import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light';
|
||||||
import fs = require('fs');
|
import * as fs from 'fs';
|
||||||
import URI from 'vscode-uri';
|
import URI from 'vscode-uri';
|
||||||
import * as URL from 'url';
|
import * as URL from 'url';
|
||||||
import Strings = require('./utils/strings');
|
import { startsWith } from './utils/strings';
|
||||||
import { formatError, runSafe, runSafeAsync } from './utils/errors';
|
import { formatError, runSafe, runSafeAsync } from './utils/runner';
|
||||||
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
|
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
|
||||||
import { getLanguageModelCache } from './languageModelCache';
|
import { getLanguageModelCache } from './languageModelCache';
|
||||||
import { createScanner, SyntaxKind } from 'jsonc-parser';
|
|
||||||
|
|
||||||
import { FoldingRangeType, FoldingRangesRequest, FoldingRange, FoldingRangeList, FoldingProviderServerCapabilities } from './protocol/foldingProvider.proposed';
|
import { FoldingRangeRequest, FoldingRangeServerCapabilities } from 'vscode-languageserver-protocol-foldingprovider';
|
||||||
|
|
||||||
interface ISchemaAssociations {
|
interface ISchemaAssociations {
|
||||||
[pattern: string]: string[];
|
[pattern: string]: string[];
|
||||||
@@ -44,8 +41,12 @@ namespace SchemaContentChangeNotification {
|
|||||||
let connection: IConnection = createConnection();
|
let connection: IConnection = createConnection();
|
||||||
|
|
||||||
process.on('unhandledRejection', (e: any) => {
|
process.on('unhandledRejection', (e: any) => {
|
||||||
connection.console.error(formatError(`Unhandled exception`, e));
|
console.error(formatError(`Unhandled exception`, e));
|
||||||
});
|
});
|
||||||
|
process.on('uncaughtException', (e: any) => {
|
||||||
|
console.error(formatError(`Unhandled exception`, e));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
console.log = connection.console.log.bind(connection.console);
|
console.log = connection.console.log.bind(connection.console);
|
||||||
console.error = connection.console.error.bind(connection.console);
|
console.error = connection.console.error.bind(connection.console);
|
||||||
@@ -59,22 +60,28 @@ documents.listen(connection);
|
|||||||
|
|
||||||
let clientSnippetSupport = false;
|
let clientSnippetSupport = false;
|
||||||
let clientDynamicRegisterSupport = false;
|
let clientDynamicRegisterSupport = false;
|
||||||
|
let foldingRangeLimit = Number.MAX_VALUE;
|
||||||
|
|
||||||
// After the server has started the client sends an initilize request. The server receives
|
// After the server has started the client sends an initialize request. The server receives
|
||||||
// in the passed params the rootPath of the workspace plus the client capabilities.
|
// in the passed params the rootPath of the workspace plus the client capabilities.
|
||||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||||
|
|
||||||
function hasClientCapability(...keys: string[]) {
|
function getClientCapability<T>(name: string, def: T) {
|
||||||
let c = params.capabilities as any;
|
let keys = name.split('.');
|
||||||
|
let c: any = params.capabilities;
|
||||||
for (let i = 0; c && i < keys.length; i++) {
|
for (let i = 0; c && i < keys.length; i++) {
|
||||||
|
if (!c.hasOwnProperty(keys[i])) {
|
||||||
|
return def;
|
||||||
|
}
|
||||||
c = c[keys[i]];
|
c = c[keys[i]];
|
||||||
}
|
}
|
||||||
return !!c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
clientSnippetSupport = hasClientCapability('textDocument', 'completion', 'completionItem', 'snippetSupport');
|
clientSnippetSupport = getClientCapability('textDocument.completion.completionItem.snippetSupport', false);
|
||||||
clientDynamicRegisterSupport = hasClientCapability('workspace', 'symbol', 'dynamicRegistration');
|
clientDynamicRegisterSupport = getClientCapability('workspace.symbol.dynamicRegistration', false);
|
||||||
let capabilities: ServerCapabilities & CPServerCapabilities & FoldingProviderServerCapabilities = {
|
foldingRangeLimit = getClientCapability('textDocument.foldingRange.rangeLimit', Number.MAX_VALUE);
|
||||||
|
let capabilities: ServerCapabilities & FoldingRangeServerCapabilities = {
|
||||||
// Tell the client that the server works in FULL text document sync mode
|
// Tell the client that the server works in FULL text document sync mode
|
||||||
textDocumentSync: documents.syncKind,
|
textDocumentSync: documents.syncKind,
|
||||||
completionProvider: clientSnippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : void 0,
|
completionProvider: clientSnippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : void 0,
|
||||||
@@ -82,7 +89,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
|||||||
documentSymbolProvider: true,
|
documentSymbolProvider: true,
|
||||||
documentRangeFormattingProvider: false,
|
documentRangeFormattingProvider: false,
|
||||||
colorProvider: true,
|
colorProvider: true,
|
||||||
foldingProvider: true
|
foldingRangeProvider: true
|
||||||
};
|
};
|
||||||
|
|
||||||
return { capabilities };
|
return { capabilities };
|
||||||
@@ -95,14 +102,14 @@ let workspaceContext = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let schemaRequestService = (uri: string): Thenable<string> => {
|
let schemaRequestService = (uri: string): Thenable<string> => {
|
||||||
if (Strings.startsWith(uri, 'file://')) {
|
if (startsWith(uri, 'file://')) {
|
||||||
let fsPath = URI.parse(uri).fsPath;
|
let fsPath = URI.parse(uri).fsPath;
|
||||||
return new Promise<string>((c, e) => {
|
return new Promise<string>((c, e) => {
|
||||||
fs.readFile(fsPath, 'UTF-8', (err, result) => {
|
fs.readFile(fsPath, 'UTF-8', (err, result) => {
|
||||||
err ? e('') : c(result.toString());
|
err ? e('') : c(result.toString());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (Strings.startsWith(uri, 'vscode://')) {
|
} else if (startsWith(uri, 'vscode://')) {
|
||||||
return connection.sendRequest(VSCodeContentRequest.type, uri).then(responseText => {
|
return connection.sendRequest(VSCodeContentRequest.type, uri).then(responseText => {
|
||||||
return responseText;
|
return responseText;
|
||||||
}, error => {
|
}, error => {
|
||||||
@@ -110,6 +117,11 @@ let schemaRequestService = (uri: string): Thenable<string> => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (uri.indexOf('//schema.management.azure.com/') !== -1) {
|
if (uri.indexOf('//schema.management.azure.com/') !== -1) {
|
||||||
|
/* __GDPR__
|
||||||
|
"json.schema" : {
|
||||||
|
"schemaURL" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||||
|
}
|
||||||
|
*/
|
||||||
connection.telemetry.logEvent({
|
connection.telemetry.logEvent({
|
||||||
key: 'json.schema',
|
key: 'json.schema',
|
||||||
value: {
|
value: {
|
||||||
@@ -257,17 +269,21 @@ function validateTextDocument(textDocument: TextDocument): void {
|
|||||||
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] });
|
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
let jsonDocument = getJSONDocument(textDocument);
|
let jsonDocument = getJSONDocument(textDocument);
|
||||||
|
let version = textDocument.version;
|
||||||
|
|
||||||
let documentSettings: DocumentLanguageSettings = textDocument.languageId === 'jsonc' ? { comments: 'ignore', trailingCommas: 'ignore' } : { comments: 'error', trailingCommas: 'error' };
|
let documentSettings: DocumentLanguageSettings = textDocument.languageId === 'jsonc' ? { comments: 'ignore', trailingCommas: 'ignore' } : { comments: 'error', trailingCommas: 'error' };
|
||||||
languageService.doValidation(textDocument, jsonDocument, documentSettings).then(diagnostics => {
|
languageService.doValidation(textDocument, jsonDocument, documentSettings).then(diagnostics => {
|
||||||
|
setTimeout(() => {
|
||||||
|
let currDocument = documents.get(textDocument.uri);
|
||||||
|
if (currDocument && currDocument.version === version) {
|
||||||
// Send the computed diagnostics to VSCode.
|
// Send the computed diagnostics to VSCode.
|
||||||
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
connection.console.error(formatError(`Error while validating ${textDocument.uri}`, e));
|
|
||||||
}
|
}
|
||||||
|
}, 100);
|
||||||
|
}, error => {
|
||||||
|
connection.console.error(formatError(`Error while validating ${textDocument.uri}`, error));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.onDidChangeWatchedFiles((change) => {
|
connection.onDidChangeWatchedFiles((change) => {
|
||||||
@@ -279,7 +295,7 @@ connection.onDidChangeWatchedFiles((change) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (hasChanges) {
|
if (hasChanges) {
|
||||||
documents.all().forEach(validateTextDocument);
|
documents.all().forEach(triggerValidation);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -295,44 +311,44 @@ function getJSONDocument(document: TextDocument): JSONDocument {
|
|||||||
return jsonDocuments.get(document);
|
return jsonDocuments.get(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.onCompletion(textDocumentPosition => {
|
connection.onCompletion((textDocumentPosition, token) => {
|
||||||
return runSafeAsync(() => {
|
return runSafeAsync(() => {
|
||||||
let document = documents.get(textDocumentPosition.textDocument.uri);
|
let document = documents.get(textDocumentPosition.textDocument.uri);
|
||||||
let jsonDocument = getJSONDocument(document);
|
let jsonDocument = getJSONDocument(document);
|
||||||
return languageService.doComplete(document, textDocumentPosition.position, jsonDocument);
|
return languageService.doComplete(document, textDocumentPosition.position, jsonDocument);
|
||||||
}, null, `Error while computing completions for ${textDocumentPosition.textDocument.uri}`);
|
}, null, `Error while computing completions for ${textDocumentPosition.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onCompletionResolve(completionItem => {
|
connection.onCompletionResolve((completionItem, token) => {
|
||||||
return runSafeAsync(() => {
|
return runSafeAsync(() => {
|
||||||
return languageService.doResolve(completionItem);
|
return languageService.doResolve(completionItem);
|
||||||
}, completionItem, `Error while resolving completion proposal`);
|
}, completionItem, `Error while resolving completion proposal`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onHover(textDocumentPositionParams => {
|
connection.onHover((textDocumentPositionParams, token) => {
|
||||||
return runSafeAsync(() => {
|
return runSafeAsync(() => {
|
||||||
let document = documents.get(textDocumentPositionParams.textDocument.uri);
|
let document = documents.get(textDocumentPositionParams.textDocument.uri);
|
||||||
let jsonDocument = getJSONDocument(document);
|
let jsonDocument = getJSONDocument(document);
|
||||||
return languageService.doHover(document, textDocumentPositionParams.position, jsonDocument);
|
return languageService.doHover(document, textDocumentPositionParams.position, jsonDocument);
|
||||||
}, null, `Error while computing hover for ${textDocumentPositionParams.textDocument.uri}`);
|
}, null, `Error while computing hover for ${textDocumentPositionParams.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onDocumentSymbol(documentSymbolParams => {
|
connection.onDocumentSymbol((documentSymbolParams, token) => {
|
||||||
return runSafe(() => {
|
return runSafe(() => {
|
||||||
let document = documents.get(documentSymbolParams.textDocument.uri);
|
let document = documents.get(documentSymbolParams.textDocument.uri);
|
||||||
let jsonDocument = getJSONDocument(document);
|
let jsonDocument = getJSONDocument(document);
|
||||||
return languageService.findDocumentSymbols(document, jsonDocument);
|
return languageService.findDocumentSymbols(document, jsonDocument);
|
||||||
}, [], `Error while computing document symbols for ${documentSymbolParams.textDocument.uri}`);
|
}, [], `Error while computing document symbols for ${documentSymbolParams.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onDocumentRangeFormatting(formatParams => {
|
connection.onDocumentRangeFormatting((formatParams, token) => {
|
||||||
return runSafe(() => {
|
return runSafe(() => {
|
||||||
let document = documents.get(formatParams.textDocument.uri);
|
let document = documents.get(formatParams.textDocument.uri);
|
||||||
return languageService.format(document, formatParams.range, formatParams.options);
|
return languageService.format(document, formatParams.range, formatParams.options);
|
||||||
}, [], `Error while formatting range for ${formatParams.textDocument.uri}`);
|
}, [], `Error while formatting range for ${formatParams.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onRequest(DocumentColorRequest.type, params => {
|
connection.onDocumentColor((params, token) => {
|
||||||
return runSafeAsync(() => {
|
return runSafeAsync(() => {
|
||||||
let document = documents.get(params.textDocument.uri);
|
let document = documents.get(params.textDocument.uri);
|
||||||
if (document) {
|
if (document) {
|
||||||
@@ -340,10 +356,10 @@ connection.onRequest(DocumentColorRequest.type, params => {
|
|||||||
return languageService.findDocumentColors(document, jsonDocument);
|
return languageService.findDocumentColors(document, jsonDocument);
|
||||||
}
|
}
|
||||||
return Promise.resolve([]);
|
return Promise.resolve([]);
|
||||||
}, [], `Error while computing document colors for ${params.textDocument.uri}`);
|
}, [], `Error while computing document colors for ${params.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onRequest(ColorPresentationRequest.type, params => {
|
connection.onColorPresentation((params, token) => {
|
||||||
return runSafe(() => {
|
return runSafe(() => {
|
||||||
let document = documents.get(params.textDocument.uri);
|
let document = documents.get(params.textDocument.uri);
|
||||||
if (document) {
|
if (document) {
|
||||||
@@ -351,86 +367,17 @@ connection.onRequest(ColorPresentationRequest.type, params => {
|
|||||||
return languageService.getColorPresentations(document, jsonDocument, params.color, params.range);
|
return languageService.getColorPresentations(document, jsonDocument, params.color, params.range);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
}, [], `Error while computing color presentations for ${params.textDocument.uri}`);
|
}, [], `Error while computing color presentations for ${params.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onRequest(FoldingRangesRequest.type, params => {
|
connection.onRequest(FoldingRangeRequest.type, (params, token) => {
|
||||||
return runSafe(() => {
|
return runSafe(() => {
|
||||||
let document = documents.get(params.textDocument.uri);
|
let document = documents.get(params.textDocument.uri);
|
||||||
if (document) {
|
if (document) {
|
||||||
let ranges: FoldingRange[] = [];
|
return languageService.getFoldingRanges(document, { rangeLimit: foldingRangeLimit });
|
||||||
let stack: FoldingRange[] = [];
|
|
||||||
let prevStart = -1;
|
|
||||||
let scanner = createScanner(document.getText(), false);
|
|
||||||
let token = scanner.scan();
|
|
||||||
while (token !== SyntaxKind.EOF) {
|
|
||||||
switch (token) {
|
|
||||||
case SyntaxKind.OpenBraceToken:
|
|
||||||
case SyntaxKind.OpenBracketToken: {
|
|
||||||
let startLine = document.positionAt(scanner.getTokenOffset()).line;
|
|
||||||
let range = { startLine, endLine: startLine, type: token === SyntaxKind.OpenBraceToken ? 'object' : 'array' };
|
|
||||||
stack.push(range);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SyntaxKind.CloseBraceToken:
|
|
||||||
case SyntaxKind.CloseBracketToken: {
|
|
||||||
let type = token === SyntaxKind.CloseBraceToken ? 'object' : 'array';
|
|
||||||
if (stack.length > 0 && stack[stack.length - 1].type === type) {
|
|
||||||
let range = stack.pop();
|
|
||||||
let line = document.positionAt(scanner.getTokenOffset()).line;
|
|
||||||
if (range && line > range.startLine + 1 && prevStart !== range.startLine) {
|
|
||||||
range.endLine = line - 1;
|
|
||||||
ranges.push(range);
|
|
||||||
prevStart = range.startLine;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SyntaxKind.BlockCommentTrivia: {
|
|
||||||
let startLine = document.positionAt(scanner.getTokenOffset()).line;
|
|
||||||
let endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line;
|
|
||||||
if (startLine < endLine) {
|
|
||||||
ranges.push({ startLine, endLine, type: FoldingRangeType.Comment });
|
|
||||||
prevStart = startLine;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SyntaxKind.LineCommentTrivia: {
|
|
||||||
let text = document.getText().substr(scanner.getTokenOffset(), scanner.getTokenLength());
|
|
||||||
let m = text.match(/^\/\/\s*#(region\b)|(endregion\b)/);
|
|
||||||
if (m) {
|
|
||||||
let line = document.positionAt(scanner.getTokenOffset()).line;
|
|
||||||
if (m[1]) { // start pattern match
|
|
||||||
let range = { startLine: line, endLine: line, type: FoldingRangeType.Region };
|
|
||||||
stack.push(range);
|
|
||||||
} else {
|
|
||||||
let i = stack.length - 1;
|
|
||||||
while (i >= 0 && stack[i].type !== FoldingRangeType.Region) {
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
if (i >= 0) {
|
|
||||||
let range = stack[i];
|
|
||||||
stack.length = i;
|
|
||||||
if (line > range.startLine && prevStart !== range.startLine) {
|
|
||||||
range.endLine = line;
|
|
||||||
ranges.push(range);
|
|
||||||
prevStart = range.startLine;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
token = scanner.scan();
|
|
||||||
}
|
|
||||||
return <FoldingRangeList>{ ranges };
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`);
|
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Listen on the connection
|
// Listen on the connection
|
||||||
69
extensions/json-language-features/server/src/utils/runner.ts
Normal file
69
extensions/json-language-features/server/src/utils/runner.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import { CancellationToken, ResponseError, ErrorCodes } from 'vscode-languageserver';
|
||||||
|
|
||||||
|
export function formatError(message: string, err: any): string {
|
||||||
|
if (err instanceof Error) {
|
||||||
|
let error = <Error>err;
|
||||||
|
return `${message}: ${error.message}\n${error.stack}`;
|
||||||
|
} else if (typeof err === 'string') {
|
||||||
|
return `${message}: ${err}`;
|
||||||
|
} else if (err) {
|
||||||
|
return `${message}: ${err.toString()}`;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function runSafeAsync<T>(func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
|
||||||
|
return new Promise<T | ResponseError<any>>((resolve, reject) => {
|
||||||
|
setImmediate(() => {
|
||||||
|
if (token.isCancellationRequested) {
|
||||||
|
resolve(cancelValue());
|
||||||
|
}
|
||||||
|
return func().then(result => {
|
||||||
|
if (token.isCancellationRequested) {
|
||||||
|
resolve(cancelValue());
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
resolve(result);
|
||||||
|
}
|
||||||
|
}, e => {
|
||||||
|
console.error(formatError(errorMessage, e));
|
||||||
|
resolve(errorVal);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function runSafe<T, E>(func: () => T, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<E>> {
|
||||||
|
return new Promise<T | ResponseError<E>>((resolve, reject) => {
|
||||||
|
setImmediate(() => {
|
||||||
|
if (token.isCancellationRequested) {
|
||||||
|
resolve(cancelValue());
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
let result = func();
|
||||||
|
if (token.isCancellationRequested) {
|
||||||
|
resolve(cancelValue());
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
resolve(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
console.error(formatError(errorMessage, e));
|
||||||
|
resolve(errorVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelValue<E>() {
|
||||||
|
console.log('cancelled');
|
||||||
|
return new ResponseError<E>(ErrorCodes.RequestCancelled, 'Request cancelled');
|
||||||
|
}
|
||||||
3
extensions/json-language-features/server/test/mocha.opts
Normal file
3
extensions/json-language-features/server/test/mocha.opts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
--ui tdd
|
||||||
|
--useColors true
|
||||||
|
./out/test/**/*.test.js
|
||||||
@@ -2,6 +2,10 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
"@types/mocha@2.2.33":
|
||||||
|
version "2.2.33"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def"
|
||||||
|
|
||||||
"@types/node@7.0.43":
|
"@types/node@7.0.43":
|
||||||
version "7.0.43"
|
version "7.0.43"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||||
@@ -48,9 +52,13 @@ https-proxy-agent@2.1.1:
|
|||||||
agent-base "^4.1.0"
|
agent-base "^4.1.0"
|
||||||
debug "^3.1.0"
|
debug "^3.1.0"
|
||||||
|
|
||||||
jsonc-parser@^1.0.1:
|
jsonc-parser@^2.0.0:
|
||||||
version "1.0.1"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-1.0.1.tgz#7f8f296414e6e7c4a33b9e4914fc8c47e4421675"
|
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.0.tgz#62ff087a7e753875febf3c55f1fc0cd737c36b5a"
|
||||||
|
|
||||||
|
jsonc-parser@^2.0.0-next.1:
|
||||||
|
version "2.0.0-next.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.0-next.1.tgz#445a824f765a96abfbb286d759a9b1d226b18088"
|
||||||
|
|
||||||
ms@2.0.0:
|
ms@2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
@@ -64,35 +72,46 @@ request-light@^0.2.2:
|
|||||||
https-proxy-agent "2.1.1"
|
https-proxy-agent "2.1.1"
|
||||||
vscode-nls "^2.0.2"
|
vscode-nls "^2.0.2"
|
||||||
|
|
||||||
vscode-json-languageservice@^3.0.7:
|
vscode-json-languageservice@^3.1.2-next.2:
|
||||||
version "3.0.7"
|
version "3.1.2-next.2"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.0.7.tgz#dc00117d51d4a7ac3bde9204afa701f962f00736"
|
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.1.2-next.2.tgz#da5346e5c22edbce739f29c110eb41732d41dc2d"
|
||||||
dependencies:
|
dependencies:
|
||||||
jsonc-parser "^1.0.1"
|
jsonc-parser "^2.0.0"
|
||||||
vscode-languageserver-types "^3.6.0-next.1"
|
vscode-languageserver-types "^3.6.1"
|
||||||
vscode-nls "^2.0.2"
|
vscode-nls "^3.2.1"
|
||||||
vscode-uri "^1.0.1"
|
vscode-uri "^1.0.3"
|
||||||
|
|
||||||
vscode-jsonrpc@^3.6.0-next.1:
|
vscode-jsonrpc@^3.6.0:
|
||||||
version "3.6.0-next.1"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.0-next.1.tgz#3cb463dffe5842d6aec16718ca9252708cd6aabe"
|
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.0.tgz#848d56995d5168950d84feb5d9c237ae5c6a02d4"
|
||||||
|
|
||||||
vscode-languageserver-protocol@^3.6.0-next.3:
|
vscode-languageserver-protocol-foldingprovider@^2.0.0-next.2:
|
||||||
version "3.6.0-next.4"
|
version "2.0.0-next.2"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.6.0-next.4.tgz#5b9940e4d6afafd5b63f9731dbd3a9bcc65b3719"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol-foldingprovider/-/vscode-languageserver-protocol-foldingprovider-2.0.0-next.2.tgz#fbb9cfdf5b8c4ac451826ba6312f1f88379f35b0"
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-jsonrpc "^3.6.0-next.1"
|
vscode-languageserver-protocol "^3.6.0"
|
||||||
vscode-languageserver-types "^3.6.0-next.1"
|
vscode-languageserver-types "^3.6.0"
|
||||||
|
|
||||||
vscode-languageserver-types@^3.6.0-next.1:
|
vscode-languageserver-protocol@^3.6.0:
|
||||||
version "3.6.0-next.1"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.0-next.1.tgz#98e488d3f87b666b4ee1a3d89f0023e246d358f3"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.6.0.tgz#579642cdcccf74b0cd771c33daa3239acb40d040"
|
||||||
|
|
||||||
vscode-languageserver@4.0.0-next.3:
|
|
||||||
version "4.0.0-next.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-4.0.0-next.3.tgz#89a9ce5078e3a86a78e3551c3766194ce4295611"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-languageserver-protocol "^3.6.0-next.3"
|
vscode-jsonrpc "^3.6.0"
|
||||||
|
vscode-languageserver-types "^3.6.0"
|
||||||
|
|
||||||
|
vscode-languageserver-types@^3.6.0:
|
||||||
|
version "3.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.0.tgz#0bba63b0fa82a714394a4478f55a596ee4ed7d0a"
|
||||||
|
|
||||||
|
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@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-4.0.0.tgz#8b792f0d6d10acfe363d02371ed4ce53d08af88a"
|
||||||
|
dependencies:
|
||||||
|
vscode-languageserver-protocol "^3.6.0"
|
||||||
vscode-uri "^1.0.1"
|
vscode-uri "^1.0.1"
|
||||||
|
|
||||||
vscode-nls@^2.0.2:
|
vscode-nls@^2.0.2:
|
||||||
@@ -103,6 +122,14 @@ vscode-nls@^3.2.1:
|
|||||||
version "3.2.1"
|
version "3.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
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"
|
||||||
|
|
||||||
vscode-uri@^1.0.1:
|
vscode-uri@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.1.tgz#11a86befeac3c4aa3ec08623651a3c81a6d0bbc8"
|
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.1.tgz#11a86befeac3c4aa3ec08623651a3c81a6d0bbc8"
|
||||||
|
|
||||||
|
vscode-uri@^1.0.3:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.3.tgz#631bdbf716dccab0e65291a8dc25c23232085a52"
|
||||||
@@ -28,36 +28,43 @@ semver@^5.3.0:
|
|||||||
version "5.5.0"
|
version "5.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||||
|
|
||||||
vscode-extension-telemetry@0.0.15:
|
vscode-extension-telemetry@0.0.17:
|
||||||
version "0.0.15"
|
version "0.0.17"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.15.tgz#685c32f3b67e8fb85ba689c1d7f88ff90ff87856"
|
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.17.tgz#15123e7edb34e7b9724b6056f54a869bbb922cb7"
|
||||||
dependencies:
|
dependencies:
|
||||||
applicationinsights "1.0.1"
|
applicationinsights "1.0.1"
|
||||||
|
|
||||||
vscode-jsonrpc@^3.6.0-next.1:
|
vscode-jsonrpc@^3.6.0:
|
||||||
version "3.6.0-next.1"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.0-next.1.tgz#3cb463dffe5842d6aec16718ca9252708cd6aabe"
|
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.6.0.tgz#848d56995d5168950d84feb5d9c237ae5c6a02d4"
|
||||||
|
|
||||||
vscode-languageclient@4.0.0-next.9:
|
vscode-languageclient@^4.0.0:
|
||||||
version "4.0.0-next.9"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-4.0.0-next.9.tgz#2a06568f46ee9de3490f85e227d3740a21a03d3a"
|
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-4.0.0.tgz#635f5bfbcfa1385dae489b394857f1db8b459a7d"
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-languageserver-protocol "^3.6.0-next.5"
|
vscode-languageserver-protocol "^3.6.0"
|
||||||
|
|
||||||
vscode-languageserver-protocol@^3.6.0-next.5:
|
vscode-languageserver-protocol-foldingprovider@^2.0.0-next.2:
|
||||||
version "3.6.0-next.5"
|
version "2.0.0-next.2"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.6.0-next.5.tgz#ed2ec2db759826f753c0a13977dfb2bedc4d31b3"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol-foldingprovider/-/vscode-languageserver-protocol-foldingprovider-2.0.0-next.2.tgz#fbb9cfdf5b8c4ac451826ba6312f1f88379f35b0"
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-jsonrpc "^3.6.0-next.1"
|
vscode-languageserver-protocol "^3.6.0"
|
||||||
vscode-languageserver-types "^3.6.0-next.1"
|
vscode-languageserver-types "^3.6.0"
|
||||||
|
|
||||||
vscode-languageserver-types@^3.6.0-next.1:
|
vscode-languageserver-protocol@^3.6.0:
|
||||||
version "3.6.0-next.1"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.0-next.1.tgz#98e488d3f87b666b4ee1a3d89f0023e246d358f3"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.6.0.tgz#579642cdcccf74b0cd771c33daa3239acb40d040"
|
||||||
|
dependencies:
|
||||||
|
vscode-jsonrpc "^3.6.0"
|
||||||
|
vscode-languageserver-types "^3.6.0"
|
||||||
|
|
||||||
vscode-nls@^3.2.1:
|
vscode-languageserver-types@^3.6.0:
|
||||||
version "3.2.1"
|
version "3.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.6.0.tgz#0bba63b0fa82a714394a4478f55a596ee4ed7d0a"
|
||||||
|
|
||||||
|
vscode-nls@^3.2.2:
|
||||||
|
version "3.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.2.tgz#3817eca5b985c2393de325197cf4e15eb2aa5350"
|
||||||
|
|
||||||
zone.js@0.7.6:
|
zone.js@0.7.6:
|
||||||
version "0.7.6"
|
version "0.7.6"
|
||||||
@@ -1,6 +1 @@
|
|||||||
test/**
|
test/**
|
||||||
client/tsconfig.json
|
|
||||||
client/src/**
|
|
||||||
server/tsconfig.json
|
|
||||||
server/src/**
|
|
||||||
server/node_modules/@types/**
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
|
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
|
||||||
[{
|
[{
|
||||||
"name": "Benvie/JavaScriptNext.tmLanguage",
|
"name": "Microsoft/vscode-JSON.tmLanguage",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repositoryURL": "https://github.com/Microsoft/vscode-JSON.tmLanguage"
|
"repositoryURL": "https://github.com/Microsoft/vscode-JSON.tmLanguage"
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import { TextDocumentIdentifier } from 'vscode-languageserver-types';
|
|
||||||
import { RequestType, TextDocumentRegistrationOptions, StaticRegistrationOptions } from 'vscode-languageserver-protocol';
|
|
||||||
|
|
||||||
// ---- capabilities
|
|
||||||
|
|
||||||
export interface FoldingProviderClientCapabilities {
|
|
||||||
/**
|
|
||||||
* The text document client capabilities
|
|
||||||
*/
|
|
||||||
textDocument?: {
|
|
||||||
/**
|
|
||||||
* Capabilities specific to the foldingProvider
|
|
||||||
*/
|
|
||||||
foldingProvider?: {
|
|
||||||
/**
|
|
||||||
* Whether implementation supports dynamic registration. If this is set to `true`
|
|
||||||
* the client supports the new `(FoldingProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
|
|
||||||
* return value for the corresponding server capability as well.
|
|
||||||
*/
|
|
||||||
dynamicRegistration?: boolean;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingProviderOptions {
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingProviderServerCapabilities {
|
|
||||||
/**
|
|
||||||
* The server provides folding provider support.
|
|
||||||
*/
|
|
||||||
foldingProvider?: FoldingProviderOptions | (FoldingProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingRangeList {
|
|
||||||
/**
|
|
||||||
* The folding ranges.
|
|
||||||
*/
|
|
||||||
ranges: FoldingRange[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum FoldingRangeType {
|
|
||||||
/**
|
|
||||||
* Folding range for a comment
|
|
||||||
*/
|
|
||||||
Comment = 'comment',
|
|
||||||
/**
|
|
||||||
* Folding range for a imports or includes
|
|
||||||
*/
|
|
||||||
Imports = 'imports',
|
|
||||||
/**
|
|
||||||
* Folding range for a region (e.g. `#region`)
|
|
||||||
*/
|
|
||||||
Region = 'region'
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingRange {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The start line number
|
|
||||||
*/
|
|
||||||
startLine: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The end line number
|
|
||||||
*/
|
|
||||||
endLine: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actual color value for this folding range.
|
|
||||||
*/
|
|
||||||
type?: FoldingRangeType | string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingRangeRequestParam {
|
|
||||||
/**
|
|
||||||
* The text document.
|
|
||||||
*/
|
|
||||||
textDocument: TextDocumentIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace FoldingRangesRequest {
|
|
||||||
export const type: RequestType<FoldingRangeRequestParam, FoldingRangeList | null, any, any> = new RequestType('textDocument/foldingRanges');
|
|
||||||
}
|
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
{ "open": "[", "close": "]", "notIn": ["string"] },
|
{ "open": "[", "close": "]", "notIn": ["string"] },
|
||||||
{ "open": "(", "close": ")", "notIn": ["string"] },
|
{ "open": "(", "close": ")", "notIn": ["string"] },
|
||||||
{ "open": "'", "close": "'", "notIn": ["string"] },
|
{ "open": "'", "close": "'", "notIn": ["string"] },
|
||||||
|
{ "open": "/*", "close": "*/", "notIn": ["string"] },
|
||||||
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
|
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
|
||||||
{ "open": "`", "close": "`", "notIn": ["string", "comment"] }
|
{ "open": "`", "close": "`", "notIn": ["string", "comment"] }
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -4,21 +4,10 @@
|
|||||||
"description": "%description%",
|
"description": "%description%",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"publisher": "vscode",
|
"publisher": "vscode",
|
||||||
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "0.10.x"
|
"vscode": "0.10.x"
|
||||||
},
|
},
|
||||||
"icon": "icons/json.png",
|
|
||||||
"activationEvents": [
|
|
||||||
"onLanguage:json",
|
|
||||||
"onLanguage:jsonc"
|
|
||||||
],
|
|
||||||
"enableProposedApi": true,
|
|
||||||
"main": "./client/out/jsonMain",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "gulp compile-extension:json-client && gulp compile-extension:json-server",
|
|
||||||
"postinstall": "cd server && yarn install",
|
|
||||||
"install-client-next": "yarn add vscode-languageclient@next",
|
|
||||||
"update-grammar": "node ../../build/npm/update-grammar.js Microsoft/vscode-JSON.tmLanguage JSON.tmLanguage ./syntaxes/JSON.tmLanguage.json"
|
"update-grammar": "node ../../build/npm/update-grammar.js Microsoft/vscode-JSON.tmLanguage JSON.tmLanguage ./syntaxes/JSON.tmLanguage.json"
|
||||||
},
|
},
|
||||||
"contributes": {
|
"contributes": {
|
||||||
@@ -88,93 +77,6 @@
|
|||||||
"fileMatch": "*.schema.json",
|
"fileMatch": "*.schema.json",
|
||||||
"url": "http://json-schema.org/draft-04/schema#"
|
"url": "http://json-schema.org/draft-04/schema#"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"configuration": {
|
|
||||||
"id": "json",
|
|
||||||
"order": 20,
|
|
||||||
"type": "object",
|
|
||||||
"title": "JSON",
|
|
||||||
"properties": {
|
|
||||||
"json.schemas": {
|
|
||||||
"type": "array",
|
|
||||||
"scope": "resource",
|
|
||||||
"description": "%json.schemas.desc%",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"default": {
|
|
||||||
"fileMatch": [
|
|
||||||
"/myfile"
|
|
||||||
],
|
|
||||||
"url": "schemaURL"
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"url": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "/user.schema.json",
|
|
||||||
"description": "%json.schemas.url.desc%"
|
|
||||||
},
|
|
||||||
"fileMatch": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "MyFile.json",
|
|
||||||
"description": "%json.schemas.fileMatch.item.desc%"
|
|
||||||
},
|
|
||||||
"minItems": 1,
|
|
||||||
"description": "%json.schemas.fileMatch.desc%"
|
|
||||||
},
|
|
||||||
"schema": {
|
|
||||||
"$ref": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"description": "%json.schemas.schema.desc%"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"json.format.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"scope": "window",
|
|
||||||
"default": true,
|
|
||||||
"description": "%json.format.enable.desc%"
|
|
||||||
},
|
|
||||||
"json.trace.server": {
|
|
||||||
"type": "string",
|
|
||||||
"scope": "window",
|
|
||||||
"enum": [
|
|
||||||
"off",
|
|
||||||
"messages",
|
|
||||||
"verbose"
|
|
||||||
],
|
|
||||||
"default": "off",
|
|
||||||
"description": "%json.tracing.desc%"
|
|
||||||
},
|
|
||||||
"json.colorDecorators.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"scope": "window",
|
|
||||||
"default": true,
|
|
||||||
"description": "%json.colorDecorators.enable.desc%",
|
|
||||||
"deprecationMessage": "%json.colorDecorators.enable.deprecationMessage%"
|
|
||||||
},
|
|
||||||
"json.experimental.syntaxFolding": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false,
|
|
||||||
"description": "%json.experimental.syntaxFolding%"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"configurationDefaults": {
|
|
||||||
"[json]": {
|
|
||||||
"editor.quickSuggestions": {
|
|
||||||
"strings": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"vscode-extension-telemetry": "0.0.15",
|
|
||||||
"vscode-languageclient": "4.0.0-next.9",
|
|
||||||
"vscode-nls": "^3.2.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "7.0.43"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,4 @@
|
|||||||
{
|
{
|
||||||
"displayName": "JSON Language Features",
|
"displayName": "JSON Language Basics",
|
||||||
"description": "Provides rich language support for JSON files.",
|
"description": "Provides syntax highlighting & bracket matching in JSON files."
|
||||||
"json.schemas.desc": "Associate schemas to JSON files in the current project",
|
|
||||||
"json.schemas.url.desc": "A URL to a schema or a relative path to a schema in the current directory",
|
|
||||||
"json.schemas.fileMatch.desc": "An array of file patterns to match against when resolving JSON files to schemas.",
|
|
||||||
"json.schemas.fileMatch.item.desc": "A file pattern that can contain '*' to match against when resolving JSON files to schemas.",
|
|
||||||
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
|
|
||||||
"json.format.enable.desc": "Enable/disable default JSON formatter (requires restart)",
|
|
||||||
"json.tracing.desc": "Traces the communication between VS Code and the JSON language server.",
|
|
||||||
"json.colorDecorators.enable.desc": "Enables or disables color decorators",
|
|
||||||
"json.colorDecorators.enable.deprecationMessage": "The setting `json.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
|
|
||||||
"json.experimental.syntaxFolding": "Enables/disables syntax aware folding markers."
|
|
||||||
}
|
}
|
||||||
9
extensions/json/server/.vscode/tasks.json
vendored
9
extensions/json/server/.vscode/tasks.json
vendored
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.1.0",
|
|
||||||
"command": "npm",
|
|
||||||
"isShellCommand": true,
|
|
||||||
"showOutput": "silent",
|
|
||||||
"args": ["run", "watch"],
|
|
||||||
"isWatching": true,
|
|
||||||
"problemMatcher": "$tsc-watch"
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "vscode-json-languageserver",
|
|
||||||
"description": "JSON language server",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"author": "Microsoft Corporation",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"jsonc-parser": "^1.0.1",
|
|
||||||
"request-light": "^0.2.2",
|
|
||||||
"vscode-json-languageservice": "^3.0.7",
|
|
||||||
"vscode-languageserver": "4.0.0-next.3",
|
|
||||||
"vscode-nls": "^3.2.1",
|
|
||||||
"vscode-uri": "^1.0.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "7.0.43"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"compile": "gulp compile-extension:json-server",
|
|
||||||
"watch": "gulp watch-extension:json-server",
|
|
||||||
"install-service-next": "yarn add vscode-json-languageservice@next",
|
|
||||||
"install-service-local": "yarn link vscode-json-languageservice",
|
|
||||||
"install-server-next": "yarn add vscode-languageserver@next",
|
|
||||||
"install-server-local": "yarn link vscode-languageserver-server"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import { TextDocumentIdentifier } from 'vscode-languageserver-types';
|
|
||||||
import { RequestType, TextDocumentRegistrationOptions, StaticRegistrationOptions } from 'vscode-languageserver-protocol';
|
|
||||||
|
|
||||||
// ---- capabilities
|
|
||||||
|
|
||||||
export interface FoldingProviderClientCapabilities {
|
|
||||||
/**
|
|
||||||
* The text document client capabilities
|
|
||||||
*/
|
|
||||||
textDocument?: {
|
|
||||||
/**
|
|
||||||
* Capabilities specific to the foldingProvider
|
|
||||||
*/
|
|
||||||
foldingProvider?: {
|
|
||||||
/**
|
|
||||||
* Whether implementation supports dynamic registration. If this is set to `true`
|
|
||||||
* the client supports the new `(FoldingProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
|
|
||||||
* return value for the corresponding server capability as well.
|
|
||||||
*/
|
|
||||||
dynamicRegistration?: boolean;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingProviderOptions {
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingProviderServerCapabilities {
|
|
||||||
/**
|
|
||||||
* The server provides folding provider support.
|
|
||||||
*/
|
|
||||||
foldingProvider?: FoldingProviderOptions | (FoldingProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingRangeList {
|
|
||||||
/**
|
|
||||||
* The folding ranges.
|
|
||||||
*/
|
|
||||||
ranges: FoldingRange[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum FoldingRangeType {
|
|
||||||
/**
|
|
||||||
* Folding range for a comment
|
|
||||||
*/
|
|
||||||
Comment = 'comment',
|
|
||||||
/**
|
|
||||||
* Folding range for a imports or includes
|
|
||||||
*/
|
|
||||||
Imports = 'imports',
|
|
||||||
/**
|
|
||||||
* Folding range for a region (e.g. `#region`)
|
|
||||||
*/
|
|
||||||
Region = 'region'
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingRange {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The start line number
|
|
||||||
*/
|
|
||||||
startLine: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The end line number
|
|
||||||
*/
|
|
||||||
endLine: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actual color value for this folding range.
|
|
||||||
*/
|
|
||||||
type?: FoldingRangeType | string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FoldingRangeRequestParam {
|
|
||||||
/**
|
|
||||||
* The text document.
|
|
||||||
*/
|
|
||||||
textDocument: TextDocumentIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace FoldingRangesRequest {
|
|
||||||
export const type: RequestType<FoldingRangeRequestParam, FoldingRangeList | null, any, any> = new RequestType('textDocument/foldingRanges');
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
export function formatError(message: string, err: any): string {
|
|
||||||
if (err instanceof Error) {
|
|
||||||
let error = <Error>err;
|
|
||||||
return `${message}: ${error.message}\n${error.stack}`;
|
|
||||||
} else if (typeof err === 'string') {
|
|
||||||
return `${message}: ${err}`;
|
|
||||||
} else if (err) {
|
|
||||||
return `${message}: ${err.toString()}`;
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function runSafeAsync<T>(func: () => Thenable<T>, errorVal: T, errorMessage: string): Thenable<T> {
|
|
||||||
let t = func();
|
|
||||||
return t.then(void 0, e => {
|
|
||||||
console.error(formatError(errorMessage, e));
|
|
||||||
return errorVal;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export function runSafe<T>(func: () => T, errorVal: T, errorMessage: string): T {
|
|
||||||
try {
|
|
||||||
return func();
|
|
||||||
} catch (e) {
|
|
||||||
console.error(formatError(errorMessage, e));
|
|
||||||
return errorVal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user