diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ba06aca4..610e76de6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,4 +39,4 @@ jobs: - run: yarn eslint - run: yarn build - uses: microsoft/playwright-github-action@v1 - - run: yarn test:ci + - run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} yarn test:ci diff --git a/.github/workflows/test-wtih-vscode-build.yml b/.github/workflows/test-wtih-vscode-build.yml index 8fa811d6b..2dc9acd3b 100644 --- a/.github/workflows/test-wtih-vscode-build.yml +++ b/.github/workflows/test-wtih-vscode-build.yml @@ -39,4 +39,4 @@ jobs: - run: yarn build:vscode - run: yarn yalc && yarn build - uses: microsoft/playwright-github-action@v1 - - run: yarn test:ci + - run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} yarn test:ci diff --git a/README.md b/README.md index 308dc7e05..3c2b905ab 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ The continued development and maintenance of GitHub1s is made possible by these - Github1s Extension ([Darkempire78/GitHub1s-Extension](https://github.com/Darkempire78/GitHub1s-Extension)) - [Github Web IDE](https://chrome.google.com/webstore/detail/adjiklnjodbiaioggfpbpkhbfcnhgkfe) ([zvizvi/Github-Web-IDE](https://github.com/zvizvi/Github-Web-IDE)) - [shortcut to github1s](https://chrome.google.com/webstore/detail/shortcut-to-github1s/gfcdbodapcbfckbfpmgeldfkkgjknceo) ([katsuhisa91/github1s-shortcut](https://github.com/katsuhisa91/github1s-shortcut)) +- [Github1s Shortut - Open source](https://github.com/Fauzdar1/Github1s) ### Firefox Extensions diff --git a/api/vscode-unpkg/index.js b/api/vscode-unpkg/index.js new file mode 100644 index 000000000..aea03720a --- /dev/null +++ b/api/vscode-unpkg/index.js @@ -0,0 +1,25 @@ +/** + * @file proxy vscode-unpkg.net + * @author netcon + */ + +const got = require('got'); +const url = require('url'); + +module.exports = async (req, res) => { + const pathname = new url.parse(req.url || '').pathname || ''; + const matches = pathname.match(/^\/api\/vscode-unpkg\/([^/]+)\/(.*)/); + + if (!matches) { + res.status(404); + return res.send('Not found'); + } + + const publisher = matches[1]; + const restPartsPath = matches[2]; + const requestUrl = `https://${publisher}.vscode-unpkg.net/${publisher}/${restPartsPath}`; + const response = await got.get(requestUrl); + + res.status(response.statusCode); + return res.send(response.body); +}; diff --git a/api/vscode-unpkg/package.json b/api/vscode-unpkg/package.json new file mode 100644 index 000000000..ca0c5a066 --- /dev/null +++ b/api/vscode-unpkg/package.json @@ -0,0 +1,10 @@ +{ + "name": "vscode-unpkg", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "dependencies": { + "got": "^11.8.2" + } +} diff --git a/api/vscode-unpkg/yarn.lock b/api/vscode-unpkg/yarn.lock new file mode 100644 index 000000000..6e947efe3 --- /dev/null +++ b/api/vscode-unpkg/yarn.lock @@ -0,0 +1,204 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@sindresorhus/is@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.1.tgz#d26729db850fa327b7cacc5522252194404226f5" + integrity sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g== + +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== + dependencies: + defer-to-connect "^2.0.0" + +"@types/cacheable-request@^6.0.1": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" + integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + +"@types/keyv@*": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.2.tgz#5d97bb65526c20b6e0845f6b0d2ade4f28604ee5" + integrity sha512-/FvAK2p4jQOaJ6CGDHJTqZcUtbZe820qIeTg7o0Shg7drB4JHeL+V/dhSaly7NXx6u8eSee+r7coT+yuJEvDLg== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "16.7.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.10.tgz#7aa732cc47341c12a16b7d562f519c2383b6d4fc" + integrity sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA== + +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + +cacheable-request@^7.0.1: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +defer-to-connect@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +got@^11.8.2: + version "11.8.2" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" + integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.1" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +keyv@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" + integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== + dependencies: + json-buffer "3.0.1" + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== + +once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + +resolve-alpn@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + +responselike@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" + integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== + dependencies: + lowercase-keys "^2.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/docs/guide.md b/docs/guide.md index 3c559620c..f88a867e5 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -1,6 +1,6 @@ # How it works -GitHub1s is based on [VS Code 1.55.0](https://github.com/microsoft/vscode/tree/1.52.1) now. VS Code can be built for a browser version officially. I also used the code and got inspired by [Code Server](https://github.com/cdr/code-server). +GitHub1s is based on [VS Code 1.60.0](https://github.com/microsoft/vscode/tree/1.60.0) now. VS Code can be built for a browser version officially. I also used the code and got inspired by [Code Server](https://github.com/cdr/code-server). Thanks to the very powerful and flexible extensibility of VS Code, we can easily implement a VS Code extension that provides the custom File IO ability using [FileSystemProvider API](https://code.visualstudio.com/api/references/vscode-api#FileSystemProvider). There is an official demo named [vscode-web-playground](https://github.com/microsoft/vscode-web-playground) which shows how it is used. diff --git a/extensions/dart-web/LICENSE b/extensions/dart-web/LICENSE deleted file mode 100644 index 1a4f6b68c..000000000 --- a/extensions/dart-web/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Danny Tuppeny - -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. \ No newline at end of file diff --git a/extensions/dart-web/README.md b/extensions/dart-web/README.md deleted file mode 100644 index ee961bf05..000000000 --- a/extensions/dart-web/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[![Discord Chat](https://img.shields.io/badge/chat-discord-blue.svg)](https://discord.gg/xSTPEqm) -[![Gitter Chat](https://img.shields.io/badge/chat-gitter-blue.svg)](https://gitter.im/dart-code/Dart-Code) -[![Follow on Twitter](https://img.shields.io/badge/twitter-dartcode-blue.svg)](https://twitter.com/DartCode) -[![Contribute to Dart Code](https://img.shields.io/badge/help-contribute-551A8B.svg)](https://github.com/Dart-Code/Dart-Code/blob/master/CONTRIBUTING.md) - -# This extension is a fork from [Dart-Code](https://github.com/Dart-Code/Dart-Code) for github1s. - -# At present only languages features is reserved - -# I have deleted some files and only reserved the necessary code - -## Introduction - -Dart Code extends [VS Code](https://code.visualstudio.com/) with support for the -[Dart](https://www.dartlang.org/) programming language and for [Flutter](https://flutter.dev/) -mobile apps, and [AngularDart](https://angulardart.org) web apps. - -## Installation - -Dart Code can be [installed from the Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) or by [searching within VS Code](https://code.visualstudio.com/docs/editor/extension-gallery#_search-for-an-extension). - -## Features - -- Syntax highlighting -- Workspace symbol search -- Document symbol search -- Snippets - -## Release Notes - -For full release notes, see [the changelog](https://dartcode.org/releases/). diff --git a/extensions/dart-web/media/dart.png b/extensions/dart-web/media/dart.png deleted file mode 100755 index d091c28f0..000000000 Binary files a/extensions/dart-web/media/dart.png and /dev/null differ diff --git a/extensions/dart-web/package.json b/extensions/dart-web/package.json deleted file mode 100644 index e0dc7cca3..000000000 --- a/extensions/dart-web/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "dart-code", - "displayName": "Dart", - "description": "Dart language support and debugger for Visual Studio Code.", - "version": "3.20.0-dev", - "publisher": "Dart-Code", - "engines": { - "vscode": "^1.52.0" - }, - "license": "SEE LICENSE IN LICENSE", - "bugs": { - "url": "https://github.com/Dart-Code/Dart-Code/issues" - }, - "homepage": "https://dartcode.org/", - "repository": { - "type": "git", - "url": "https://github.com/Dart-Code/Dart-Code.git" - }, - "categories": [ - "Programming Languages", - "Snippets", - "Linters", - "Formatters", - "Debuggers" - ], - "keywords": [ - "dart", - "flutter", - "fuchsia", - "multi-root ready" - ], - "icon": "media/dart.png", - "activationEvents": [ - "onLanguage:dart" - ], - "contributes": { - "languages": [ - { - "id": "dart", - "extensions": [ - ".dart" - ], - "aliases": [ - "Dart" - ], - "configuration": "./syntaxes/dart-language-configuration.json" - } - ], - "grammars": [ - { - "language": "dart", - "scopeName": "source.dart", - "path": "./syntaxes/dart.json" - } - ], - "colors": [ - { - "id": "dart.closingLabels", - "description": "The color of the 'closing label' annotations shown against constructor, method invocations and lists that span multiple lines. If not supplied, the color for 'tab.inactiveForeground' will be used.", - "defaults": { - "dark": "tab.inactiveForeground", - "light": "tab.inactiveForeground", - "highContrast": "tab.inactiveForeground" - } - } - ], - "semanticTokenScopes": [ - { - "language": "dart", - "scopes": { - "keyword": [ - "keyword" - ], - "keyword.control": [ - "keyword.control" - ], - "property.declaration": [ - "entity.name.function.member" - ] - } - } - ], - "configurationDefaults": { - "[dart]": { - "editor.tabSize": 2, - "editor.insertSpaces": true, - "editor.detectIndentation": false, - "editor.suggest.insertMode": "replace" - } - } - }, - "scripts": { - "compile": "echo done", - "watch": "echo done" - } -} diff --git a/extensions/dart-web/snippets/dart.json b/extensions/dart-web/snippets/dart.json deleted file mode 100644 index 7e2541e3c..000000000 --- a/extensions/dart-web/snippets/dart.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - ".source.dart": { - "main": { - "prefix": "main", - "description": "Insert a main function, used as an entry point.", - "body": ["main(List args) {", " $0", "}"] - }, - "try": { - "prefix": "try", - "description": "Insert a try/catch block.", - "body": ["try {", " $0", "} catch (${1:e}) {", "}"] - }, - "if": { - "prefix": "if", - "description": "Insert an if statement.", - "body": ["if ($1) {", " $0", "}"] - }, - "if else": { - "prefix": "ife", - "description": "Insert an if statement with an else block.", - "body": ["if ($1) {", " $0", "} else {", "}"] - }, - "switch case": { - "prefix": "switch", - "description": "Insert a switch statement.", - "body": [ - "switch ($1) {", - " case $2:", - " $0", - " break;", - " default:", - "}" - ] - }, - "for": { - "prefix": "for", - "description": "Insert a for loop.", - "body": ["for (var i = 0; i < ${1:count}; i++) {", " $0", "}"] - }, - "for in": { - "prefix": "fori", - "description": "Insert a for-in loop.", - "body": ["for (var ${1:item} in ${2:items}) {", " $0", "}"] - }, - "while": { - "prefix": "while", - "description": "Insert a while loop.", - "body": ["while ($1) {", " $0", "}"] - }, - "do while": { - "prefix": "do", - "description": "Insert a do-while loop.", - "body": ["do {", " $0", "} while ($1);"] - }, - "fun": { - "prefix": "fun", - "description": "Insert a function definition.", - "body": ["${3:void} ${1:name}(${2:args}) {", " $0", "}"] - }, - "class": { - "prefix": "class", - "description": "Insert a class definition.", - "body": ["class ${1:Name} {", " $0", "}"] - }, - "typedef": { - "prefix": "typedef", - "description": "Insert a typedef.", - "body": "typedef ${1:Type} ${2:Name}(${3:params});" - }, - "test": { - "prefix": "test", - "description": "Insert a test block.", - "body": ["test('$1', () {", " $0", "});"] - }, - "group": { - "prefix": "group", - "description": "Insert a test group block.", - "body": ["group('$1', () {", " $0", "});"] - } - } -} diff --git a/extensions/dart-web/snippets/flutter.json b/extensions/dart-web/snippets/flutter.json deleted file mode 100644 index 3c09049c3..000000000 --- a/extensions/dart-web/snippets/flutter.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - ".source.dart": { - "Flutter stateless widget": { - "prefix": "stless", - "description": "Insert a StatelessWidget", - "body": [ - "class $1 extends StatelessWidget {", - " @override", - " Widget build(BuildContext context) {", - " return Container(", - " $2", - " );", - " }", - "}" - ] - }, - "Flutter stateful widget": { - "prefix": "stful", - "description": "Insert a StatefulWidget", - "body": [ - "class $1 extends StatefulWidget {", - " @override", - " _$1State createState() => _$1State();", - "}", - "", - "class _$1State extends State<$1> {", - " @override", - " Widget build(BuildContext context) {", - " return Container(", - " $2", - " );", - " }", - "}" - ] - }, - "Flutter widget with AnimationController": { - "prefix": "stanim", - "description": "Insert a StatefulWidget with an AnimationController", - "body": [ - "class $1 extends StatefulWidget {", - " @override", - " _$1State createState() => _$1State();", - "}", - "", - "class _$1State extends State<$1>", - " with SingleTickerProviderStateMixin {", - " AnimationController _controller;", - "", - " @override", - " void initState() {", - " super.initState();", - " _controller = AnimationController(vsync: this);", - " }", - "", - " @override", - " void dispose() {", - " super.dispose();", - " _controller.dispose();", - " }", - "", - " @override", - " Widget build(BuildContext context) {", - " return Container(", - " $2", - " );", - " }", - "}" - ] - } - } -} diff --git a/extensions/dart-web/syntaxes/dart-language-configuration.json b/extensions/dart-web/syntaxes/dart-language-configuration.json deleted file mode 100644 index 171fa5beb..000000000 --- a/extensions/dart-web/syntaxes/dart-language-configuration.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": ["/*", "*/"] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [{ - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "'", - "close": "'", - "notIn": ["string", "comment"] - }, - { - "open": "\"", - "close": "\"", - "notIn": ["string"] - }, - { - "open": "`", - "close": "`", - "notIn": ["string", "comment"] - }, - { - "open": "/**", - "close": " */", - "notIn": ["string"] - } - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["<", ">"], - ["'", "'"], - ["\"", "\""], - ["`", "`"] - ] -} \ No newline at end of file diff --git a/extensions/dart-web/syntaxes/dart.json b/extensions/dart-web/syntaxes/dart.json deleted file mode 100644 index d8b255cd1..000000000 --- a/extensions/dart-web/syntaxes/dart.json +++ /dev/null @@ -1,436 +0,0 @@ -{ - "fileTypes": ["dart"], - "foldingStartMarker": "\\{\\s*$", - "foldingStopMarker": "^\\s*\\}", - "name": "Dart", - "patterns": [ - { - "match": "^(#!.*)$", - "name": "meta.preprocessor.script.dart" - }, - { - "begin": "^\\w*\\b(library|import|part of|part|export)\\b", - "beginCaptures": { - "0": { - "name": "keyword.other.import.dart" - } - }, - "end": ";", - "endCaptures": { - "0": { - "name": "punctuation.terminator.dart" - } - }, - "name": "meta.declaration.dart", - "patterns": [ - { - "include": "#strings" - }, - { - "include": "#comments" - }, - { - "match": "\\b(as|show|hide)\\b", - "name": "keyword.other.import.dart" - } - ] - }, - { - "include": "#comments" - }, - { - "include": "#punctuation" - }, - { - "include": "#annotations" - }, - { - "include": "#keywords" - }, - { - "include": "#constants-and-special-vars" - }, - { - "include": "#strings" - } - ], - "repository": { - "dartdoc": { - "patterns": [ - { - "match": "(\\[.*?\\])", - "captures": { - "0": { - "name": "variable.name.source.dart" - } - } - }, - { - "match": "^ {4,}(?![ \\*]).*", - "captures": { - "0": { - "name": "variable.name.source.dart" - } - } - }, - { - "begin": "```.*?$", - "end": "```", - "contentName": "variable.other.source.dart" - }, - { - "match": "(`.*?`)", - "captures": { - "0": { - "name": "variable.other.source.dart" - } - } - }, - { - "match": "(`.*?`)", - "captures": { - "0": { - "name": "variable.other.source.dart" - } - } - }, - { - "match": "(\\* (( ).*))$", - "captures": { - "2": { - "name": "variable.other.source.dart" - } - } - }, - { - "match": "(\\* .*)$" - } - ] - }, - "comments": { - "patterns": [ - { - "captures": { - "0": { - "name": "punctuation.definition.comment.dart" - } - }, - "match": "/\\*\\*/", - "name": "comment.block.empty.dart" - }, - { - "include": "#comments-doc-oldschool" - }, - { - "include": "#comments-doc" - }, - { - "include": "#comments-inline" - } - ] - }, - "comments-doc-oldschool": { - "patterns": [ - { - "begin": "/\\*\\*", - "end": "\\*/", - "name": "comment.block.documentation.dart", - "patterns": [ - { - "include": "#comments-doc-oldschool" - }, - { - "include": "#comments-block" - }, - { - "include": "#dartdoc" - } - ] - } - ] - }, - "comments-doc": { - "patterns": [ - { - "begin": "///", - "while": "^\\s*///", - "patterns": [ - { - "include": "#dartdoc" - } - ], - "name": "comment.block.documentation.dart" - } - ] - }, - "comments-inline": { - "patterns": [ - { - "include": "#comments-block" - }, - { - "captures": { - "1": { - "name": "comment.line.double-slash.dart" - } - }, - "match": "((//).*)$" - } - ] - }, - "comments-block": { - "patterns": [ - { - "begin": "/\\*", - "end": "\\*/", - "name": "comment.block.dart", - "patterns": [ - { - "include": "#comments-block" - } - ] - } - ] - }, - "annotations": { - "patterns": [ - { - "match": "@[a-zA-Z]+", - "name": "storage.type.annotation.dart" - } - ] - }, - "constants-and-special-vars": { - "patterns": [ - { - "match": "(?)", - "captures": { - "1": { - "name": "entity.name.function.dart" - } - } - } - ] - }, - "keywords": { - "patterns": [ - { - "match": "(?>>?|~|\\^|\\||&)", - "name": "keyword.operator.bitwise.dart" - }, - { - "match": "((&|\\^|\\||<<|>>>?)=)", - "name": "keyword.operator.assignment.bitwise.dart" - }, - { - "match": "(=>)", - "name": "keyword.operator.closure.dart" - }, - { - "match": "(==|!=|<=?|>=?)", - "name": "keyword.operator.comparison.dart" - }, - { - "match": "(([+*/%-]|\\~)=)", - "name": "keyword.operator.assignment.arithmetic.dart" - }, - { - "match": "(=)", - "name": "keyword.operator.assignment.dart" - }, - { - "match": "(\\-\\-|\\+\\+)", - "name": "keyword.operator.increment-decrement.dart" - }, - { - "match": "(\\-|\\+|\\*|\\/|\\~\\/|%)", - "name": "keyword.operator.arithmetic.dart" - }, - { - "match": "(!|&&|\\|\\|)", - "name": "keyword.operator.logical.dart" - }, - { - "match": "(? { alreadyShown = true; const url = getSourcegraphUrl(owner, repo, ref, path, line, character); vscode.window.showInformationMessage( - `The results is provided by [Sourcegraph](${url})` + `The results are provided by [Sourcegraph](${url})` ); }; })(); diff --git a/extensions/github1s/src/views/settings-view.ts b/extensions/github1s/src/views/settings-view.ts index c4a357201..9baf92370 100644 --- a/extensions/github1s/src/views/settings-view.ts +++ b/extensions/github1s/src/views/settings-view.ts @@ -58,7 +58,7 @@ export class SettingsView implements vscode.WebviewViewProvider { }); break; case 'welcome-page': - vscode.commands.executeCommand('workbench.action.showWelcomePage'); + vscode.commands.executeCommand('workbench.action.openWalkthrough'); break; case 'authorizing-github': this.handleAuthorizingGithub(); diff --git a/extensions/github1s/yarn.lock b/extensions/github1s/yarn.lock index 205353d9c..f34d01257 100644 --- a/extensions/github1s/yarn.lock +++ b/extensions/github1s/yarn.lock @@ -882,9 +882,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== picomatch@^2.0.5: version "2.2.2" diff --git a/extensions/jupyter-web/LICENSE b/extensions/jupyter-web/LICENSE deleted file mode 100644 index a7d89b609..000000000 --- a/extensions/jupyter-web/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Jithu R Jacob - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/extensions/jupyter-web/README.md b/extensions/jupyter-web/README.md deleted file mode 100644 index 895507f64..000000000 --- a/extensions/jupyter-web/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# This extension is a fork from [vscode-nbpreviewer](https://github.com/jithurjacob/vscode-nbpreviewer) for github1s - -# I have deleted some files and only reserved the necessary code - -# vscode-nbpreviewer - -An extension for supercharging your Data Science workflow by previewing Jupyter Notebook within VS Code. View graphs and interact with Plotly visualizations from within VS Code. - -

-

- logo -

- -## Preview - -> ![nbpreviewer demo](https://thumbs.gfycat.com/FarawayTerrificChameleon-max-14mb.gif) - -## Quick Start - -- Install the extension -- Open a Jupyter Notebook -- Click Show Preview menu button from Editor/Title Menu - -> ![nbpreviewer quick start](https://thumbs.gfycat.com/ImaginativeCooperativeDogwoodtwigborer-max-14mb.gif) diff --git a/extensions/jupyter-web/extension.webpack.config.js b/extensions/jupyter-web/extension.webpack.config.js deleted file mode 100644 index 6b024d809..000000000 --- a/extensions/jupyter-web/extension.webpack.config.js +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -//@ts-check -'use strict'; - -//@ts-check -/** @typedef {import('webpack').Configuration} WebpackConfig **/ - -const path = require('path'); - -module.exports = /** @type WebpackConfig */ { - context: __dirname, - mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') - target: 'webworker', // extensions run in a webworker context - entry: { - extension: './src/extension.js', - }, - resolve: { - mainFields: ['module', 'main'], - extensions: ['.ts', '.js'], // support ts-files and js-files - alias: { - https: 'https-browserify', - http: 'http-browserify', - }, - }, - externals: { - vscode: 'commonjs vscode', // ignored because it doesn't exist - }, - performance: { - hints: false, - }, - output: { - filename: 'extension.js', - path: path.join(__dirname, 'dist'), - libraryTarget: 'commonjs', - }, - devtool: 'source-map', -}; diff --git a/extensions/jupyter-web/images/jupyter.png b/extensions/jupyter-web/images/jupyter.png deleted file mode 100644 index 169a637b6..000000000 Binary files a/extensions/jupyter-web/images/jupyter.png and /dev/null differ diff --git a/extensions/jupyter-web/images/sample.PNG b/extensions/jupyter-web/images/sample.PNG deleted file mode 100644 index b6b9d8c0e..000000000 Binary files a/extensions/jupyter-web/images/sample.PNG and /dev/null differ diff --git a/extensions/jupyter-web/jsconfig.json b/extensions/jupyter-web/jsconfig.json deleted file mode 100644 index af85b6f70..000000000 --- a/extensions/jupyter-web/jsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6" - ] - }, - "exclude": [ - "node_modules" - ] -} \ No newline at end of file diff --git a/extensions/jupyter-web/language-configuration.json b/extensions/jupyter-web/language-configuration.json deleted file mode 100644 index 1a520dd3d..000000000 --- a/extensions/jupyter-web/language-configuration.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": ["/*", "*/"] - }, - "brackets": [ - ["{", "}"], - ["[", "]"] - ], - "autoClosingPairs": [{ - "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"] - } - ] -} \ No newline at end of file diff --git a/extensions/jupyter-web/package.json b/extensions/jupyter-web/package.json deleted file mode 100644 index de283a65a..000000000 --- a/extensions/jupyter-web/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "nbpreviewer", - "displayName": "VS Code Jupyter Notebook Previewer", - "description": "An easy to use extension for previewing Jupyter Notebooks within VS Code", - "version": "1.2.2", - "publisher": "jithurjacob", - "author": { - "name": "jithurjacob" - }, - "keywords": [ - "python", - "jupyter", - "ipython", - "data science", - "kaggle", - "notebook", - "markdown" - ], - "icon": "images/jupyter.png", - "recommendations": [ - "donjayamanne.python" - ], - "galleryBanner": { - "color": "#e46d2e", - "theme": "dark" - }, - "qna": false, - "license": "MIT", - "bugs": { - "url": "https://github.com/jithurjacob/vscode-nbpreviewer/issues", - "email": "jithurjacob@gmail.com" - }, - "repository": { - "type": "git", - "url": "https://github.com/jithurjacob/vscode-nbpreviewer.git" - }, - "homepage": "https://github.com/jithurjacob/vscode-nbpreviewer/blob/master/README.md", - "engines": { - "vscode": "^1.52.0" - }, - "browser": "./dist/extension", - "categories": [ - "Programming Languages", - "Other" - ], - "main": "./src/extension", - "contributes": { - "languages": [ - { - "id": "jupyter", - "aliases": [ - "Jupyter", - "jupyter" - ], - "extensions": [ - ".ipynb" - ], - "configuration": "./language-configuration.json" - } - ], - "commands": [ - { - "command": "jupyter.showPreview", - "title": "Show preview", - "category": "Jupyter" - } - ], - "menus": { - "editor/title": [ - { - "command": "jupyter.showPreview", - "when": "editorLangId == jupyter", - "group": "navigation" - } - ] - } - }, - "activationEvents": [ - "onLanguage:jupyter", - "onCommand:jupyter.showPreview" - ], - "languages": [ - { - "id": "jupyter", - "extensions": [ - ".ipynb" - ], - "aliases": [ - "ipynb", - "Ipynb" - ] - } - ], - "scripts": { - "clean": "rm -rf dist out", - "build": "webpack --config extension.webpack.config.js --mode production", - "compile": "webpack --config extension.webpack.config.js --mode production", - "watch": "echo done", - "dev": "webpack --config extension.webpack.config.js --watch" - }, - "devDependencies": { - "@types/vscode": "^1.52.0", - "eslint": "^4.6.1", - "webpack": "^5.21.2", - "webpack-cli": "^4.5.0" - } -} diff --git a/extensions/jupyter-web/src/extension.js b/extensions/jupyter-web/src/extension.js deleted file mode 100644 index 2f50d0d98..000000000 --- a/extensions/jupyter-web/src/extension.js +++ /dev/null @@ -1,55 +0,0 @@ -import vscode from 'vscode'; - -vscode.commands.registerCommand('jupyter.showPreview', async function (uri) { - try { - const authority = await vscode.commands.executeCommand( - 'github1s.get-current-authority' - ); - // TODO: It may not work fine when there are special characters in `ref` or `path` - const [owner, repo, ref] = (authority || '').split('+').filter(Boolean); - const path = uri.path; - - // const success = await vscode.commands.executeCommand('vscode.previewHtml', previewUri, vscode.ViewColumn.Two, 'IPython Notebook Preview'); - // Create and show panel - const panel = vscode.window.createWebviewPanel( - 'nbpreviewer', - 'Jupyter Notebook Previewer', - vscode.ViewColumn.Two, - { enableScripts: true, retainContextWhenHidden: true } - ); - panel.webview.html = ` - - - `; - console.log('successfully showed notebook'); - } catch (reason) { - console.error(reason); - vscode.window.showErrorMessage( - 'An error occured while rendering the Notebook' - ); - } -}); - -vscode.workspace.onDidOpenTextDocument((e) => { - const currnetFileExtension = e.fileName; - if (currnetFileExtension.substr(-6) === '.ipynb') { - vscode.commands.executeCommand('jupyter.showPreview', e.uri); - } -}); diff --git a/extensions/jupyter-web/yarn.lock b/extensions/jupyter-web/yarn.lock deleted file mode 100644 index 85554b040..000000000 --- a/extensions/jupyter-web/yarn.lock +++ /dev/null @@ -1,1661 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@discoveryjs/json-ext@^0.5.0": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" - integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== - -"@types/eslint-scope@^3.7.0": - version "3.7.0" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.0.tgz#4792816e31119ebd506902a482caec4951fabd86" - integrity sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "7.2.6" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.6.tgz#5e9aff555a975596c03a98b59ecd103decc70c3c" - integrity sha512-I+1sYH+NPQ3/tVqCeUSBwTE/0heyvtXqpIopUUArlBm0Kpocb8FbMa3AZ/ASKIFpN3rnEx932TTXDbt9OXsNDw== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - -"@types/estree@*", "@types/estree@^0.0.46": - version "0.0.46" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe" - integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== - -"@types/json-schema@*", "@types/json-schema@^7.0.6": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" - integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== - -"@types/node@*": - version "14.14.28" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.28.tgz#cade4b64f8438f588951a6b35843ce536853f25b" - integrity sha512-lg55ArB+ZiHHbBBttLpzD07akz0QPrZgUODNakeC09i62dnrywr9mFErHuaPlB6I7z+sEbK+IYmplahvplCj2g== - -"@types/vscode@^1.52.0": - version "1.53.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.53.0.tgz#47b53717af6562f2ad05171bc9c8500824a3905c" - integrity sha512-XjFWbSPOM0EKIT2XhhYm3D3cx3nn3lshMUcWNy1eqefk+oqRuBq8unVb6BYIZqXy9lQZyeUl7eaBCOZWv+LcXQ== - -"@webassemblyjs/ast@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.0.tgz#a5aa679efdc9e51707a4207139da57920555961f" - integrity sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg== - dependencies: - "@webassemblyjs/helper-numbers" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - -"@webassemblyjs/floating-point-hex-parser@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz#34d62052f453cd43101d72eab4966a022587947c" - integrity sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA== - -"@webassemblyjs/helper-api-error@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz#aaea8fb3b923f4aaa9b512ff541b013ffb68d2d4" - integrity sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w== - -"@webassemblyjs/helper-buffer@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz#d026c25d175e388a7dbda9694e91e743cbe9b642" - integrity sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA== - -"@webassemblyjs/helper-numbers@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz#7ab04172d54e312cc6ea4286d7d9fa27c88cd4f9" - integrity sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ== - dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.0" - "@webassemblyjs/helper-api-error" "1.11.0" - "@xtuc/long" "4.2.2" - -"@webassemblyjs/helper-wasm-bytecode@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz#85fdcda4129902fe86f81abf7e7236953ec5a4e1" - integrity sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA== - -"@webassemblyjs/helper-wasm-section@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz#9ce2cc89300262509c801b4af113d1ca25c1a75b" - integrity sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-buffer" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/wasm-gen" "1.11.0" - -"@webassemblyjs/ieee754@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz#46975d583f9828f5d094ac210e219441c4e6f5cf" - integrity sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA== - dependencies: - "@xtuc/ieee754" "^1.2.0" - -"@webassemblyjs/leb128@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.0.tgz#f7353de1df38aa201cba9fb88b43f41f75ff403b" - integrity sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g== - dependencies: - "@xtuc/long" "4.2.2" - -"@webassemblyjs/utf8@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.0.tgz#86e48f959cf49e0e5091f069a709b862f5a2cadf" - integrity sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw== - -"@webassemblyjs/wasm-edit@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz#ee4a5c9f677046a210542ae63897094c2027cb78" - integrity sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-buffer" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/helper-wasm-section" "1.11.0" - "@webassemblyjs/wasm-gen" "1.11.0" - "@webassemblyjs/wasm-opt" "1.11.0" - "@webassemblyjs/wasm-parser" "1.11.0" - "@webassemblyjs/wast-printer" "1.11.0" - -"@webassemblyjs/wasm-gen@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz#3cdb35e70082d42a35166988dda64f24ceb97abe" - integrity sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/ieee754" "1.11.0" - "@webassemblyjs/leb128" "1.11.0" - "@webassemblyjs/utf8" "1.11.0" - -"@webassemblyjs/wasm-opt@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz#1638ae188137f4bb031f568a413cd24d32f92978" - integrity sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-buffer" "1.11.0" - "@webassemblyjs/wasm-gen" "1.11.0" - "@webassemblyjs/wasm-parser" "1.11.0" - -"@webassemblyjs/wasm-parser@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz#3e680b8830d5b13d1ec86cc42f38f3d4a7700754" - integrity sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/helper-api-error" "1.11.0" - "@webassemblyjs/helper-wasm-bytecode" "1.11.0" - "@webassemblyjs/ieee754" "1.11.0" - "@webassemblyjs/leb128" "1.11.0" - "@webassemblyjs/utf8" "1.11.0" - -"@webassemblyjs/wast-printer@1.11.0": - version "1.11.0" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz#680d1f6a5365d6d401974a8e949e05474e1fab7e" - integrity sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ== - dependencies: - "@webassemblyjs/ast" "1.11.0" - "@xtuc/long" "4.2.2" - -"@webpack-cli/configtest@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.1.tgz#241aecfbdc715eee96bed447ed402e12ec171935" - integrity sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ== - -"@webpack-cli/info@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.2.tgz#ef3c0cd947a1fa083e174a59cb74e0b6195c236c" - integrity sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ== - dependencies: - envinfo "^7.7.3" - -"@webpack-cli/serve@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.0.tgz#2730c770f5f1f132767c63dcaaa4ec28f8c56a6c" - integrity sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw== - -"@xtuc/ieee754@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" - integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== - -"@xtuc/long@4.2.2": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" - integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= - dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= - -acorn@^5.5.0: - version "5.7.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" - integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== - -acorn@^8.0.4: - version "8.0.5" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.0.5.tgz#a3bfb872a74a6a7f661bc81b9849d9cac12601b7" - integrity sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== - -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= - -ajv-keywords@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" - integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== - -ajv@^5.2.3, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ajv@^6.12.5: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -babel-code-frame@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browserslist@^4.14.5: - version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== - dependencies: - caniuse-lite "^1.0.30001219" - colorette "^1.2.2" - electron-to-chromium "^1.3.723" - escalade "^3.1.1" - node-releases "^1.1.71" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - -caniuse-lite@^1.0.30001219: - version "1.0.30001230" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71" - integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ== - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.1.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chardet@^0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" - integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= - -chrome-trace-event@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" - integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== - dependencies: - tslib "^1.9.0" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== - -clone-deep@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" - integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== - dependencies: - is-plain-object "^2.0.4" - kind-of "^6.0.2" - shallow-clone "^3.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -colorette@^1.2.1, colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== - -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" - integrity sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cross-spawn@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@^3.1.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -electron-to-chromium@^1.3.723: - version "1.3.739" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz#f07756aa92cabd5a6eec6f491525a64fe62f98b9" - integrity sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A== - -enhanced-resolve@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz#525c5d856680fbd5052de453ac83e32049958b5c" - integrity sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - -enquirer@^2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -envinfo@^7.7.3: - version "7.7.4" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.7.4.tgz#c6311cdd38a0e86808c1c9343f667e4267c4a320" - integrity sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ== - -es-module-lexer@^0.3.26: - version "0.3.26" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.3.26.tgz#7b507044e97d5b03b01d4392c74ffeb9c177a83b" - integrity sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA== - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -eslint-scope@^3.7.1: - version "3.7.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" - integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-visitor-keys@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint@^4.6.1: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" - -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== - dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.1.0, esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -events@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" - integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== - -execa@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" - integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -external-editor@^2.0.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" - integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== - dependencies: - chardet "^0.4.0" - iconv-lite "^0.4.17" - tmp "^0.0.33" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -fastest-levenshtein@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" - integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -flat-cache@^1.2.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" - integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== - dependencies: - circular-json "^0.3.1" - graceful-fs "^4.1.2" - rimraf "~2.6.2" - write "^0.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -get-stream@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718" - integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== - -glob-to-regexp@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" - integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== - -glob@^7.1.2, glob@^7.1.3: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.0.1: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -graceful-fs@^4.1.2, graceful-fs@^4.2.4: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@^0.4.17: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^3.3.3: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== - -import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inquirer@^3.0.6: - version "3.3.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" - integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.0.4" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" - -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== - -is-core-module@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== - dependencies: - has "^1.0.3" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-resolvable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== - -is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jest-worker@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@^3.9.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -loader-runner@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" - integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash@^4.17.4, lodash@^4.3.0: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -mime-db@1.45.0: - version "1.45.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" - integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== - -mime-types@^2.1.27: - version "2.1.28" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" - integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== - dependencies: - mime-db "1.45.0" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -neo-async@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -node-releases@^1.1.71: - version "1.1.72" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" - integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -readable-stream@^2.2.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -rechoir@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" - integrity sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q== - dependencies: - resolve "^1.9.0" - -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== - -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve@^1.9.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -rimraf@~2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -run-async@^2.2.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74= - dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= - -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -schema-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.0.0.tgz#67502f6aa2b66a2d4032b4279a2944978a0913ef" - integrity sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA== - dependencies: - "@types/json-schema" "^7.0.6" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - -semver@^5.3.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -serialize-javascript@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" - integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== - dependencies: - randombytes "^2.1.0" - -shallow-clone@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" - integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== - dependencies: - kind-of "^6.0.2" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== - dependencies: - is-fullwidth-code-point "^2.0.0" - -source-list-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - -source-map-support@~0.5.19: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -table@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== - dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" - -tapable@^2.1.1, tapable@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" - integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw== - -terser-webpack-plugin@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz#7effadee06f7ecfa093dbbd3e9ab23f5f3ed8673" - integrity sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q== - dependencies: - jest-worker "^26.6.2" - p-limit "^3.1.0" - schema-utils "^3.0.0" - serialize-javascript "^5.0.1" - source-map "^0.6.1" - terser "^5.5.1" - -terser@^5.5.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.0.tgz#138cdf21c5e3100b1b3ddfddf720962f88badcd2" - integrity sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.19" - -text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -v8-compile-cache@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== - -watchpack@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.1.1.tgz#e99630550fca07df9f90a06056987baa40a689c7" - integrity sha512-Oo7LXCmc1eE1AjyuSBmtC3+Wy4HcV8PxWh2kP6fOl8yTlNS7r0K9l1ao2lrrUza7V39Y3D/BbJgY8VeSlc5JKw== - dependencies: - glob-to-regexp "^0.4.1" - graceful-fs "^4.1.2" - -webpack-cli@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.5.0.tgz#b5213b84adf6e1f5de6391334c9fa53a48850466" - integrity sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q== - dependencies: - "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.0.1" - "@webpack-cli/info" "^1.2.2" - "@webpack-cli/serve" "^1.3.0" - colorette "^1.2.1" - commander "^7.0.0" - enquirer "^2.3.6" - execa "^5.0.0" - fastest-levenshtein "^1.0.12" - import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" - v8-compile-cache "^2.2.0" - webpack-merge "^5.7.3" - -webpack-merge@^5.7.3: - version "5.7.3" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.7.3.tgz#2a0754e1877a25a8bbab3d2475ca70a052708213" - integrity sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA== - dependencies: - clone-deep "^4.0.1" - wildcard "^2.0.0" - -webpack-sources@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.2.0.tgz#058926f39e3d443193b6c31547229806ffd02bac" - integrity sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w== - dependencies: - source-list-map "^2.0.1" - source-map "^0.6.1" - -webpack@^5.21.2: - version "5.22.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.22.0.tgz#8505158bc52dcbbdb01ac94796a8aed61badf11a" - integrity sha512-xqlb6r9RUXda/d9iA6P7YRTP1ChWeP50TEESKMMNIg0u8/Rb66zN9YJJO7oYgJTRyFyYi43NVC5feG45FSO1vQ== - dependencies: - "@types/eslint-scope" "^3.7.0" - "@types/estree" "^0.0.46" - "@webassemblyjs/ast" "1.11.0" - "@webassemblyjs/wasm-edit" "1.11.0" - "@webassemblyjs/wasm-parser" "1.11.0" - acorn "^8.0.4" - browserslist "^4.14.5" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.7.0" - es-module-lexer "^0.3.26" - eslint-scope "^5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.4" - json-parse-better-errors "^1.0.2" - loader-runner "^4.2.0" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^3.0.0" - tapable "^2.1.1" - terser-webpack-plugin "^5.1.1" - watchpack "^2.0.0" - webpack-sources "^2.1.1" - -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wildcard@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" - integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== - -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= - dependencies: - mkdirp "^0.5.1" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/extensions/kotlin-web/LICENSE b/extensions/kotlin-web/LICENSE deleted file mode 100644 index 8dada3eda..000000000 --- a/extensions/kotlin-web/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/extensions/kotlin-web/README.md b/extensions/kotlin-web/README.md deleted file mode 100644 index 8f39b824a..000000000 --- a/extensions/kotlin-web/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# This extension is a fork from [vscode-kotlin](https://github.com/mathiasfrohlich/vscode-kotlin) for github1s - -# At present only languages features is reserved - -# I have deleted some files and only reserved the necessary code - -[![](https://vsmarketplacebadge.apphb.com/version-short/mathiasfrohlich.Kotlin.svg)](https://marketplace.visualstudio.com/items?itemName=mathiasfrohlich.Kotlin) -[![](https://vsmarketplacebadge.apphb.com/installs-short/mathiasfrohlich.Kotlin.svg)](https://marketplace.visualstudio.com/items?itemName=mathiasfrohlich.Kotlin) -[![](https://vsmarketplacebadge.apphb.com/rating-short/mathiasfrohlich.Kotlin.svg)](https://marketplace.visualstudio.com/items?itemName=mathiasfrohlich.Kotlin) - -# Kotlin Language - -Syntax support for the Kotlin programming language. -This extension adds basic features to help make reading Kotlin much more pleasant in VSCode - -## Features - -- Syntax highlighting -- Code snippets - -## Contributing - -We welcome any contributions to help make the extension better. There are several ways you can contribute. - -1. By reporting [issues](https://github.com/mathiasfrohlich/vscode-kotlin/issues) -2. Making feature [requests](https://github.com/mathiasfrohlich/vscode-kotlin/issues) -3. Or by contributing code - -> Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. - -## Credits - -- [Visual Studio Code](https://code.visualstudio.com/) -- [vscode-docs on GitHub](https://github.com/Microsoft/vscode-docs) -- [Kotlin.org](https://kotlinlang.org/) -- [Sublime Text - Kotlin Package](https://github.com/vkostyukov/kotlin-sublime-package) diff --git a/extensions/kotlin-web/artwork/icon.png b/extensions/kotlin-web/artwork/icon.png deleted file mode 100644 index 9698eb4f3..000000000 Binary files a/extensions/kotlin-web/artwork/icon.png and /dev/null differ diff --git a/extensions/kotlin-web/kotlin.configuration.json b/extensions/kotlin-web/kotlin.configuration.json deleted file mode 100644 index 7ca2cfc02..000000000 --- a/extensions/kotlin-web/kotlin.configuration.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": ["/*", "*/"] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["<", ">"] - ], - "autoClosingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "'", "close": "'", "notIn": ["string", "comment"] }, - { "open": "\"", "close": "\"", "notIn": ["string"] }, - { "open": "/*", "close": " */", "notIn": ["string"] } - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["<", ">"], - ["'", "'"], - ["\"", "\""] - ], - "folding": { - "offSide": true, - "markers": { - "start": "^\\s*//\\s*#region", - "end": "^\\s*//\\s*#endregion" - } - } -} diff --git a/extensions/kotlin-web/package.json b/extensions/kotlin-web/package.json deleted file mode 100644 index 78bf6c067..000000000 --- a/extensions/kotlin-web/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "Kotlin", - "displayName": "Kotlin Language", - "description": "Kotlin language support for VS Code, this file is modified by github1s", - "version": "1.7.1", - "publisher": "mathiasfrohlich", - "license": "Apache-2.0", - "scripts": { - "compile": "echo done", - "watch": "echo done" - }, - "engines": { - "vscode": "^1.8.0" - }, - "icon": "artwork/icon.png", - "categories": [ - "Programming Languages" - ], - "bugs": { - "url": "https://github.com/mathiasfrohlich/vscode-kotlin/issues" - }, - "homepage": "https://github.com/mathiasfrohlich/vscode-kotlin", - "repository": { - "type": "git", - "url": "https://github.com/mathiasfrohlich/vscode-kotlin.git" - }, - "keywords": [ - "Kotlin", - "kotlin", - "kt", - "kts" - ], - "contributes": { - "languages": [ - { - "id": "kotlin", - "aliases": [ - "Kotlin", - "kotlin" - ], - "extensions": [ - ".kt" - ], - "configuration": "./kotlin.configuration.json" - }, - { - "id": "kotlinscript", - "aliases": [ - "Kotlinscript", - "kotlinscript" - ], - "extensions": [ - ".kts" - ], - "configuration": "./kotlin.configuration.json" - } - ], - "grammars": [ - { - "language": "kotlin", - "scopeName": "source.kotlin", - "path": "./syntaxes/Kotlin.tmLanguage" - }, - { - "language": "kotlinscript", - "scopeName": "source.kotlin", - "path": "./syntaxes/Kotlin.tmLanguage" - }, - { - "scopeName": "markdown.kotlin.codeblock", - "path": "./syntaxes/codeblock.json", - "injectTo": [ - "text.html.markdown" - ], - "embeddedLanguages": { - "meta.embedded.block.kotlin": "kotlin" - } - } - ], - "snippets": [ - { - "language": "kotlin", - "path": "./snippets/kotlin.json" - }, - { - "language": "kotlinscript", - "path": "./snippets/kotlin.json" - } - ] - } -} diff --git a/extensions/kotlin-web/snippets/kotlin.json b/extensions/kotlin-web/snippets/kotlin.json deleted file mode 100644 index 5418bf129..000000000 --- a/extensions/kotlin-web/snippets/kotlin.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "fun": { - "prefix": "fun", - "body": ["fun ${1:foo}() = ${0}"], - "description": "One line fucntion" - }, - "fun2": { - "prefix": "fun", - "body": [ - "fun ${1:foo}(${2:bar}: ${3:Any}, ${4:baz}: ${5:Any}): ${6:Unit} {", - "\t${0}", - "}" - ], - "description": "Function with 2 parameters" - }, - "fun1": { - "prefix": "fun", - "body": ["fun ${1:foo}(${2:bar}: ${3:Any}): ${4:Unit} {", "\t${0}", "}"], - "description": "Function with 1 parameter" - }, - "fun0": { - "prefix": "fun", - "body": ["fun ${1:foo}(): Unit {", "\t${0}", "}"], - "description": "Function with 0 parameters" - }, - "void": { - "prefix": "void", - "body": ["fun ${1:foo}() {", "\t${0}", "}"], - "description": "Function that returns nothing" - }, - "main": { - "prefix": "main", - "body": ["fun main(args: Array) {", "\t${0}", "}"], - "description": "main() function" - }, - "for": { - "prefix": "for", - "body": ["for (${1:i} in ${2:iterable}) {", "\t${0}", "}"] - }, - "try": { - "prefix": "try", - "body": ["try {", "\t${0}", "}", "catch(Exception e) {", "\t${0}", "}"] - }, - "class": { - "prefix": "class", - "body": ["class ${1:foo} {", "\t${0}", "}"], - "description": "Class without contructor" - }, - "class1": { - "prefix": "class", - "body": ["class ${1:foo}(${2:bar}) {", "\t${0}", "}"], - "description": "Class with constructor" - }, - "data": { - "prefix": "class", - "body": ["data class ${1:foo}(${0})"], - "description": "Empty data class" - }, - "singleton": { - "prefix": "singleton", - "body": ["object ${1:foo} {", "\t${0}", "}"], - "description": "Empty singleton" - } -} diff --git a/extensions/kotlin-web/syntaxes/Kotlin.tmLanguage b/extensions/kotlin-web/syntaxes/Kotlin.tmLanguage deleted file mode 100644 index 32959825b..000000000 --- a/extensions/kotlin-web/syntaxes/Kotlin.tmLanguage +++ /dev/null @@ -1,1067 +0,0 @@ - - - - - fileTypes - - kt - kts - - foldingStartMarker - (\{\s*(//.*)?$|^\s*// \{\{\{) - foldingStopMarker - ^\s*(\}|// \}\}\}$) - name - Kotlin - patterns - - - include - #comments - - - captures - - 1 - - name - keyword.other.kotlin - - 2 - - name - entity.name.package.kotlin - - - match - ^\s*(package)\b(?:\s*([^ ;$]+)\s*)? - - - captures - - 1 - - name - keyword.other.import.kotlin - - 2 - - name - storage.modifier.import.java - - 3 - - name - keyword.other.kotlin - - 4 - - name - entity.name.type - - - match - ^\s*(import)\s+([^ $.]+(?:\.(?:[`][^$`]+[`]|[^` $.]+))+)(?:\s+(as)\s+([`][^$`]+[`]|[^` $.]+))? - name - meta.import.kotlin - - - include - #code - - - repository - - annotations - - patterns - - - begin - (@[^ (]+)(\()? - beginCaptures - - 1 - - name - storage.type.annotation.kotlin - - 2 - - name - punctuation.definition.annotation-arguments.begin.kotlin - - - end - (\)|\s|$) - endCaptures - - 1 - - name - punctuation.definition.annotation-arguments.end.kotlin - - - name - meta.declaration.annotation.kotlin - patterns - - - captures - - 1 - - name - constant.other.key.kotlin - - 2 - - name - keyword.operator.assignment.kotlin - - - match - (\w*)\s*(=) - - - include - #code - - - match - , - name - punctuation.seperator.property.kotlin - - - - - match - @\w* - name - storage.type.annotation.kotlin - - - - builtin-functions - - patterns - - - match - \b(apply|also|let|takeIf|run|takeUnless|with|print|println)\b\s*(?={|\() - captures - - 1 - - name - support.function.kotlin - - - - - match - \b(mutableListOf|listOf|mutableMapOf|mapOf|mutableSetOf|setOf)\b\s*(?={|\() - captures - - 1 - - name - support.function.kotlin - - - - - - comments - - patterns - - - captures - - 0 - - name - punctuation.definition.comment.kotlin - - - match - /\*\*/ - name - comment.block.empty.kotlin - - - include - #comments-inline - - - - comments-inline - - patterns - - - begin - /\* - captures - - 0 - - name - punctuation.definition.comment.kotlin - - - end - \*/ - name - comment.block.kotlin - - - captures - - 1 - - name - comment.line.double-slash.kotlin - - 2 - - name - punctuation.definition.comment.kotlin - - - match - \s*((//).*$\n?) - - - - class-literal - - begin - (?=\b(?:class|interface|object)\s+\w+)\b - end - (?=\}|$) - name - meta.class.kotlin - patterns - - - include - #keyword-literal - - - begin - \b(class|object|interface)\b\s+(\w+) - beginCaptures - - 1 - - name - storage.modifier.kotlin - - 2 - - name - entity.name.class.kotlin - - - end - (?=\{|\(|:|$) - patterns - - - include - #keyword-literal - - - include - #annotations - - - include - #types - - - - - begin - (:)\s*(\w+) - beginCaptures - - 1 - - name - keyword.operator.declaration.kotlin - - 2 - - name - entity.other.inherited-class.kotlin - - - end - (?={|=|$) - patterns - - - include - #types - - - - - include - #braces - - - include - #parens - - - - literal-functions - - begin - (?=\b(?:fun)\b) - end - (?=$|=|\}) - patterns - - - begin - \b(fun)\b - beginCaptures - - 1 - - name - keyword.other.kotlin - - - end - (?=\() - patterns - - - captures - - 2 - - name - entity.name.function.kotlin - - - match - ([\.<\?>\w]+\.)?(\w+|(`[^`]*`)) - - - include - #types - - - - - begin - (:) - beginCaptures - - 1 - - name - keyword.operator.declaration.kotlin - - - end - (?={|=|$) - patterns - - - include - #types - - - - - include - #parens - - - include - #braces - - - - parameters - - patterns - - - begin - (:) - beginCaptures - - 1 - - name - keyword.operator.declaration.kotlin - - - end - (?=,|=|\)) - patterns - - - include - #types - - - - - match - \w+(?=:) - name - variable.parameter.function.kotlin - - - include - #keyword-literal - - - - keyword-literal - - patterns - - - match - (\!in|\!is|as\?) - name - keyword.operator.kotlin - - - match - \b(in|is|as|assert)\b - name - keyword.operator.kotlin - - - match - \b(const)\b - name - storage.modifier.kotlin - - - match - \b(val|var)\b - name - storage.type.kotlin - - - match - \b(\_)\b - name - punctuation.definition.variable.kotlin - - - match - \b(data|inline|tailrec|operator|infix|typealias|reified)\b - name - storage.type.kotlin - - - match - \b(external|public|private|protected|internal|abstract|final|sealed|enum|open|annotation|override|vararg|typealias|expect|actual|suspend|yield|out|in)\b - name - storage.modifier.kotlin - - - match - \b(try|catch|finally|throw)\b - name - keyword.control.catch-exception.kotlin - - - match - \b(if|else|when)\b - name - keyword.control.conditional.kotlin - - - match - \b(while|for|do|return|break|continue)\b - name - keyword.control.kotlin - - - match - \b(constructor|init)\b - name - entity.name.function.constructor - - - match - \b(companion|object)\b - name - storage.type.kotlin - - - - keyword-operator - - patterns - - - match - \b(and|or|not|inv)\b - name - keyword.operator.bitwise.kotlin - - - match - (==|!=|===|!==|<=|>=|<|>) - name - keyword.operator.comparison.kotlin - - - match - (=) - name - keyword.operator.assignment.kotlin - - - match - (:(?!:)) - name - keyword.operator.declaration.kotlin - - - match - (\?:) - name - keyword.operator.elvis.kotlin - - - match - (\-\-|\+\+) - name - keyword.operator.increment-decrement.kotlin - - - match - (\-|\+|\*|\/|%) - name - keyword.operator.arithmetic.kotlin - - - match - (\+\=|\-\=|\*\=|\/\=) - name - keyword.operator.arithmetic.assign.kotlin - - - match - (\!|\&\&|\|\|) - name - keyword.operator.logical.kotlin - - - match - (\.\.) - name - keyword.operator.range.kotlin - - - - keyword-punctuation - - patterns - - - match - (::) - name - punctuation.accessor.reference.kotlin - - - match - (\?\.) - name - punctuation.accessor.dot.safe.kotlin - - - match - (\.) - name - punctuation.accessor.dot.kotlin - - - match - (\,) - name - punctuation.seperator.kotlin - - - match - (\;) - name - punctuation.terminator.kotlin - - - - keyword-constant - - patterns - - - match - \b(true|false|null|class)\b - name - constant.language.kotlin - - - match - \b(this|super)\b - name - variable.language.kotlin - - - match - \b(0(x|X)[0-9A-Fa-f_]*)[L]?\b - name - constant.numeric.hex.kotlin - - - match - \b(0(b|B)[0-1_]*)[L]?\b - name - constant.numeric.binary.kotlin - - - match - \b([0-9][0-9_]*\.[0-9][0-9_]*[fFL]?)\b - name - constant.numeric.float.kotlin - - - match - \b([0-9][0-9_]*[fFL]?)\b - name - constant.numeric.integer.kotlin - - - - literal-string - - patterns - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.kotlin - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.kotlin - - - name - string.quoted.double.kotlin - patterns - - - include - #string-content - - - - - - literal-raw-string - - patterns - - - begin - """ - beginCaptures - - 0 - - name - punctuation.definition.string.begin.kotlin - - - end - """ - endCaptures - - 0 - - name - punctuation.definition.string.end.kotlin - - - name - string.quoted.triple.kotlin - patterns - - - include - #string-content - - - - - - string-content - - patterns - - - name - constant.character.escape.newline.kotlin - match - \\\s*\n - - - name - constant.character.escape.kotlin - match - \\(x[\da-fA-F]{2}|u[\da-fA-F]{4}|.) - - - begin - (\$)(\{) - beginCaptures - - 1 - - name - punctuation.definition.keyword.kotlin - - 2 - - name - punctuation.section.block.begin.kotlin - - - end - \} - endCaptures - - 0 - - name - punctuation.section.block.end.kotlin - - - name - entity.string.template.element.kotlin - patterns - - - include - #code - - - - - - types - - patterns - - - match - \b(Nothing|Any|Unit|String|CharSequence|Int|Boolean|Char|Long|Double|Float|Short|Byte|Array|List|Map|Set|dynamic)\b(\?)? - name - support.class.kotlin - - - match - \b(IntArray|BooleanArray|CharArray|LongArray|DoubleArray|FloatArray|ShortArray|ByteArray)\b(\?)? - name - support.class.kotlin - - - match - ((?:[a-zA-Z]\w*\.)*[A-Z]+\w*[a-z]+\w*)(\?) - name - entity.name.type.class.kotlin - patterns - - - include - #keyword-punctuation - - - include - #types - - - - - match - \b(?:[a-z]\w*(\.))*[A-Z]+\w*\b - captures - - 1 - - name - keyword.operator.dereference.kotlin - - - name - entity.name.type.class.kotlin - - - begin - \( - beginCaptures - - 0 - - name - punctuation.section.group.begin.kotlin - - - end - \) - endCaptures - - 0 - - name - punctuation.section.group.end.kotlin - - - patterns - - - include - #types - - - - - include - #keyword-punctuation - - - include - #keyword-operator - - - - parens - - patterns - - - begin - \( - beginCaptures - - 0 - - name - punctuation.section.group.begin.kotlin - - - end - \) - endCaptures - - 0 - - name - punctuation.section.group.end.kotlin - - - name - meta.group.kotlin - patterns - - - include - #keyword-punctuation - - - include - #parameters - - - include - #code - - - - - - braces - - patterns - - - begin - \{ - beginCaptures - - 0 - - name - punctuation.section.group.begin.kotlin - - - end - \} - endCaptures - - 0 - - name - punctuation.section.group.end.kotlin - - - name - meta.block.kotlin - patterns - - - include - #code - - - - - - brackets - - patterns - - - begin - \[ - beginCaptures - - 0 - - name - punctuation.section.brackets.begin.kotlin - - - end - \] - endCaptures - - 0 - - name - punctuation.section.brackets.end.kotlin - - - name - meta.brackets.kotlin - patterns - - - include - #code - - - - - - code - - patterns - - - include - #comments - - - include - #comments-inline - - - include - #annotations - - - include - #class-literal - - - include - #parens - - - include - #braces - - - include - #brackets - - - include - #keyword-literal - - - include - #types - - - include - #keyword-operator - - - include - #keyword-constant - - - include - #keyword-punctuation - - - include - #builtin-functions - - - include - #literal-functions - - - include - #builtin-classes - - - include - #literal-raw-string - - - include - #literal-string - - - - - scopeName - source.kotlin - uuid - d9380650-5edc-447d-8dbd-98838c7d0adf - - \ No newline at end of file diff --git a/extensions/kotlin-web/syntaxes/LICENSE b/extensions/kotlin-web/syntaxes/LICENSE deleted file mode 100644 index 7ef4d6bd2..000000000 --- a/extensions/kotlin-web/syntaxes/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2012-2014 Vladimir Kostyukov - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/extensions/kotlin-web/syntaxes/codeblock.json b/extensions/kotlin-web/syntaxes/codeblock.json deleted file mode 100644 index bc04d9291..000000000 --- a/extensions/kotlin-web/syntaxes/codeblock.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "fileTypes": [], - "injectionSelector": "L:markup.fenced_code.block.markdown", - "patterns": [ - { - "include": "#kotlin-code-block" - } - ], - "repository": { - "kotlin-code-block": { - "begin": "kotlin", - "end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)", - "contentName": "meta.embedded.block.kotlin", - "patterns": [ - { - "include": "source.kotlin" - } - ] - } - }, - "scopeName": "markdown.kotlin.codeblock" -} diff --git a/extensions/scala-web/LICENSE b/extensions/scala-web/LICENSE deleted file mode 100644 index bca190ec0..000000000 --- a/extensions/scala-web/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) 2018 Nicolas Stucki - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/extensions/scala-web/README.md b/extensions/scala-web/README.md deleted file mode 100644 index 7011c8689..000000000 --- a/extensions/scala-web/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# This extension is a fork from [vscode-scala-syntax](https://github.com/scala/vscode-scala-syntax) for github1s - -# At present only languages features is reserved - -# I have deleted some files and only reserved the necessary code - -# Scala Syntax (official) - -[![Install extension](https://img.shields.io/badge/scala-vscode-blue.png)](vscode:extension/scala-lang.scala) -[![Version](https://img.shields.io/github/package-json/v/scala/vscode-scala-syntax.svg)](https://marketplace.visualstudio.com/items?itemName=scala-lang.scala) -![GitHub Actions Build Status](https://github.com/scala/vscode-scala-syntax/workflows/continuous-integration/badge.svg) - -Visual Studio Code extension providing syntax highlighting for Scala 2 and Scala 3 source files. - -![Syntax Highlighting Demo](https://i.imgur.com/TDx0mC3.png) - -This repo also powers the Scala syntax highlighting on GitHub. (It is vendored in [github/linguist](https://github.com/github/linguist).) - -### Team - -The current maintainers (people who can merge pull requests) are: - -- Nicolas Stucki- [`@nicolasstucki`](https://github.com/nicolasstucki) -- Maxime Kjaer - [`@MaximeKjaer`](https://github.com/MaximeKjaer) -- Olafur Pall Geirsson - [`@olafurpg`](https://github.com/olafurpg) -- Vitalii Voloshyn - [`@PanAeon`](https://github.com/PanAeon) -- all other members of the Scala organization on GitHub - -## Based on - -- Plugin: https://github.com/daltonjorge/vscode-scala -- Template: https://github.com/sellmerfud/scala.tmbundle - (https://github.com/mads-hartmann/scala.tmbundle) -- Textmate JSON schema: - https://github.com/Septh/tmlanguage/blob/master/tmLanguage.schema.json - -## License - -[MIT](LICENSE.md) diff --git a/extensions/scala-web/images/smooth-spiral.png b/extensions/scala-web/images/smooth-spiral.png deleted file mode 100644 index 39f5c606f..000000000 Binary files a/extensions/scala-web/images/smooth-spiral.png and /dev/null differ diff --git a/extensions/scala-web/language-configuration.json b/extensions/scala-web/language-configuration.json deleted file mode 100644 index 8e03ede0c..000000000 --- a/extensions/scala-web/language-configuration.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "comments": { - // symbol used for single line comment. Remove this entry if your language does not support line comments - "lineComment": "//", - // symbols used for start and end a block comment. Remove this entry if your language does not support block comments - "blockComment": ["/*", "*/"] - }, - // symbols used as brackets - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - // symbols that are auto closed when typing - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["s\"", "\""], - ["f\"", "\""], - ["raw\"", "\""], - ["'", "'"] - ], - // symbols that that can be used to surround a selection - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ] -} \ No newline at end of file diff --git a/extensions/scala-web/package.json b/extensions/scala-web/package.json deleted file mode 100644 index c9d911d03..000000000 --- a/extensions/scala-web/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "scala", - "displayName": "Scala Syntax (official)", - "description": "Official Scala Syntax", - "version": "0.5.0", - "publisher": "scala-lang", - "license": "SEE LICENSE IN LICENSE.md", - "engines": { - "vscode": "^1.5.0" - }, - "homepage": "https://github.com/scala/vscode-scala-syntax/blob/master/README.md", - "repository": { - "type": "git", - "url": "https://github.com/scala/vscode-scala-syntax.git" - }, - "icon": "images/smooth-spiral.png", - "categories": [ - "Programming Languages" - ], - "contributes": { - "languages": [ - { - "id": "scala", - "aliases": [ - "Scala", - "scala" - ], - "extensions": [ - ".scala", - ".sbt", - ".sc" - ], - "configuration": "./language-configuration.json" - } - ], - "grammars": [ - { - "language": "scala", - "scopeName": "source.scala", - "path": "./syntaxes/Scala.tmLanguage.json" - } - ] - }, - "devDependencies": { - "@types/node": "^14.6.4", - "ajv": "^6.12.4", - "github-changes": "^1.1.1", - "npm-run-all": "^4.1.5", - "rimraf": "^3.0.2", - "ts-node": "^9.0.0", - "typescript": "^4.0.2", - "vsce": "^1.79.5", - "vscode-tmgrammar-test": "0.0.10" - }, - "scripts": { - "clean": "rimraf scala-*.vsix", - "vscode:prepublish": "test -f ./syntaxes/Scala.tmLanguage.json", - "vscode:publish": "vsce publish --yarn", - "build": "npm-run-all build:syntax build:extension", - "build:syntax": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json", - "build:extension": "vsce package --yarn", - "compile": "echo done", - "watch": "echo done" - } -} diff --git a/extensions/scala-web/syntaxes/Scala.tmLanguage.json b/extensions/scala-web/syntaxes/Scala.tmLanguage.json deleted file mode 100644 index f56692344..000000000 --- a/extensions/scala-web/syntaxes/Scala.tmLanguage.json +++ /dev/null @@ -1,756 +0,0 @@ -{ - "fileTypes": ["scala"], - "firstLineMatch": "^#!/.*\\b\\w*scala\\b", - "foldingStartMarker": "/\\*\\*|\\{\\s*$", - "foldingStopMarker": "\\*\\*/|^\\s*\\}", - "keyEquivalent": "^~S", - "repository": { - "empty-parentheses": { - "match": "(\\(\\))", - "captures": { "1": { "name": "meta.bracket.scala" } }, - "name": "meta.parentheses.scala" - }, - "imports": { - "end": "(?<=[\\n;])", - "begin": "\\b(import)\\s+", - "beginCaptures": { "1": { "name": "keyword.other.import.scala" } }, - "patterns": [ - { "include": "#comments" }, - { "match": "given", "name": "keyword.other.import.given.scala" }, - { - "match": "[A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?", - "name": "entity.name.class.import.scala" - }, - { - "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", - "name": "entity.name.import.scala" - }, - { "match": "\\.", "name": "punctuation.definition.import" }, - { - "end": "}", - "begin": "{", - "beginCaptures": { "0": { "name": "meta.bracket.scala" } }, - "patterns": [ - { - "match": "(?x)(given\\s)?\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*(=>)\\s*(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))\\s*", - "captures": { - "1": { "name": "keyword.other.import.given.scala" }, - "2": { "name": "entity.name.class.import.renamed-from.scala" }, - "3": { "name": "entity.name.import.renamed-from.scala" }, - "4": { "name": "keyword.other.arrow.scala" }, - "5": { "name": "entity.name.class.import.renamed-to.scala" }, - "6": { "name": "entity.name.import.renamed-to.scala" } - } - }, - { "match": "given", "name": "keyword.other.import.given.scala" }, - { - "match": "(given\\s+)?(?:([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)|(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)))", - "captures": { - "1": { "name": "keyword.other.import.given.scala" }, - "2": { "name": "entity.name.class.import.scala" }, - "3": { "name": "entity.name.import.scala" } - } - } - ], - "endCaptures": { "0": { "name": "meta.bracket.scala" } }, - "name": "meta.import.selector.scala" - } - ], - "name": "meta.import.scala" - }, - "exports": { - "end": "(?<=[\\n;])", - "begin": "\\b(export)\\s+(given\\s+)?", - "beginCaptures": { - "1": { "name": "keyword.other.export.scala" }, - "2": { "name": "keyword.other.export.given.scala" } - }, - "patterns": [ - { "include": "#comments" }, - { - "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", - "name": "entity.name.export.scala" - }, - { "match": "\\.", "name": "punctuation.definition.export" }, - { - "end": "}", - "begin": "{", - "beginCaptures": { "0": { "name": "meta.bracket.scala" } }, - "patterns": [ - { - "match": "(?x)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*(=>)\\s*(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))\\s*", - "captures": { - "1": { "name": "entity.name.export.renamed-from.scala" }, - "2": { "name": "keyword.other.arrow.scala" }, - "3": { "name": "entity.name.export.renamed-to.scala" } - } - }, - { "match": "([^\\s.,}]+)", "name": "entity.name.export.scala" } - ], - "endCaptures": { "0": { "name": "meta.bracket.scala" } }, - "name": "meta.export.selector.scala" - } - ], - "name": "meta.export.scala" - }, - "constants": { - "patterns": [ - { - "match": "\\b(false|null|true)\\b", - "name": "constant.language.scala" - }, - { - "match": "\\b(0[xX][0-9a-fA-F_]*)\\b", - "name": "constant.numeric.scala" - }, - { - "match": "\\b(([0-9][0-9_]*(\\.[0-9][0-9_]*)?)([eE](\\+|-)?[0-9][0-9_]*)?|[0-9][0-9_]*)[LlFfDd]?\\b", - "name": "constant.numeric.scala" - }, - { - "match": "(\\.[0-9][0-9_]*)([eE](\\+|-)?[0-9][0-9_]*)?[LlFfDd]?\\b", - "name": "constant.numeric.scala" - }, - { "match": "\\b(this|super)\\b", "name": "variable.language.scala" } - ] - }, - "script-header": { - "match": "^#!(.*)$", - "captures": { "1": { "name": "string.unquoted.shebang.scala" } }, - "name": "comment.block.shebang.scala" - }, - "code": { - "patterns": [ - { "include": "#script-header" }, - { "include": "#storage-modifiers" }, - { "include": "#declarations" }, - { "include": "#inheritance" }, - { "include": "#extension" }, - { "include": "#imports" }, - { "include": "#exports" }, - { "include": "#comments" }, - { "include": "#strings" }, - { "include": "#initialization" }, - { "include": "#xml-literal" }, - { "include": "#keywords" }, - { "include": "#using" }, - { "include": "#constants" }, - { "include": "#scala-symbol" }, - { "include": "#singleton-type" }, - { "include": "#inline" }, - { "include": "#scala-quoted" }, - { "include": "#char-literal" }, - { "include": "#empty-parentheses" }, - { "include": "#parameter-list" }, - { "include": "#qualifiedClassName" }, - { "include": "#backQuotedVariable" }, - { "include": "#curly-braces" }, - { "include": "#meta-brackets" }, - { "include": "#meta-bounds" }, - { "include": "#meta-colons" } - ] - }, - "strings": { - "patterns": [ - { - "end": "\"\"\"(?!\")", - "begin": "\"\"\"", - "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin.scala" } - }, - "patterns": [ - { - "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}", - "name": "constant.character.escape.scala" - } - ], - "endCaptures": { - "0": { "name": "punctuation.definition.string.end.scala" } - }, - "name": "string.quoted.triple.scala" - }, - { - "begin": "\\b([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]+)(\"\"\")", - "end": "\"\"\"(?!\")", - "beginCaptures": { - "1": { "name": "keyword.interpolation.scala" }, - "2": { - "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.begin.scala" - } - }, - "patterns": [ - { "include": "#string-interpolation" }, - { - "match": "\\\\\\\\|\\\\u[0-9A-Fa-f]{4}", - "name": "constant.character.escape.scala" - }, - { "match": ".", "name": "string.quoted.triple.interpolated.scala" } - ], - "endCaptures": { - "0": { - "name": "string.quoted.triple.interpolated.scala punctuation.definition.string.end.scala" - } - } - }, - { - "end": "\"", - "begin": "\"", - "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin.scala" } - }, - "patterns": [ - { - "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})", - "name": "constant.character.escape.scala" - }, - { - "match": "\\\\.", - "name": "invalid.illegal.unrecognized-string-escape.scala" - } - ], - "endCaptures": { - "0": { "name": "punctuation.definition.string.end.scala" } - }, - "name": "string.quoted.double.scala" - }, - { - "begin": "\\b([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}]+)(\")", - "end": "\"", - "beginCaptures": { - "1": { "name": "keyword.interpolation.scala" }, - "2": { - "name": "string.quoted.double.interpolated.scala punctuation.definition.string.begin.scala" - } - }, - "patterns": [ - { "include": "#string-interpolation" }, - { - "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})", - "name": "constant.character.escape.scala" - }, - { - "match": "\\\\.", - "name": "invalid.illegal.unrecognized-string-escape.scala" - }, - { "match": ".", "name": "string.quoted.double.interpolated.scala" } - ], - "endCaptures": { - "0": { - "name": "string.quoted.double.interpolated.scala punctuation.definition.string.end.scala" - } - } - } - ] - }, - "using": { - "patterns": [ - { - "match": "(?<=\\()\\s*(using)\\s+(?=[\\w\\d\\(\\.\\(\\{'\"])", - "captures": { "1": { "name": "keyword.declaration.scala" } } - } - ] - }, - "string-interpolation": { - "patterns": [ - { - "name": "constant.character.escape.interpolation.scala", - "match": "\\$\\$" - }, - { - "name": "meta.template.expression.scala", - "match": "(\\$)([A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][[A-Z\\p{Lt}\\p{Lu}_a-z\\p{Lo}\\p{Nl}\\p{Ll}0-9]]*)", - "captures": { - "1": { - "name": "punctuation.definition.template-expression.begin.scala" - } - } - }, - { - "name": "meta.template.expression.scala", - "begin": "\\$\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.template-expression.begin.scala" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.template-expression.end.scala" - } - }, - "patterns": [{ "include": "#code" }], - "contentName": "meta.embedded.line.scala" - } - ] - }, - "xml-entity": { - "match": "(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { "name": "punctuation.definition.constant.xml" }, - "3": { "name": "punctuation.definition.constant.xml" } - }, - "name": "constant.character.entity.xml" - }, - "xml-singlequotedString": { - "end": "'", - "begin": "'", - "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin.xml" } - }, - "patterns": [{ "include": "#xml-entity" }], - "endCaptures": { - "0": { "name": "punctuation.definition.string.end.xml" } - }, - "name": "string.quoted.single.xml" - }, - "meta-colons": { - "patterns": [{ "match": "(?=?@^|~\\p{Sm}\\p{So}]+)?))(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", - "captures": { - "1": { "name": "keyword.declaration.end.scala" }, - "2": { "name": "keyword.declaration.end.scala" }, - "3": { "name": "entity.name.type.declaration" } - } - }, - { - "match": "^\\s*(end)\\s+(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))?(?=\\s*(//.*|/\\*(?!.*\\*/\\s*\\S.*).*)?$)", - "captures": { - "1": { "name": "keyword.declaration.end.scala" }, - "2": { "name": "entity.name.declaration" } - } - }, - { - "match": "\\b(catch|finally|try)\\b", - "name": "keyword.control.exception.scala" - }, - { - "match": "(==?|!=|<=|>=|<>|<|>)", - "name": "keyword.operator.comparison.scala" - }, - { - "match": "(\\-|\\+|\\*|/(?![/*])|%|~)", - "name": "keyword.operator.arithmetic.scala" - }, - { "match": "(!|&&|\\|\\|)", "name": "keyword.operator.logical.scala" }, - { - "match": "(<-|←|->|→|=>|⇒|\\?|\\:+|@|\\|)+", - "name": "keyword.operator.scala" - } - ] - }, - "singleton-type": { - "match": "\\.(type)(?![A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[0-9])", - "captures": { "1": { "name": "keyword.type.scala" } } - }, - "inline": { - "patterns": [ - { - "match": "\\b(inline)(?=\\s+((?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)\\s*:)", - "name": "storage.modifier.other" - }, - { - "match": "\\b(inline)\\b(?=(?:.(?!\\b(?:val|def|given)\\b))*\\b(if|match)\\b)", - "name": "keyword.control.flow.scala" - } - ] - }, - "scala-quoted": { - "patterns": [ - { - "match": "['$]\\{(?!')", - "name": "punctuation.section.block.begin.scala" - }, - { "match": "'\\[(?!')", "name": "meta.bracket.scala" } - ] - }, - "xml-doublequotedString": { - "end": "\"", - "begin": "\"", - "beginCaptures": { - "0": { "name": "punctuation.definition.string.begin.xml" } - }, - "patterns": [{ "include": "#xml-entity" }], - "endCaptures": { - "0": { "name": "punctuation.definition.string.end.xml" } - }, - "name": "string.quoted.double.xml" - }, - "declarations": { - "patterns": [ - { - "match": "\\b(def)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?", - "captures": { - "1": { "name": "keyword.declaration.scala" }, - "2": { "name": "entity.name.function.declaration" } - } - }, - { - "match": "\\b(trait)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?", - "captures": { - "1": { "name": "keyword.declaration.scala" }, - "2": { "name": "entity.name.class.declaration" } - } - }, - { - "match": "\\b(?:(case)\\s+)?(class|object|enum)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?", - "captures": { - "1": { "name": "keyword.declaration.scala" }, - "2": { "name": "keyword.declaration.scala" }, - "3": { "name": "entity.name.class.declaration" } - } - }, - { - "match": "(?=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?", - "captures": { - "1": { "name": "keyword.declaration.scala" }, - "2": { "name": "entity.name.type.declaration" } - } - }, - { - "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)(?=(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)?\\()", - "captures": { - "1": { "name": "keyword.declaration.stable.scala" }, - "2": { "name": "keyword.declaration.volatile.scala" } - } - }, - { - "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)(?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`)(?=\\s*,)", - "captures": { - "1": { "name": "keyword.declaration.stable.scala" }, - "2": { "name": "keyword.declaration.volatile.scala" } - } - }, - { - "match": "\\b(?:(val)|(var))\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?", - "captures": { - "1": { "name": "keyword.declaration.stable.scala" }, - "2": { "name": "keyword.declaration.volatile.scala" }, - "3": { "name": "variable.other.declaration.scala" } - } - }, - { - "match": "\\b(package)\\s+(object)\\b\\s*(?!//|/\\*)((?:(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)|`[^`]+`))?", - "captures": { - "1": { "name": "keyword.other.scoping.scala" }, - "2": { "name": "keyword.declaration.scala" }, - "3": { "name": "entity.name.class.declaration" } - } - }, - { - "end": "(?<=[\\n;])", - "begin": "\\b(package)\\s+", - "beginCaptures": { "1": { "name": "keyword.other.import.scala" } }, - "patterns": [ - { "include": "#comments" }, - { - "match": "(`[^`]+`|(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))", - "name": "entity.name.package.scala" - }, - { "match": "\\.", "name": "punctuation.definition.package" } - ], - "name": "meta.package.scala" - }, - { - "match": "\\b(given)\\b\\s*([_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`)?", - "captures": { - "1": { "name": "keyword.declaration.scala" }, - "2": { "name": "entity.name.given.declaration" } - } - } - ] - }, - "char-literal": { - "end": "'|$", - "begin": "'", - "beginCaptures": { - "0": { "name": "punctuation.definition.character.begin.scala" } - }, - "patterns": [ - { - "match": "\\\\(?:[btnfr\\\\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})", - "name": "constant.character.escape.scala" - }, - { - "match": "\\\\.", - "name": "invalid.illegal.unrecognized-character-escape.scala" - }, - { - "match": "[^']{2,}", - "name": "invalid.illegal.character-literal-too-long" - }, - { - "match": "(?'(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))(?!')", - "name": "constant.other.symbol.scala" - }, - "curly-braces": { - "begin": "\\{", - "end": "\\}", - "beginCaptures": { - "0": { "name": "punctuation.section.block.begin.scala" } - }, - "endCaptures": { "0": { "name": "punctuation.section.block.end.scala" } }, - "patterns": [{ "include": "#code" }] - }, - "meta-brackets": { - "patterns": [ - { - "match": "\\{", - "comment": "The punctuation.section.*.begin is needed for return snippet in source bundle", - "name": "punctuation.section.block.begin.scala" - }, - { - "match": "\\}", - "comment": "The punctuation.section.*.end is needed for return snippet in source bundle", - "name": "punctuation.section.block.end.scala" - }, - { "match": "{|}|\\(|\\)|\\[|\\]", "name": "meta.bracket.scala" } - ], - "comment": "For themes: Brackets look nice when colored." - }, - "qualifiedClassName": { - "match": "(\\b([A-Z][\\w]*))", - "captures": { "1": { "name": "entity.name.class" } } - }, - "backQuotedVariable": { "match": "`[^`]+`" }, - "storage-modifiers": { - "patterns": [ - { - "match": "\\b(private\\[\\S+\\]|protected\\[\\S+\\]|private|protected)\\b", - "name": "storage.modifier.access" - }, - { - "match": "\\b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\\b", - "name": "storage.modifier.other" - }, - { - "match": "(?<=^|\\s)\\b(transparent|opaque|infix|open|inline)\\b(?=[a-z\\s]*\\b(def|val|var|given|type|class|trait|object|enum)\\b)", - "name": "storage.modifier.other" - } - ] - }, - "meta-bounds": { - "match": "<%|=:=|<:<|<%<|>:|<:", - "comment": "For themes: Matching view bounds", - "name": "meta.bounds.scala" - }, - "comments": { - "patterns": [ - { "include": "#block-comments" }, - { - "end": "(?!\\G)", - "begin": "(^[ \\t]+)?(?=//)", - "beginCaptures": { - "1": { "name": "punctuation.whitespace.comment.leading.scala" } - }, - "patterns": [ - { - "end": "\\n", - "begin": "//", - "beginCaptures": { - "0": { "name": "punctuation.definition.comment.scala" } - }, - "name": "comment.line.double-slash.scala" - } - ] - } - ] - }, - "block-comments": { - "patterns": [ - { - "match": "/\\*\\*/", - "captures": { - "0": { "name": "punctuation.definition.comment.scala" } - }, - "name": "comment.block.empty.scala" - }, - { - "end": "\\*/", - "begin": "^\\s*(/\\*\\*)(?!/)", - "beginCaptures": { - "1": { "name": "punctuation.definition.comment.scala" } - }, - "patterns": [ - { - "match": "(@param)\\s+(\\S+)", - "captures": { - "1": { "name": "keyword.other.documentation.scaladoc.scala" }, - "2": { "name": "variable.parameter.scala" } - } - }, - { - "match": "(@(?:tparam|throws))\\s+(\\S+)", - "captures": { - "1": { "name": "keyword.other.documentation.scaladoc.scala" }, - "2": { "name": "entity.name.class" } - } - }, - { - "match": "@(return|see|note|example|constructor|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\\b", - "name": "keyword.other.documentation.scaladoc.scala" - }, - { - "match": "(\\[\\[)([^\\]]+)(\\]\\])", - "captures": { - "1": { - "name": "punctuation.definition.documentation.link.scala" - }, - "2": { "name": "string.other.link.title.markdown" }, - "3": { - "name": "punctuation.definition.documentation.link.scala" - } - } - }, - { "include": "#block-comments" } - ], - "endCaptures": { - "0": { "name": "punctuation.definition.comment.scala" } - }, - "name": "comment.block.documentation.scala" - }, - { - "end": "\\*/", - "begin": "/\\*", - "captures": { - "0": { "name": "punctuation.definition.comment.scala" } - }, - "patterns": [{ "include": "#block-comments" }], - "name": "comment.block.scala" - } - ] - }, - "xml-embedded-content": { - "patterns": [ - { - "end": "}", - "begin": "{", - "patterns": [{ "include": "#code" }], - "captures": { "0": { "name": "meta.bracket.scala" } }, - "name": "meta.source.embedded.scala" - }, - { - "match": " (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=", - "captures": { - "1": { "name": "entity.other.attribute-name.namespace.xml" }, - "2": { "name": "entity.other.attribute-name.xml" }, - "3": { "name": "punctuation.separator.namespace.xml" }, - "4": { "name": "entity.other.attribute-name.localname.xml" } - } - }, - { "include": "#xml-doublequotedString" }, - { "include": "#xml-singlequotedString" } - ] - }, - "inheritance": { - "patterns": [ - { - "match": "\\b(extends|with|derives)\\b\\s*([A-Z\\p{Lt}\\p{Lu}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|`[^`]+`|(?=\\([^\\)]+=>)|(?=(?:[A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?|[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+))|(?=\"))?", - "captures": { - "1": { "name": "keyword.declaration.scala" }, - "2": { "name": "entity.other.inherited-class.scala" } - } - } - ] - }, - "extension": { - "patterns": [ - { - "match": "^\\s*(extension)\\s+(?=[\\[\\(])", - "captures": { "1": { "name": "keyword.declaration.scala" } } - } - ] - }, - "parameter-list": { - "patterns": [ - { - "match": "(?<=[^\\._$a-zA-Z0-9])(`[^`]+`|[_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}][A-Z\\p{Lt}\\p{Lu}_a-z\\$\\p{Lo}\\p{Nl}\\p{Ll}0-9]*(?:(?<=_)[!#%&*+\\-\\/:<>=?@^|~\\p{Sm}\\p{So}]+)?)\\s*(:)\\s+", - "captures": { - "1": { "name": "variable.parameter.scala" }, - "2": { "name": "meta.colon.scala" } - } - } - ] - }, - "xml-literal": { - "patterns": [ - { - "end": "(>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)", - "begin": "(<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\\s[^>]*)?>)", - "beginCaptures": { - "1": { "name": "punctuation.definition.tag.xml" }, - "3": { "name": "entity.name.tag.namespace.xml" }, - "4": { "name": "entity.name.tag.xml" }, - "5": { "name": "punctuation.separator.namespace.xml" }, - "6": { "name": "entity.name.tag.localname.xml" } - }, - "patterns": [{ "include": "#xml-embedded-content" }], - "comment": "We do not allow a tag name to start with a - since this would likely conflict with the <- operator. This is not very common for tag names anyway. Also code such as -- if (val val3) will falsly be recognized as an xml tag. The solution is to put a space on either side of the comparison operator", - "endCaptures": { - "1": { "name": "punctuation.definition.tag.xml" }, - "2": { "name": "meta.scope.between-tag-pair.xml" }, - "3": { "name": "entity.name.tag.namespace.xml" }, - "4": { "name": "entity.name.tag.xml" }, - "5": { "name": "punctuation.separator.namespace.xml" }, - "6": { "name": "entity.name.tag.localname.xml" }, - "7": { "name": "punctuation.definition.tag.xml" } - }, - "name": "meta.tag.no-content.xml" - }, - { - "end": "(/?>)", - "begin": "(]*?>)", - "patterns": [{ "include": "#xml-embedded-content" }], - "captures": { - "1": { "name": "punctuation.definition.tag.xml" }, - "2": { "name": "entity.name.tag.namespace.xml" }, - "3": { "name": "entity.name.tag.xml" }, - "4": { "name": "punctuation.separator.namespace.xml" }, - "5": { "name": "entity.name.tag.localname.xml" } - }, - "name": "meta.tag.xml" - }, - { "include": "#xml-entity" } - ] - } - }, - "uuid": "158C0929-299A-40C8-8D89-316BE0C446E8", - "patterns": [{ "include": "#code" }], - "name": "Scala", - "scopeName": "source.scala" -} diff --git a/extensions/svelte-web/LICENSE b/extensions/svelte-web/LICENSE deleted file mode 100644 index 55dd59ab4..000000000 --- a/extensions/svelte-web/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2020-Present [these people](https://github.com/sveltejs/language-tools/graphs/contributors) - -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. \ No newline at end of file diff --git a/extensions/svelte-web/README.md b/extensions/svelte-web/README.md deleted file mode 100644 index 3319c1ced..000000000 --- a/extensions/svelte-web/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# This extension is a fork from [language-tools](https://github.com/sveltejs/language-tools) for github1s - -# At present only languages features is reserved - -# I have deleted some files and only reserved the necessary code - -# Svelte for VS Code - -Provides syntax highlighting in VS Code. - -## Features - -- Svelte - - - Diagnostic messages for warnings and errors - - Syntax Highlighting - -- HTML - - Hover info - - Symbols in Outline panel -- CSS / SCSS / LESS - - Diagnostic messages for syntax and lint errors - - Hover info - - Color highlighting and color picker - - Symbols in Outline panel -- TypeScript / JavaScript - - Diagnostics messages for syntax errors, semantic errors, and suggestions - - Hover info - - Symbols in Outline panel diff --git a/extensions/svelte-web/icons/logo-nightly.png b/extensions/svelte-web/icons/logo-nightly.png deleted file mode 100644 index fa6963eda..000000000 Binary files a/extensions/svelte-web/icons/logo-nightly.png and /dev/null differ diff --git a/extensions/svelte-web/icons/logo.png b/extensions/svelte-web/icons/logo.png deleted file mode 100644 index bf35b1e5e..000000000 Binary files a/extensions/svelte-web/icons/logo.png and /dev/null differ diff --git a/extensions/svelte-web/icons/preview-right-dark.svg b/extensions/svelte-web/icons/preview-right-dark.svg deleted file mode 100644 index 1d5987719..000000000 --- a/extensions/svelte-web/icons/preview-right-dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/extensions/svelte-web/icons/preview-right-light.svg b/extensions/svelte-web/icons/preview-right-light.svg deleted file mode 100644 index 3f1152fc3..000000000 --- a/extensions/svelte-web/icons/preview-right-light.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/extensions/svelte-web/language-configuration.json b/extensions/svelte-web/language-configuration.json deleted file mode 100644 index fb93c0d7f..000000000 --- a/extensions/svelte-web/language-configuration.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "comments": { - "blockComment": [""] - }, - "brackets": [ - [""], - ["<", ">"], - ["{", "}"], - ["(", ")"], - ["[", "]"] - ], - "autoClosingPairs": [{ - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "'", - "close": "'" - }, - { - "open": "\"", - "close": "\"" - }, - { - "open": "", - "notIn": ["comment", "string"] - }, - { - "open": "/**", - "close": "*/", - "notIn": ["string"] - } - ], - "surroundingPairs": [{ - "open": "'", - "close": "'" - }, - { - "open": "\"", - "close": "\"" - }, - { - "open": "`", - "close": "`" - }, - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "<", - "close": ">" - } - ], - "folding": { - "markers": { - "start": "^\\s*//\\s*#?region\\b|^<(template|style|script)[^>]*>", - "end": "^\\s*//\\s*#?endregion\\b|^" - } - } -} \ No newline at end of file diff --git a/extensions/svelte-web/package.json b/extensions/svelte-web/package.json deleted file mode 100644 index 15ad134e9..000000000 --- a/extensions/svelte-web/package.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "name": "svelte-vscode", - "version": "0.5.0", - "description": "Svelte language support for VS Code", - "scripts": { - "build:grammar": "js-yaml syntaxes/svelte.tmLanguage.src.yaml > syntaxes/svelte.tmLanguage.json", - "build": "npm run build:ts && npm run build:grammar", - "vscode:prepublish": "npm run build && npm prune --production", - "compile": "npm run build:grammar", - "watch": "echo done" - }, - "repository": { - "type": "git", - "url": "https://github.com/sveltejs/language-tools.git" - }, - "keywords": [ - "svelte", - "vscode" - ], - "author": "James Birtles & the Svelte Core Team", - "license": "MIT", - "bugs": { - "url": "https://github.com/sveltejs/language-tools/issues" - }, - "homepage": "https://github.com/sveltejs/language-tools#readme", - "displayName": "Svelte for VS Code", - "publisher": "svelte", - "icon": "icons/logo.png", - "galleryBanner": { - "color": "#FF3E00", - "theme": "dark" - }, - "categories": [ - "Programming Languages", - "Formatters" - ], - "engines": { - "vscode": "^1.52.0" - }, - "contributes": { - "languages": [ - { - "id": "svelte", - "aliases": [ - "Svelte", - "svelte" - ], - "extensions": [ - ".svelte" - ], - "configuration": "./language-configuration.json" - }, - { - "id": "json", - "filenames": [ - ".prettierrc" - ] - } - ], - "grammars": [ - { - "language": "svelte", - "scopeName": "source.svelte", - "path": "./syntaxes/svelte.tmLanguage.json", - "embeddedLanguages": { - "text.html.basic": "html", - "text.html.markdown": "markdown", - "text.pug": "jade", - "source.css": "css", - "source.css.less": "less", - "source.css.scss": "scss", - "source.css.postcss": "postcss", - "source.sass": "sass", - "source.stylus": "stylus", - "source.js": "javascript", - "source.ts": "typescript" - } - }, - { - "scopeName": "svelte.pug", - "path": "./syntaxes/pug-svelte.json", - "injectTo": [ - "source.svelte" - ], - "embeddedLanguages": { - "source.ts": "typescript", - "text.pug": "jade" - } - }, - { - "scopeName": "svelte.pug.tags", - "path": "./syntaxes/pug-svelte-tags.json", - "injectTo": [ - "source.svelte" - ], - "embeddedLanguages": { - "source.ts": "typescript", - "text.pug": "jade" - } - }, - { - "scopeName": "svelte.pug.dotblock", - "path": "./syntaxes/pug-svelte-dotblock.json", - "injectTo": [ - "source.svelte" - ], - "embeddedLanguages": { - "source.ts": "typescript" - } - }, - { - "scopeName": "markdown.svelte.codeblock", - "path": "./syntaxes/markdown-svelte.json", - "injectTo": [ - "text.html.markdown" - ], - "embeddedLanguages": { - "meta.embedded.block.svelte": "svelte" - } - } - ] - }, - "devDependencies": { - "js-yaml": "^4.0.0" - } -} diff --git a/extensions/svelte-web/scripts/.eslintrc.js b/extensions/svelte-web/scripts/.eslintrc.js deleted file mode 100644 index db58780fd..000000000 --- a/extensions/svelte-web/scripts/.eslintrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - root: false, - rules: { - '@typescript-eslint/no-var-requires': 'off', - }, -}; diff --git a/extensions/svelte-web/syntaxes/markdown-svelte.json b/extensions/svelte-web/syntaxes/markdown-svelte.json deleted file mode 100644 index 5fced660e..000000000 --- a/extensions/svelte-web/syntaxes/markdown-svelte.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "scopeName": "markdown.svelte.codeblock", - "fileTypes": [], - "injectionSelector": "L:text.html.markdown", - "patterns": [ - { - "include": "#svelte-code-block" - } - ], - "repository": { - "svelte-code-block": { - "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(svelte|sv)(\\s+[^`~]*)?$)", - "name": "markup.fenced_code.block.markdown", - "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", - "beginCaptures": { - "3": { - "name": "punctuation.definition.markdown" - }, - "5": { - "name": "fenced_code.block.language" - }, - "6": { - "name": "fenced_code.block.language.attributes" - } - }, - "endCaptures": { - "3": { - "name": "punctuation.definition.markdown" - } - }, - "patterns": [ - { - "begin": "(^|\\G)(\\s*)(.*)", - "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", - "contentName": "meta.embedded.block.svelte", - "patterns": [ - { - "include": "source.svelte" - } - ] - } - ] - } - } -} diff --git a/extensions/svelte-web/syntaxes/pug-svelte-dotblock.json b/extensions/svelte-web/syntaxes/pug-svelte-dotblock.json deleted file mode 100644 index 450a1451b..000000000 --- a/extensions/svelte-web/syntaxes/pug-svelte-dotblock.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "scopeName": "svelte.pug.dotblock", - "fileTypes": [], - "injectionSelector": "L:text.block.pug -meta.embedded.ts", - "patterns": [ - { - "include": "#interp-object-literal" - }, - { - "include": "#interp" - } - ], - "repository": { - "interp-object-literal": { - "contentName": "meta.interpolation meta.embedded.ts", - "begin": "(?![!$#]){\\s*?(?={)", - "beginCaptures": { - "0": { - "name": "punctuation.section.interpolation.begin" - } - }, - "end": "(?<=})\\s*?}", - "endCaptures": { - "0": { - "name": "punctuation.section.interpolation.end" - } - }, - "patterns": [ - { - "include": "source.ts#object-literal" - } - ] - }, - "interp": { - "contentName": "meta.interpolation meta.embedded.ts", - "begin": "(?![!$#]){", - "beginCaptures": { - "0": { - "name": "punctuation.section.interpolation.begin" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.section.interpolation.end" - } - }, - "patterns": [ - { - "include": "source.ts" - } - ] - } - } -} diff --git a/extensions/svelte-web/syntaxes/pug-svelte-tags.json b/extensions/svelte-web/syntaxes/pug-svelte-tags.json deleted file mode 100644 index bfade35ef..000000000 --- a/extensions/svelte-web/syntaxes/pug-svelte-tags.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "scopeName": "svelte.pug.tags", - "fileTypes": [], - "injectionSelector": "L:text.pug meta.tag.other -meta.embedded.ts", - "patterns": [ - { - "include": "#interp-object-literal" - }, - { - "include": "#interp" - }, - { - "include": "#attr-function" - }, - { - "include": "#attr-interp" - }, - { - "include": "#attr-interp-invalid-quotes" - }, - { - "include": "#attr-interp-invalid-noquotes" - }, - { - "include": "#attr-event" - }, - { - "include": "#attr-variable" - } - ], - "repository": { - "interp-object-literal": { - "contentName": "meta.interpolation meta.embedded.ts", - "begin": "(?![!$#]){\\s*?(?={)", - "beginCaptures": { - "0": { - "name": "punctuation.section.interpolation.begin" - } - }, - "end": "(?<=})\\s*?}", - "endCaptures": { - "0": { - "name": "punctuation.section.interpolation.end" - } - }, - "patterns": [ - { - "include": "source.ts#object-literal" - } - ] - }, - "interp": { - "contentName": "meta.interpolation meta.embedded.ts", - "begin": "(?![!$#]){", - "beginCaptures": { - "0": { - "name": "punctuation.section.interpolation.begin" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.section.interpolation.end" - } - }, - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "attr-interp": { - "match": "\\b(?<=[\\w$\\-_]*)\\s*?(!=|=)\\s*?([`'\"])((?![$!#]){.*})(\\k<2>)", - "captures": { - "1": { - "patterns": [ - { - "match": "=", - "name": "invalid.illegal" - }, - { - "match": "!=", - "name": "keyword.operator.assignment" - } - ] - }, - "2": { - "name": "punctuation.section.interpolation.begin" - }, - "3": { - "patterns": [ - { - "include": "#interp" - } - ] - }, - "4": { - "name": "punctuation.section.interpolation.begin" - } - } - }, - "attr-interp-invalid-quotes": { - "match": "\\b(?<=[\\w$\\-_]*)\\s*?(!=|=)\\s*?([`'\"])((?![$!#]){.*})(?!\\k<2>)", - "captures": { - "1": { - "patterns": [ - { - "match": "=", - "name": "invalid.illegal" - }, - { - "match": "!=", - "name": "keyword.operator.assignment" - } - ] - }, - "2": { - "name": "punctuation.section.interpolation.begin" - }, - "3": { - "name": "invalid.illegal" - }, - "4": { - "name": "invalid.illegal" - } - } - }, - "attr-interp-invalid-noquotes": { - "match": "\\b(?<=[\\w$\\-_]*)\\s*?(!=|=)\\s*?(?![`'\"])((?![$!#]){.*})(?![`'\"])", - "captures": { - "1": { - "patterns": [ - { - "match": "=", - "name": "invalid.illegal" - }, - { - "match": "!=", - "name": "keyword.operator.assignment" - } - ] - }, - "2": { - "name": "invalid.illegal" - }, - "3": { - "patterns": [ - { - "include": "#interp" - } - ] - }, - "4": { - "name": "invalid.illegal" - } - } - }, - "attr-function": { - "match": "\\b(use|transition|in|out|animate)(:)(\\w+)", - "captures": { - "1": { - "name": "entity.other.attribute-name" - }, - "2": { - "name": "keyword.operator.assignment" - }, - "3": { - "name": "variable.function" - } - } - }, - "attr-event": { - "match": "\\b(on)(:)(\\w+)", - "captures": { - "1": { - "name": "entity.other.attribute-name" - }, - "2": { - "name": "keyword.operator.assignment" - }, - "3": { - "name": "entity.name.type" - } - } - }, - "attr-variable": { - "match": "\\b(bind|class|let)(:)(\\w+)", - "captures": { - "1": { - "name": "entity.other.attribute-name" - }, - "2": { - "name": "keyword.operator.assignment" - }, - "3": { - "name": "variable.parameter" - } - } - } - } -} diff --git a/extensions/svelte-web/syntaxes/pug-svelte.json b/extensions/svelte-web/syntaxes/pug-svelte.json deleted file mode 100644 index c09105464..000000000 --- a/extensions/svelte-web/syntaxes/pug-svelte.json +++ /dev/null @@ -1,293 +0,0 @@ -{ - "scopeName": "svelte.pug", - "fileTypes": [], - "injectionSelector": "L:text.pug -meta.embedded.ts -meta.tag.other -text.block.pug, L:inline.pug -meta.embedded.ts -meta.tag.other", - "patterns": [ - { - "include": "#interp-object-literal" - }, - { - "include": "#interp" - }, - { - "include": "#tag-component" - }, - { - "include": "#tag-component-no-params" - }, - { - "include": "#mixin-svelte" - }, - { - "include": "#mixin-else" - } - ], - "repository": { - "interp-object-literal": { - "contentName": "meta.interpolation meta.embedded.ts", - "begin": "(?![!$#]){\\s*?(?={)", - "beginCaptures": { - "0": { - "name": "punctuation.section.interpolation.begin" - } - }, - "end": "(?<=})\\s*?}", - "endCaptures": { - "0": { - "name": "punctuation.section.interpolation.end" - } - }, - "patterns": [ - { - "include": "source.ts#object-literal" - } - ] - }, - "interp": { - "contentName": "meta.interpolation meta.embedded.ts", - "begin": "(?![!$#]){", - "beginCaptures": { - "0": { - "name": "punctuation.section.interpolation.begin" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.section.interpolation.end" - } - }, - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "tag-component": { - "name": "meta.tag.svelte", - "begin": "(?<=^\\s*?|#\\[\\s*?|:\\s+?)([A-Z][a-zA-Z0-9_]*)\\s*?(?=\\()", - "beginCaptures": { - "0": { - "name": "support.class.component.svelte" - } - }, - "end": "(?<=\\))", - "endCaptures": { - "0": { - "name": "constant.name.attribute.tag" - } - }, - "patterns": [ - { - "include": "text.pug#tag_attributes" - } - ] - }, - "tag-component-no-params": { - "name": "meta.tag.svelte", - "match": "(?<=^\\s*?|#\\[\\s*?|:\\s+?)([A-Z][a-zA-Z0-9_]*)", - "captures": { - "0": { - "name": "support.class.component.svelte" - } - } - }, - "mixin-svelte": { - "match": "(?<=^\\s*?|#\\[\\s*?|:\\s+?)(\\+)(debug|if|elseif|then|catch|each|await|html|key)\\s*?(\\()\\s*?([`'\"])(.*?)(\\k<4>)\\s*?(\\))", - "captures": { - "1": { - "name": "punctuation.definition.keyword" - }, - "2": { - "patterns": [ - { - "match": "debug", - "name": "keyword.other.debugger" - }, - { - "match": "if|elseif", - "name": "keyword.control.conditional" - }, - { - "match": "then|catch|await", - "name": "keyword.control.flow" - }, - { - "match": "each", - "name": "keyword.control" - }, - { - "match": "html|key", - "name": "support.function" - } - ] - }, - "3": { - "name": "meta.brace.round" - }, - "4": { - "name": "punctuation.definition.generic.begin" - }, - "5": { - "patterns": [ - { - "match": "(?<=each\\s*?\\(\\s*?')(.*)\\s+?(as\\s+?(.*?)(\\s*?,\\s*?)(.*?|)(\\s+?\\(.*\\)|)$)", - "captures": { - "1": { - "name": "meta.embedded.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "2": { - "name": "keyword.control.as" - }, - "3": { - "name": "meta.embedded.t", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "4": { - "name": "punctuation.separator" - }, - "5": { - "name": "meta.embedded.t", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "6": { - "patterns": [ - { - "match": "(\\()(.*)(\\))", - "captures": { - "1": { - "name": "meta.brace.round" - }, - "2": { - "name": "variable" - }, - "3": { - "name": "meta.brace.round" - } - } - } - ] - } - } - }, - { - "match": "(?<=each\\s*?\\(\\s*?')(.*)\\s+?(as\\s+?(.*?)(\\s+?\\(.*\\)|)$)", - "captures": { - "1": { - "name": "meta.embedded.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "2": { - "name": "keyword.control.as" - }, - "3": { - "name": "meta.embedded.t", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "4": { - "patterns": [ - { - "match": "(\\()(.*)(\\))", - "captures": { - "1": { - "name": "meta.brace.round" - }, - "2": { - "name": "variable" - }, - "3": { - "name": "meta.brace.round" - } - } - } - ] - } - } - }, - { - "match": "(?<=await\\s*?\\(\\s*?')(.*)\\s+?(then(.*)$)", - "captures": { - "1": { - "name": "meta.embedded.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - "2": { - "name": "keyword.control.flow" - }, - "3": { - "name": "variable" - } - } - }, - { - "match": "(?<=debug\\s*?\\(\\s*?')(\\w+?)(,|$)", - "captures": { - "1": { - "name": "variable" - }, - "2": { - "name": "punctuation.separator" - } - } - }, - { - "match": "(.*)$", - "captures": { - "0": { - "name": "meta.embedded.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - } - } - } - ] - }, - "6": { - "name": "punctuation.definition.generic.end" - }, - "7": { - "name": "meta.brace.round" - } - } - }, - "mixin-else": { - "match": "(?<=^\\s*?|#\\[\\s*?|:\\s+?)(\\+)(else)", - "captures": { - "1": { - "name": "punctuation.definition.keyword" - }, - "2": { - "name": "keyword.control.conditional" - } - } - } - } -} diff --git a/extensions/svelte-web/syntaxes/svelte.tmLanguage.json b/extensions/svelte-web/syntaxes/svelte.tmLanguage.json deleted file mode 100644 index a77e9c52c..000000000 --- a/extensions/svelte-web/syntaxes/svelte.tmLanguage.json +++ /dev/null @@ -1,1015 +0,0 @@ -{ - "name": "Svelte Component", - "scopeName": "source.svelte", - "fileTypes": [ - "svelte" - ], - "uuid": "7582b62f-51d9-4a84-8c8d-fc189530faf6", - "injections": { - "L:meta.script.svelte meta.lang.javascript - (meta source)": { - "patterns": [ - { - "begin": "(?<=>)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)\\s", - "end": "(?=|})", - "end": "(?=<|{)", - "name": "text.svelte" - } - ] - }, - "comments": { - "begin": "", - "captures": { - "0": { - "name": "punctuation.definition.comment.svelte" - } - }, - "name": "comment.block.svelte", - "patterns": [ - { - "begin": "(@)(component)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.keyword.svelte" - }, - "2": { - "name": "storage.type.class.component.svelte keyword.declaration.class.component.svelte" - } - }, - "end": "(?=-->)", - "contentName": "comment.block.documentation.svelte", - "patterns": [ - { - "match": ".*?(?=-->)", - "captures": { - "0": { - "patterns": [ - { - "include": "text.html.markdown" - } - ] - } - } - }, - { - "include": "text.html.markdown" - } - ] - }, - { - "match": "\\G-?>|)|--!>", - "name": "invalid.illegal.characters-not-allowed-here.svelte" - } - ] - }, - "destructuring": { - "patterns": [ - { - "begin": "(?={)", - "end": "(?<=})", - "name": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts#object-binding-pattern" - } - ] - }, - { - "begin": "(?=\\[)", - "end": "(?<=\\])", - "name": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts#array-binding-pattern" - } - ] - } - ] - }, - "interpolation": { - "patterns": [ - { - "begin": "\\{", - "end": "\\}", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.svelte" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.svelte" - } - }, - "contentName": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "begin": "\\G\\s*(?={)", - "end": "(?<=})", - "patterns": [ - { - "include": "source.ts#object-literal" - } - ] - }, - { - "include": "source.ts" - } - ] - } - ] - }, - "special-tags": { - "patterns": [ - { - "include": "#special-tags-void" - }, - { - "include": "#special-tags-block-begin" - }, - { - "include": "#special-tags-block-end" - } - ] - }, - "special-tags-keywords": { - "match": "([#@/:])(else\\s+if|[a-z]*)", - "captures": { - "1": { - "name": "punctuation.definition.keyword.svelte" - }, - "2": { - "patterns": [ - { - "match": "if|else\\s+if|else", - "name": "keyword.control.conditional.svelte" - }, - { - "match": "each|key", - "name": "keyword.control.svelte" - }, - { - "match": "await|then|catch", - "name": "keyword.control.flow.svelte" - }, - { - "match": "html", - "name": "keyword.other.svelte" - }, - { - "match": "debug", - "name": "keyword.other.debugger.svelte" - } - ] - } - } - }, - "special-tags-modes": { - "patterns": [ - { - "begin": "(?<=(if|key|then|catch|html).*?)\\G", - "end": "(?=})", - "name": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - { - "begin": "(?<=each.*?)\\G", - "end": "(?=})", - "patterns": [ - { - "begin": "\\G\\s*?(?=\\S)", - "end": "(?=(?:^\\s*|\\s+)(as))", - "contentName": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - { - "begin": "(as)", - "beginCaptures": { - "1": { - "name": "keyword.control.as.svelte" - } - }, - "end": "(?=})", - "patterns": [ - { - "include": "#destructuring" - }, - { - "begin": "\\(", - "end": "\\)|(?=})", - "captures": { - "0": { - "name": "meta.brace.round.svelte" - } - }, - "contentName": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - { - "match": "(\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*)", - "captures": { - "1": { - "name": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - } - } - }, - { - "match": ",", - "name": "punctuation.separator.svelte" - } - ] - } - ] - }, - { - "begin": "(?<=await.*?)\\G", - "end": "(?=})", - "patterns": [ - { - "begin": "\\G\\s*?(?=\\S)", - "end": "\\s+(then)|(?=})", - "endCaptures": { - "1": { - "name": "keyword.control.flow.svelte" - } - }, - "contentName": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - { - "begin": "(?<=then\\b)", - "end": "(?=})", - "contentName": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - } - ] - }, - { - "begin": "(?<=debug.*?)\\G", - "end": "(?=})", - "patterns": [ - { - "match": "[_$[:alpha:]][_$[:alnum:]]*", - "captures": { - "0": { - "name": "meta.embedded.expression.svelte source.ts", - "patterns": [ - { - "include": "source.ts" - } - ] - } - } - }, - { - "match": ",", - "name": "punctuation.separator.svelte" - } - ] - } - ] - }, - "special-tags-void": { - "begin": "({)\\s*((?:[@:])(else\\s+if|[a-z]*))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.block.begin.svelte" - }, - "2": { - "patterns": [ - { - "include": "#special-tags-keywords" - } - ] - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.block.end.svelte" - } - }, - "name": "meta.special.$3.svelte", - "patterns": [ - { - "include": "#special-tags-modes" - } - ] - }, - "special-tags-block-begin": { - "begin": "({)\\s*(#([a-z]*))", - "end": "(})", - "name": "meta.special.$3.svelte meta.special.start.svelte", - "beginCaptures": { - "1": { - "name": "punctuation.definition.block.begin.svelte" - }, - "2": { - "patterns": [ - { - "include": "#special-tags-keywords" - } - ] - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.block.end.svelte" - } - }, - "patterns": [ - { - "include": "#special-tags-modes" - } - ] - }, - "special-tags-block-end": { - "begin": "({)\\s*(/([a-z]*))", - "end": "(})", - "name": "meta.special.$3.svelte meta.special.end.svelte", - "beginCaptures": { - "1": { - "name": "punctuation.definition.block.begin.svelte" - }, - "2": { - "patterns": [ - { - "include": "#special-tags-keywords" - } - ] - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.block.end.svelte" - } - } - }, - "attributes": { - "patterns": [ - { - "include": "#attributes-directives" - }, - { - "include": "#attributes-keyvalue" - }, - { - "include": "#attributes-interpolated" - } - ] - }, - "attributes-interpolated": { - "begin": "(?)", - "patterns": [ - { - "include": "#interpolation" - }, - { - "match": "([0-9._]+[\\w]{,4})(?=\\s|/?>)", - "name": "constant.numeric.decimal.svelte", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - { - "match": "([^\\s\"'=<>`/]|/(?!>))+", - "name": "string.unquoted.svelte", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - { - "begin": "(['\"])", - "end": "\\1", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.svelte" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.svelte" - } - }, - "name": "string.quoted.svelte", - "patterns": [ - { - "include": "#interpolation" - } - ] - } - ] - }, - "attributes-directives-keywords": { - "patterns": [ - { - "match": "on|use|bind", - "name": "keyword.control.svelte" - }, - { - "match": "transition|in|out|animate", - "name": "keyword.other.animation.svelte" - }, - { - "match": "let", - "name": "storage.type.svelte" - }, - { - "match": "class", - "name": "entity.other.attribute-name.svelte" - } - ] - }, - "attributes-directives-types": { - "patterns": [ - { - "match": "(?<=(on):).*$", - "name": "entity.name.type.svelte" - }, - { - "match": "(?<=(bind):).*$", - "name": "variable.parameter.svelte" - }, - { - "match": "(?<=(use|transition|in|out|animate):).*$", - "name": "variable.function.svelte" - }, - { - "match": "(?<=(let|class):).*$", - "name": "variable.parameter.svelte" - } - ] - }, - "attributes-directives-types-assigned": { - "patterns": [ - { - "match": "(?<=(bind):)this$", - "name": "variable.language.svelte" - }, - { - "match": "(?<=(bind):).*$", - "name": "entity.name.type.svelte" - }, - { - "match": "(?<=(class):).*$", - "name": "entity.other.attribute-name.class.svelte" - }, - { - "include": "#attributes-directives-types" - } - ] - }, - "attributes-directives": { - "begin": "(?)", - "name": "meta.tag.start.svelte", - "patterns": [ - { - "include": "#attributes" - } - ] - }, - "tags-lang-start-attributes": { - "begin": "\\G", - "end": "(?=/>)|>", - "name": "meta.tag.start.svelte", - "patterns": [ - { - "include": "#attributes" - } - ] - }, - "tags-start-node": { - "match": "(<)([^/\\s>/]*)", - "captures": { - "1": { - "name": "punctuation.definition.tag.begin.svelte" - }, - "2": { - "patterns": [ - { - "include": "#tags-name" - } - ] - } - }, - "name": "meta.tag.start.svelte" - }, - "tags-end-node": { - "match": "()|(/>)", - "captures": { - "1": { - "name": "meta.tag.end.svelte punctuation.definition.tag.begin.svelte" - }, - "2": { - "name": "meta.tag.end.svelte", - "patterns": [ - { - "include": "#tags-name" - } - ] - }, - "3": { - "name": "meta.tag.end.svelte punctuation.definition.tag.end.svelte" - }, - "4": { - "name": "meta.tag.start.svelte punctuation.definition.tag.end.svelte" - } - } - }, - "tags-lang": { - "begin": "<(script|style|template)", - "end": "|/>", - "beginCaptures": { - "0": { - "patterns": [ - { - "include": "#tags-start-node" - } - ] - } - }, - "endCaptures": { - "0": { - "patterns": [ - { - "include": "#tags-end-node" - } - ] - } - }, - "name": "meta.$1.svelte", - "patterns": [ - { - "begin": "\\G(?=\\s*(type|lang)\\s*=\\s*(['\"]|)(?:text/)?(\\w+)\\2)", - "end": "(?=)", - "name": "meta.lang.$3.svelte", - "patterns": [ - { - "include": "#tags-lang-start-attributes" - } - ] - }, - { - "include": "#tags-lang-start-attributes" - } - ] - }, - "tags-void": { - "begin": "(<)(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)(?=\\s|/?>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.svelte" - }, - "2": { - "name": "entity.name.tag.svelte" - } - }, - "end": "/?>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.begin.svelte" - } - }, - "name": "meta.tag.void.svelte", - "patterns": [ - { - "include": "#attributes" - } - ] - }, - "tags-general-start": { - "begin": "(<)([^/\\s>/]*)", - "end": "(/?>)", - "beginCaptures": { - "0": { - "patterns": [ - { - "include": "#tags-start-node" - } - ] - } - }, - "endCaptures": { - "1": { - "name": "meta.tag.start.svelte punctuation.definition.tag.end.svelte" - } - }, - "name": "meta.scope.tag.$2.svelte", - "patterns": [ - { - "include": "#tags-start-attributes" - } - ] - }, - "tags-general-end": { - "begin": "(]*)", - "end": "(>)", - "beginCaptures": { - "1": { - "name": "meta.tag.end.svelte punctuation.definition.tag.begin.svelte" - }, - "2": { - "name": "meta.tag.end.svelte", - "patterns": [ - { - "include": "#tags-name" - } - ] - } - }, - "endCaptures": { - "1": { - "name": "meta.tag.end.svelte punctuation.definition.tag.end.svelte" - } - }, - "name": "meta.scope.tag.$2.svelte" - } - } -} diff --git a/extensions/svelte-web/syntaxes/svelte.tmLanguage.src.yaml b/extensions/svelte-web/syntaxes/svelte.tmLanguage.src.yaml deleted file mode 100644 index ab486c91d..000000000 --- a/extensions/svelte-web/syntaxes/svelte.tmLanguage.src.yaml +++ /dev/null @@ -1,695 +0,0 @@ ---- -name: Svelte Component -scopeName: source.svelte -fileTypes: [svelte] -uuid: 7582b62f-51d9-4a84-8c8d-fc189530faf6 - -injections: - # ---- EMBEDDED LANGUAGES - # Yes, this is dark, abyssal magic - conjured up from the depths of tedious experimentation. - - # Format: - # 'L:meta..svelte (meta.lang. | meta.lang. | ...) - (meta source)' - # patterns: [{begin: '(?<=>)(?!, patterns: [{ include: source. }]}] - - # Script Languages - # JavaScript | 'javascript' | 'source.js' - 'L:meta.script.svelte meta.lang.javascript - (meta source)': - patterns: - [ - { - begin: '(?<=>)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)(?!)\s', - end: '(?=|}) - end: (?=<|{) - name: text.svelte - - # ---------- - # COMMENTS - - # Basic HTML comments. - comments: - begin: - captures: - 0: { name: punctuation.definition.comment.svelte } - name: comment.block.svelte - patterns: - # Component documentation. - - begin: (@)(component) - beginCaptures: - 1: { name: punctuation.definition.keyword.svelte } - 2: - { - name: storage.type.class.component.svelte keyword.declaration.class.component.svelte, - } - end: (?=-->) - contentName: comment.block.documentation.svelte - patterns: - # The reason we do it like this is so that the Markdown grammar cannot break out of the `-->` bit. - # Embedded languages, for whatever reason, can only break out of begin-end blocks. (...most of the time) - # If you shove them in a match pattern, it cannot break out of it's matched bounds. - # And since the match consumed the line leading to `-->`, - # the 'block' markdown won't break out of the comment block. - - match: .*?(?=-->) - captures: { 0: { patterns: [include: text.html.markdown] } } - - include: text.html.markdown - # Validations - - { - match: '\G-?>|)|--!>', - name: invalid.illegal.characters-not-allowed-here.svelte, - } - - # ------ - # MISC - - # Destructuring {} and [] JS syntax. Currently only used in some special tags. - destructuring: - patterns: - # {...} - - { - begin: '(?={)', - end: '(?<=})', - name: meta.embedded.expression.svelte source.ts, - patterns: [include: source.ts#object-binding-pattern], - } - # [...] - - { - begin: '(?=\[)', - end: '(?<=\])', - name: meta.embedded.expression.svelte source.ts, - patterns: [include: source.ts#array-binding-pattern], - } - - # Plain old interpolation between `{...}` blocks. - interpolation: - patterns: - - begin: \{ - end: \} - beginCaptures: - { 0: { name: punctuation.section.embedded.begin.svelte } } - endCaptures: { 0: { name: punctuation.section.embedded.end.svelte } } - contentName: meta.embedded.expression.svelte source.ts - patterns: - # Object literals - usually used within attributes. - - begin: \G\s*(?={) - end: (?<=}) - patterns: [include: source.ts#object-literal] - - include: source.ts - - # -------------- - # SPECIAL TAGS - - # All special tags together. Used whenever a new scope is introduced. - special-tags: - patterns: - - include: '#special-tags-void' - - include: '#special-tags-block-begin' - - include: '#special-tags-block-end' - - # Special tag keywords, like `#if` and `/await`. - special-tags-keywords: - match: ([#@/:])(else\s+if|[a-z]*) - captures: - 1: { name: punctuation.definition.keyword.svelte } - # The keyword itself. If others are patched in in the future, they can easily be added here. - 2: - { - patterns: - [ - { - match: if|else\s+if|else, - name: keyword.control.conditional.svelte, - }, - { match: each|key, name: keyword.control.svelte }, - { match: await|then|catch, name: keyword.control.flow.svelte }, - { match: html, name: keyword.other.svelte }, - { match: debug, name: keyword.other.debugger.svelte }, - ], - } - - # Scopes special tag _block start nodes_ depending on what type they are, such as `#if` or `#await` blocks. - special-tags-modes: - patterns: - # Expressions or simple values. - - begin: (?<=(if|key|then|catch|html).*?)\G - end: (?=}) - name: meta.embedded.expression.svelte source.ts - patterns: [include: source.ts] - - # Each. - - begin: (?<=each.*?)\G - end: (?=}) - patterns: - # Start expression. - - begin: \G\s*?(?=\S) - end: (?=(?:^\s*|\s+)(as)) - contentName: meta.embedded.expression.svelte source.ts - patterns: [include: source.ts] - # 'as' token and onwards. - - begin: (as) - beginCaptures: { 1: { name: keyword.control.as.svelte } } - end: (?=}) - patterns: - # [] and {} destructuring blocks. - - include: '#destructuring' - # Key expression. - - begin: \( - end: \)|(?=}) - captures: { 0: { name: meta.brace.round.svelte } } - contentName: meta.embedded.expression.svelte source.ts - patterns: [include: source.ts] - # Name or index expression. - - match: (\s*([_$[:alpha:]][_$[:alnum:]]*)\s*) - captures: - { - 1: - { - name: meta.embedded.expression.svelte source.ts, - patterns: [include: source.ts], - }, - } - # The comma. - - { match: ',', name: punctuation.separator.svelte } - - # Await. - - begin: (?<=await.*?)\G - end: (?=}) - patterns: - # Promise expression. - - begin: \G\s*?(?=\S) - end: \s+(then)|(?=}) - endCaptures: { 1: { name: keyword.control.flow.svelte } } - contentName: meta.embedded.expression.svelte source.ts - patterns: [include: source.ts] - # Then expression. - - begin: (?<=then\b) - end: (?=}) - contentName: meta.embedded.expression.svelte source.ts - patterns: [include: source.ts] - - # Debug. - - begin: (?<=debug.*?)\G - end: (?=}) - patterns: - # Variables. - - match: '[_$[:alpha:]][_$[:alnum:]]*' - captures: - { - 0: - { - name: meta.embedded.expression.svelte source.ts, - patterns: [include: source.ts], - }, - } - # The commas. - - { match: ',', name: punctuation.separator.svelte } - - # Special void tags like `{:else}` and `{@html}`. - special-tags-void: - begin: ({)\s*((?:[@:])(else\s+if|[a-z]*)) - beginCaptures: - 1: { name: punctuation.definition.block.begin.svelte } - 2: { patterns: [include: '#special-tags-keywords'] } - end: \} - endCaptures: { 0: { name: punctuation.definition.block.end.svelte } } - name: meta.special.$3.svelte - patterns: [include: '#special-tags-modes'] - - # Special tag blocks like `{#if}...{/if}`. - # Split up into start and end because we don't need to preserve the name - # inside and because it makes whitespace matching logic more robust - special-tags-block-begin: - # This pattern is technically not correct, - # as the (#|:|/)[logic] keywords do not care about whitespace between it and the { bracket. - # This means newlines are actually valid! - # However, deciphering what is logic and what is interpolation would be stupidly tedious. So we don't. - begin: ({)\s*(#([a-z]*)) - end: (}) - name: meta.special.$3.svelte meta.special.start.svelte - beginCaptures: - 1: { name: punctuation.definition.block.begin.svelte } - 2: { patterns: [include: '#special-tags-keywords'] } - endCaptures: { 0: { name: punctuation.definition.block.end.svelte } } - patterns: [include: '#special-tags-modes'] - - special-tags-block-end: - # This is again technically not correct, and due to the same whitespacing reasons. - # However... just don't introduce newlines in `{/if}` blocks. 'cuz that's weird. - begin: ({)\s*(/([a-z]*)) - end: (}) - name: meta.special.$3.svelte meta.special.end.svelte - beginCaptures: - 1: { name: punctuation.definition.block.begin.svelte } - 2: { patterns: [include: '#special-tags-keywords'] } - endCaptures: - 1: { name: punctuation.definition.block.end.svelte } - - # ------------ - # ATTRIBUTES - - attributes: - patterns: - - include: '#attributes-directives' - - include: '#attributes-keyvalue' - - include: '#attributes-interpolated' - - # Interpolated shorthand attributes, like `{variable}` sitting by itself. - attributes-interpolated: - begin: (?) - patterns: - # No quotes - just an interpolation expression. - - include: '#interpolation' - # Units, meaning digit characters and an optional unit string. e.g. `15px` - - match: ([0-9._]+[\w]{,4})(?=\s|/?>) - name: constant.numeric.decimal.svelte - patterns: [include: '#interpolation'] - # Unquoted strings. - - match: ([^\s"'=<>`/]|/(?!>))+ - name: string.unquoted.svelte - patterns: [include: '#interpolation'] - # Quoted strings. - - begin: (['"]) - end: \1 - beginCaptures: - { 0: { name: punctuation.definition.string.begin.svelte } } - endCaptures: { 0: { name: punctuation.definition.string.end.svelte } } - name: string.quoted.svelte - patterns: [include: '#interpolation'] - - # For Svelte element directives. Scopes the 'on' part in `on:click`. - attributes-directives-keywords: - patterns: - # If other keywords are patched in in the future, they can be added here but also need to be added - # where attributes-directives-keywords is included. - - { match: on|use|bind, name: keyword.control.svelte } - - { - match: transition|in|out|animate, - name: keyword.other.animation.svelte, - } - - { match: let, name: storage.type.svelte } - - { match: class, name: entity.other.attribute-name.svelte } - - # For Svelte element directives. Scopes the 'click' part in `on:click`. - # The scope of the variable should represent what data type it generally is. - attributes-directives-types: - patterns: - # If other keywords are patched in in the future, they can easily be added here. - - { match: '(?<=(on):).*$', name: entity.name.type.svelte } - - { match: '(?<=(bind):).*$', name: variable.parameter.svelte } - - { - match: '(?<=(use|transition|in|out|animate):).*$', - name: variable.function.svelte, - } - - { match: '(?<=(let|class):).*$', name: variable.parameter.svelte } - - # For directives that may be better suited using different scopes if assigned to something. - # e.g. `class:var={var}` is different to `class:var`. - # In the latter, `var` is a variable identifier and not a CSS class name. - attributes-directives-types-assigned: - patterns: - # Special Cases - # Makes 'bind:this' display like `this` would in JS. - - { match: '(?<=(bind):)this$', name: variable.language.svelte } - # If other keywords are patched in in the future, they can easily be added here. - - { match: '(?<=(bind):).*$', name: entity.name.type.svelte } - - { - match: '(?<=(class):).*$', - name: entity.other.attribute-name.class.svelte, - } - # Defaults to the non-assignment version for everything else. - - include: '#attributes-directives-types' - - # Matches Svelte element directives, e.g. `on:click|preventDefault={var}` - attributes-directives: - # If something is added to attributes-directives-keywords, it must be added to the begin-regex, too. - begin: (?`. - tags-name: - patterns: - # Svelte (`svelte:`) elements. - - match: '(svelte)(:)([a-z][\w0-9:-]*)' - captures: - 1: { name: keyword.control.svelte } - 2: { name: punctuation.definition.keyword.svelte } - 3: { name: entity.name.tag.svelte } - # Slot. - - { match: 'slot', name: keyword.control.svelte } - # Components. - - { match: '[A-Z][a-zA-Z0-9_]*', name: support.class.component.svelte } - # Custom elements. (has a dash, but otherwise is a valid HTML element) - - { - match: '[a-z][\w0-9:]*-[\w0-9:-]*', - name: meta.tag.custom.svelte entity.name.tag.svelte, - } - # HTML elements. - - { match: '[a-z][\w0-9:-]*', name: entity.name.tag.svelte } - - # Attributes for tag start nodes. Meant to start immediately after the `) - name: meta.tag.start.svelte - patterns: [include: '#attributes'] - - # Same as tags-start-attributes but slightly adjusted for special script/style/template tags. - tags-lang-start-attributes: - begin: \G - end: (?=/>)|> - name: meta.tag.start.svelte - patterns: [include: '#attributes'] - - # Matches the beginning (`/]*) - captures: - 1: { name: punctuation.definition.tag.begin.svelte } - 2: { patterns: [include: '#tags-name'] } - name: meta.tag.start.svelte - - # Matches tag end nodes. - tags-end-node: - match: ()|(/>) - captures: - 1: { name: meta.tag.end.svelte punctuation.definition.tag.begin.svelte } - 2: { name: meta.tag.end.svelte, patterns: [include: '#tags-name'] } - 3: { name: meta.tag.end.svelte punctuation.definition.tag.end.svelte } - 4: { name: meta.tag.start.svelte punctuation.definition.tag.end.svelte } - - # -- TAG TYPES - - # Language tags - they are handled differently for the purposes of language injection. - tags-lang: - begin: <(script|style|template) - end: |/> - beginCaptures: { 0: { patterns: [include: '#tags-start-node'] } } - endCaptures: { 0: { patterns: [include: '#tags-end-node'] } } - name: meta.$1.svelte - patterns: - # Tags with a language specified. - - begin: \G(?=\s*(type|lang)\s*=\s*(['"]|)(?:text/)?(\w+)\2) - end: (?=) - name: meta.lang.$3.svelte - patterns: [include: '#tags-lang-start-attributes'] - # Fallback to default language. - - include: '#tags-lang-start-attributes' - - # Void element tags. They must be treated separately due to their lack of end nodes. - # A void element cannot be differentiated from other tags, unless you look at their name. - # This is because there is a specific list of void elements in HTML5. We use that to scope void elements. - # If we didn't, a void element would appear as an unclosed element to the grammar. - tags-void: - begin: (<)(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)(?=\s|/?>) - beginCaptures: - 1: { name: punctuation.definition.tag.begin.svelte } - 2: { name: entity.name.tag.svelte } - end: /?> - endCaptures: { 0: { name: punctuation.definition.tag.begin.svelte } } - name: meta.tag.void.svelte - patterns: [include: '#attributes'] - - # All other tags, including custom/special Svelte tags. - # Split up into start and end because we don't need to preserve the name - # inside and because it makes whitespace matching logic more robust - tags-general-start: - begin: (<)([^/\s>/]*) - end: (/?>) - beginCaptures: { 0: { patterns: [include: '#tags-start-node'] } } - endCaptures: - 1: { name: meta.tag.start.svelte punctuation.definition.tag.end.svelte } - name: meta.scope.tag.$2.svelte - patterns: - - include: '#tags-start-attributes' - - tags-general-end: - begin: (]*) - end: (>) - beginCaptures: - 1: { name: meta.tag.end.svelte punctuation.definition.tag.begin.svelte } - 2: { name: meta.tag.end.svelte, patterns: [include: '#tags-name'] } - endCaptures: - 1: { name: meta.tag.end.svelte punctuation.definition.tag.end.svelte } - name: meta.scope.tag.$2.svelte diff --git a/extensions/vetur-web/LICENSE b/extensions/vetur-web/LICENSE deleted file mode 100644 index 55b04badb..000000000 --- a/extensions/vetur-web/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Pine Wu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/extensions/vetur-web/README.md b/extensions/vetur-web/README.md deleted file mode 100644 index 1b4dc0e0d..000000000 --- a/extensions/vetur-web/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# This extension is a fork from [Vetur](https://github.com/vuejs/vetur) for github1s. - -# At present only languages features is reserved - -# I have deleted some files and only reserved the necessary code - -

-

Vetur

-

- -

- - - - - - - - - - - - -
-

-Vue tooling for VS Code. - -- [vls](./server): Vue Language Server -- [vti](./vti): Vetur Terminal Interface -- [Docs](https://vuejs.github.io/vetur) - -🎉 VueConf 2017 [Slide](https://www.dropbox.com/sh/eb4w8k3orh0j391/AAB3HaJexbGLa2tCP14BI8oJa?dl=0) & [Video](https://www.youtube.com/watch?v=05tNXJ-Kric) 🎉 - -## Sponsors - -I quit my job to travel nomadically, to work on Open Source and to conduct independent study/research. - -Vetur is my main focus in Open Source. Your help will alleviate my financial burden and allow me to spend more time working on Vetur. Thank you 🙏 - -https://github.com/sponsors/octref - -Thanks to the following companies for supporting Vetur's development: - - - - - - -
- - - - - Request and perform code reviews from inside your IDE. Review any code, even if it's a work-in-progress that hasn't been committed yet, and use jump-to-definition, your favorite keybindings, and other IDE tools. - Try it free. -
- -## Features - -- [Syntax-highlighting](https://vuejs.github.io/vetur/guide/highlighting.html) -- [Snippet](https://vuejs.github.io/vetur/guide/snippet.html) - -## FAQ - -[FAQ](https://vuejs.github.io/vetur/guide/FAQ.html) - -## License - -MIT © [Pine Wu](https://github.com/octref) diff --git a/extensions/vetur-web/ThirdPartyNotices.txt b/extensions/vetur-web/ThirdPartyNotices.txt deleted file mode 100644 index 9cfba4bb0..000000000 --- a/extensions/vetur-web/ThirdPartyNotices.txt +++ /dev/null @@ -1,88 +0,0 @@ -This project incorporates components from the projects listed below. -The original copyright notices and the licenses are reproduced verbatim. - -1. https://github.com/vuejs/vue-syntax-highlight - -=== - -The MIT License (MIT) - -Copyright (c) 2013-2016 Evan You - -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. - -=== - -2. https://github.com/microsoft/vscode - -=== - -MIT License - -Copyright (c) 2015 - present Microsoft Corporation - -All rights reserved. - -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. - -=== - -3. https://github.com/prettier/prettier-vscode - -=== - -MIT License - -Copyright (c) 2017 Esben Petersen - -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. - -=== \ No newline at end of file diff --git a/extensions/vetur-web/asset/vue.png b/extensions/vetur-web/asset/vue.png deleted file mode 100644 index 8bbf98415..000000000 Binary files a/extensions/vetur-web/asset/vue.png and /dev/null differ diff --git a/extensions/vetur-web/languages/vue-html-language-configuration.json b/extensions/vetur-web/languages/vue-html-language-configuration.json deleted file mode 100644 index 0debe3d20..000000000 --- a/extensions/vetur-web/languages/vue-html-language-configuration.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "comments": { - "blockComment": [ "" ] - }, - "brackets": [ - [""], - ["<", ">"], - ["{", "}"], - ["(", ")"] - ], - "autoClosingPairs": [ - { "open": "{", "close": "}"}, - { "open": "[", "close": "]"}, - { "open": "(", "close": ")" }, - { "open": "'", "close": "'" }, - { "open": "\"", "close": "\"" } - ], - "surroundingPairs": [ - { "open": "'", "close": "'" }, - { "open": "\"", "close": "\"" }, - { "open": "{", "close": "}"}, - { "open": "[", "close": "]"}, - { "open": "(", "close": ")" }, - { "open": "<", "close": ">" } - ] -} \ No newline at end of file diff --git a/extensions/vetur-web/languages/vue-language-configuration.json b/extensions/vetur-web/languages/vue-language-configuration.json deleted file mode 100644 index 9e28a8f3d..000000000 --- a/extensions/vetur-web/languages/vue-language-configuration.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "comments": { - // symbol used for single line comment. Remove this entry if your language does not support line comments - "lineComment": "//", - // symbols used for start and end a block comment. Remove this entry if your language does not support block comments - "blockComment": [ "/*", "*/" ] - }, - // symbols used as brackets - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - // symbols that are auto closed when typing - "autoClosingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "\"", "close": "\"", "notIn": ["string"] }, - { "open": "'", "close": "'", "notIn": ["string", "comment"] }, - { "open": "`", "close": "`", "notIn": ["string", "comment"] }, - { "open": "/**", "close": " */", "notIn": ["string"] } - ], - // symbols that that can be used to surround a selection - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"], - ["`", "`"] - ], - "folding": { - "markers": { - "start": "^<(template|style|script)[^>]*>", - "end": "^" - } - } -} diff --git a/extensions/vetur-web/languages/vue-postcss-language-configuration.json b/extensions/vetur-web/languages/vue-postcss-language-configuration.json deleted file mode 100644 index a573a064f..000000000 --- a/extensions/vetur-web/languages/vue-postcss-language-configuration.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "comments": { - // symbols used for start and end a block comment. Remove this entry if your language does not support block comments - "blockComment": [ "/*", "*/" ] - }, - // symbols used as brackets - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - // symbols that are auto closed when typing - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - // symbols that that can be used to surround a selection - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ] -} \ No newline at end of file diff --git a/extensions/vetur-web/languages/vue-pug-language-configuration.json b/extensions/vetur-web/languages/vue-pug-language-configuration.json deleted file mode 100644 index ab5cd8306..000000000 --- a/extensions/vetur-web/languages/vue-pug-language-configuration.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "comments": { - "lineComment": "//-" - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["'", "'"], - ["\"", "\""] - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["'", "'"], - ["\"", "\""] - ], - "folding": { - "offSide": true - } -} diff --git a/extensions/vetur-web/package.json b/extensions/vetur-web/package.json deleted file mode 100644 index 49ed8ad06..000000000 --- a/extensions/vetur-web/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "vetur", - "displayName": "Vetur", - "description": "Vue tooling for VS Code", - "author": "Pine Wu ", - "icon": "asset/vue.png", - "version": "0.32.0", - "publisher": "octref", - "scripts": { - "compile": "echo done", - "watch": "echo done" - }, - "repository": { - "type": "git", - "url": "https://github.com/vuejs/vetur.git" - }, - "keywords": [ - "vetur", - "Vue", - "vue", - "vuejs" - ], - "categories": [ - "Programming Languages" - ], - "engines": { - "vscode": "^1.52.0" - }, - "activationEvents": [ - "onLanguage:vue" - ], - "contributes": { - "languages": [ - { - "id": "vue", - "aliases": [ - "Vue", - "vue" - ], - "extensions": [ - ".vue" - ], - "configuration": "./languages/vue-language-configuration.json" - }, - { - "id": "vue-html", - "aliases": [ - "Vue-html" - ], - "configuration": "./languages/vue-html-language-configuration.json" - }, - { - "id": "vue-postcss", - "aliases": [ - "Vue-PostCSS", - "Vue-POSTCSS", - "vue-postcss" - ], - "configuration": "./languages/vue-postcss-language-configuration.json" - } - ], - "grammars": [ - { - "language": "vue", - "scopeName": "source.vue", - "path": "./syntaxes/vue-generated.json", - "embeddedLanguages": { - "text.html.basic": "html", - "text.html.vue-html": "vue-html", - "text.jade.slm": "slm", - "text.pug": "jade", - "text.haml": "haml", - "text.slim": "slim", - "text.html.liquid": "liquid", - "source.css": "css", - "source.css.scss": "scss", - "source.css.less": "less", - "source.css.postcss": "vue-postcss", - "source.sass": "sass", - "source.stylus": "stylus", - "source.js": "javascript", - "source.ts": "typescript", - "source.coffee": "coffeescript", - "text.html.markdown": "md", - "source.yaml": "yaml", - "source.json": "json", - "source.php": "php", - "source.graphql": "graphql" - } - }, - { - "language": "vue-postcss", - "scopeName": "source.css.postcss", - "path": "./syntaxes/vue-postcss.json" - }, - { - "language": "vue-html", - "scopeName": "text.html.vue-html", - "path": "./syntaxes/vue-html.tmLanguage.json", - "embeddedLanguages": { - "source.js": "javascript" - } - }, - { - "path": "./syntaxes/pug/directives.tmLanguage.json", - "scopeName": "vue.pug.directives", - "injectTo": [ - "source.vue" - ] - }, - { - "path": "./syntaxes/pug/interpolations.tmLanguage.json", - "scopeName": "vue.pug.interpolations", - "injectTo": [ - "source.vue" - ] - }, - { - "scopeName": "markdown.vue.codeblock", - "path": "./syntaxes/markdown-vue.json", - "injectTo": [ - "text.html.markdown" - ], - "embeddedLanguages": { - "meta.embedded.block.vue": "vue" - } - } - ] - } -} diff --git a/extensions/vetur-web/syntaxes/markdown-vue.json b/extensions/vetur-web/syntaxes/markdown-vue.json deleted file mode 100644 index 73cfcee84..000000000 --- a/extensions/vetur-web/syntaxes/markdown-vue.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "scopeName": "markdown.vue.codeblock", - "fileTypes": [], - "injectionSelector": "L:text.html.markdown", - "patterns": [ - { - "include": "#vue-code-block" - } - ], - "repository": { - "vue-code-block": { - "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(vue)(\\s+[^`~]*)?$)", - "name": "markup.fenced_code.block.markdown", - "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", - "beginCaptures": { - "3": { - "name": "punctuation.definition.markdown" - }, - "5": { - "name": "fenced_code.block.language" - }, - "6": { - "name": "fenced_code.block.language.attributes" - } - }, - "endCaptures": { - "3": { - "name": "punctuation.definition.markdown" - } - }, - "patterns": [ - { - "begin": "(^|\\G)(\\s*)(.*)", - "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", - "contentName": "meta.embedded.block.vue", - "patterns": [ - { - "include": "source.vue" - } - ] - } - ] - } - } -} diff --git a/extensions/vetur-web/syntaxes/pug/directives.YAML b/extensions/vetur-web/syntaxes/pug/directives.YAML deleted file mode 100644 index 88d9c239a..000000000 --- a/extensions/vetur-web/syntaxes/pug/directives.YAML +++ /dev/null @@ -1,5 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage -scopeName: vue.pug.directives -injectionSelector: "L:meta.tag.other -text.html.vue-html" -patterns: - - include: 'source.vue#vue-directives' diff --git a/extensions/vetur-web/syntaxes/pug/directives.tmLanguage.json b/extensions/vetur-web/syntaxes/pug/directives.tmLanguage.json deleted file mode 100644 index 009914421..000000000 --- a/extensions/vetur-web/syntaxes/pug/directives.tmLanguage.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "scopeName": "vue.pug.directives", - "injectionSelector": "L:meta.tag.other -text.html.vue-html", - "patterns": [ - { - "include": "source.vue#vue-directives" - } - ] -} \ No newline at end of file diff --git a/extensions/vetur-web/syntaxes/pug/interpolations.YAML b/extensions/vetur-web/syntaxes/pug/interpolations.YAML deleted file mode 100644 index c66035886..000000000 --- a/extensions/vetur-web/syntaxes/pug/interpolations.YAML +++ /dev/null @@ -1,5 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage -scopeName: vue.pug.interpolations -injectionSelector: "L:text.pug" -patterns: - - include: source.vue#vue-interpolations diff --git a/extensions/vetur-web/syntaxes/pug/interpolations.tmLanguage.json b/extensions/vetur-web/syntaxes/pug/interpolations.tmLanguage.json deleted file mode 100644 index 96d599681..000000000 --- a/extensions/vetur-web/syntaxes/pug/interpolations.tmLanguage.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "scopeName": "vue.pug.interpolations", - "injectionSelector": "L:text.pug", - "patterns": [ - { - "include": "source.vue#vue-interpolations" - } - ] -} \ No newline at end of file diff --git a/extensions/vetur-web/syntaxes/vue-generated.json b/extensions/vetur-web/syntaxes/vue-generated.json deleted file mode 100644 index d9f741374..000000000 --- a/extensions/vetur-web/syntaxes/vue-generated.json +++ /dev/null @@ -1,1242 +0,0 @@ -{ - "name": "Vue", - "scopeName": "source.vue", - "fileTypes": ["vue"], - "uuid": "5512c10d-4cc5-434c-b8fc-53b912f55ab3", - "patterns": [ - { - "begin": "(<)(slim)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "contentName": "text.slim", - "patterns": [ - { - "include": "text.slim" - } - ] - } - ] - }, - { - "begin": "(<)(i18n)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "contentName": "source.json", - "patterns": [ - { - "include": "source.json" - } - ] - } - ] - }, - { - "begin": "(<)(docs)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "contentName": "text.html.markdown", - "patterns": [ - { - "include": "text.html.markdown" - } - ] - } - ] - }, - { - "name": "comment.block.html", - "begin": "", - "captures": { - "0": { - "name": "punctuation.definition.comment.html" - } - } - }, - { - "begin": "(<)(?=template.*[^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - } - }, - "end": "(/>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "begin": "(template)", - "beginCaptures": { - "1": { - "name": "entity.name.tag.template.html" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "include": "#tag-stuff" - } - ] - } - ] - }, - { - "begin": "(<)(template)(?=[^>]*>[^/>]*)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)" - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('jade'|\"jade\"|'pug'|\"pug\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.pug", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.pug" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('haml'|\"haml\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.haml", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.haml" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('slim'|\"slim\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.slim", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.slim" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('slm'|\"slm\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.jade.slm", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.jade.slm" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('liquid'|\"liquid\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.html.liquid", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.html.liquid" - } - ] - } - ] - }, - { - "begin": "(<)(template)(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "^()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.html.vue-html", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=^)", - "patterns": [ - { - "include": "text.html.vue-html" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "(/>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "begin": "(<)(style)(?=[^>]*>[^/>]*)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)" - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('sass'|\"sass\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.sass", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.sass" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('scss'|\"scss\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css.scss", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css.scss" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('less'|\"less\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css.less", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css.less" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('stylus'|\"stylus\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.stylus", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.stylus" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('postcss'|\"postcss\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css.postcss", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css.postcss" - } - ] - } - ] - }, - { - "begin": "(<)(style)(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css" - } - ] - } - ] - }, - { - "begin": "(<)(script)\\b(?=[^>]*/>$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "(/>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "begin": "(<)(script)(?=[^>]*>[^/>]*)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)" - } - ] - }, - { - "begin": "(<)(script)\\b(?=[^>]*lang=('ts'|\"ts\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.ts", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.ts" - } - ] - } - ] - }, - { - "begin": "(<)(script)\\b(?=[^>]*lang=('coffee'|\"coffee\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.coffee", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.coffee" - } - ] - } - ] - }, - { - "begin": "(<)(script)(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.js", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.js" - } - ] - } - ] - } - ], - "repository": { - "entities": { - "patterns": [ - { - "name": "constant.character.entity.html", - "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { - "name": "punctuation.definition.entity.html" - }, - "3": { - "name": "punctuation.definition.entity.html" - } - } - }, - { - "name": "invalid.illegal.bad-ampersand.html", - "match": "&" - } - ] - }, - "string-double-quoted": { - "name": "string.quoted.double.html", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - "string-single-quoted": { - "name": "string.quoted.single.html", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - "tag-generic-attribute": { - "name": "entity.other.attribute-name.html", - "match": "\\b([a-zA-Z\\-:_]+)" - }, - "tag-id-attribute": { - "name": "meta.attribute-with-value.id.html", - "begin": "\\b(id)\\b\\s*(=)", - "end": "(?<='|\")", - "captures": { - "1": { - "name": "entity.other.attribute-name.id.html" - }, - "2": { - "name": "punctuation.separator.key-value.html" - } - }, - "patterns": [ - { - "name": "string.quoted.double.html", - "contentName": "meta.toc-list.id.html", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - { - "name": "string.quoted.single.html", - "contentName": "meta.toc-list.id.html", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - } - ] - }, - "tag-stuff": { - "patterns": [ - { - "include": "#vue-directives" - }, - { - "include": "#tag-id-attribute" - }, - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - } - ] - }, - "vue-directives": { - "name": "meta.directive.vue", - "begin": "(?:\\b(v-)|(:|@|#))([a-zA-Z0-9\\-_]+)(?:\\:([a-zA-Z\\-_]+))?(?:\\.([a-zA-Z\\-_]+))*\\s*(=)", - "end": "(?<='|\")|(?=[\\s<>`])", - "captures": { - "1": { - "name": "entity.other.attribute-name.html" - }, - "2": { - "name": "punctuation.separator.key-value.html" - }, - "3": { - "name": "entity.other.attribute-name.html" - }, - "4": { - "name": "entity.other.attribute-name.html" - }, - "5": { - "name": "entity.other.attribute-name.html" - }, - "6": { - "name": "punctuation.separator.key-value.html" - } - }, - "patterns": [ - { - "name": "source.directive.vue", - "begin": "`", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "`", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - }, - { - "name": "source.directive.vue", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - }, - { - "name": "source.directive.vue", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - } - ] - }, - "vue-interpolations": { - "patterns": [ - { - "name": "expression.embedded.vue", - "begin": "\\{\\{\\{?", - "beginCaptures": { - "0": { - "name": "punctuation.definition.generic.begin.html" - } - }, - "end": "\\}\\}\\}?", - "endCaptures": { - "0": { - "name": "punctuation.definition.generic.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - } - ] - } - } -} diff --git a/extensions/vetur-web/syntaxes/vue-html.YAML b/extensions/vetur-web/syntaxes/vue-html.YAML deleted file mode 100644 index eb85a08a1..000000000 --- a/extensions/vetur-web/syntaxes/vue-html.YAML +++ /dev/null @@ -1,259 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage -name: Vue HTML -scopeName: text.html.vue-html -fileTypes: [] -uuid: ca2e4260-5d62-45bf-8cf1-d8b5cc19c8f8 -patterns: - - include: source.vue#vue-interpolations - - name: meta.tag.any.html - begin: (<)([A-Z][a-zA-Z0-9:-]*)(?=[^>]*>) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: support.class.component.html } - end: (>)(<)(/)(\2)(>) - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - '2': - { - name: punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html, - } - '3': { name: punctuation.definition.tag.begin.html } - '4': { name: support.class.component.html } - '5': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.any.html - begin: (<)([a-z][a-zA-Z0-9:-]*)(?=[^>]*>) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.html } - end: (>)(<)(/)(\2)(>) - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - '2': - { - name: punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html, - } - '3': { name: punctuation.definition.tag.begin.html } - '4': { name: entity.name.tag.html } - '5': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.preprocessor.xml.html - begin: (<\?)(xml) - end: (\?>) - captures: - '1': { name: punctuation.definition.tag.html } - '2': { name: entity.name.tag.xml.html } - patterns: - - include: '#tag-generic-attribute' - - include: '#string-double-quoted' - - include: '#string-single-quoted' - - name: comment.block.html - begin: - captures: - '0': { name: punctuation.definition.comment.html } - - name: meta.tag.sgml.html - begin: ' - captures: - '0': { name: punctuation.definition.tag.html } - patterns: - - name: meta.tag.sgml.doctype.html - begin: (?i:DOCTYPE) - end: (?=>) - captures: - '1': { name: entity.name.tag.doctype.html } - patterns: - - name: string.quoted.double.doctype.identifiers-and-DTDs.html - match: '"[^">]*"' - - name: constant.other.inline-data.html - begin: \[CDATA\[ - end: ']](?=>)' - - name: invalid.illegal.bad-comments-or-CDATA.html - match: (\s*)(?!--|>)\S(\s*) - - name: meta.tag.block.any.html - begin: () - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.block.any.html - begin: () - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.structure.any.html - begin: () - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - captures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.structure.any.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.block.any.html - begin: () - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.inline.any.html - begin: () - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - name: meta.tag.other.html - begin: () - endCaptures: - '1': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - include: '#entities' - - name: invalid.illegal.incomplete.html - match: <> - - name: invalid.illegal.bad-angle-bracket.html - match: < -repository: - entities: - patterns: - - name: constant.character.entity.html - match: (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;) - captures: - '1': { name: punctuation.definition.entity.html } - '3': { name: punctuation.definition.entity.html } - - name: invalid.illegal.bad-ampersand.html - match: '&' - string-double-quoted: - name: string.quoted.double.html - begin: '"' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '"' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.vue#vue-interpolations - - include: '#entities' - string-single-quoted: - name: string.quoted.single.html - begin: "'" - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: "'" - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.vue#vue-interpolations - - include: '#entities' - tag-generic-attribute: - name: entity.other.attribute-name.html - match: (?<=[^=])\b([a-zA-Z0-9:\-_]+) - tag-id-attribute: - name: meta.attribute-with-value.id.html - begin: \b(id)\b\s*(=) - end: (?!\G)(?<='|"|[^\s<>/]) - captures: - '1': { name: entity.other.attribute-name.id.html } - '2': { name: punctuation.separator.key-value.html } - patterns: - - name: string.quoted.double.html - contentName: meta.toc-list.id.html - begin: '"' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '"' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.vue#vue-interpolations - - include: '#entities' - - name: string.quoted.single.html - contentName: meta.toc-list.id.html - begin: "'" - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: "'" - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.vue#vue-interpolations - - include: '#entities' - - name: string.unquoted.html - match: (?<==)(?:[^\s<>/'"]|/(?!>))+ - captures: - '0': { name: meta.toc-list.id.html } - tag-stuff: - patterns: - - include: '#vue-directives' - - include: '#tag-id-attribute' - - include: '#tag-generic-attribute' - - include: '#string-double-quoted' - - include: '#string-single-quoted' - - include: '#unquoted-attribute' - unquoted-attribute: - name: string.unquoted.html - match: (?<==)(?:[^\s<>/'"]|/(?!>))+ - vue-directives: - name: meta.directive.vue - begin: (?:\b(v-)|(:|@|#))([a-zA-Z0-9\-_]+)(?:\:([a-zA-Z\-_]+))?(?:\.([a-zA-Z\-_]+))*\s*(=) - end: (?<='|")|(?=[\s<>`]) - captures: - '1': { name: entity.other.attribute-name.html } - '2': { name: punctuation.separator.key-value.html } - '3': { name: entity.other.attribute-name.html } - '4': { name: entity.other.attribute-name.html } - '5': { name: entity.other.attribute-name.html } - '6': { name: punctuation.separator.key-value.html } - patterns: - - name: source.directive.vue - begin: '`' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '`' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.js#expression - - name: source.directive.vue - begin: '"' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '"' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.js#expression - - name: source.directive.vue - begin: "'" - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: "'" - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.js#expression diff --git a/extensions/vetur-web/syntaxes/vue-html.tmLanguage.json b/extensions/vetur-web/syntaxes/vue-html.tmLanguage.json deleted file mode 100644 index 0e48bbfcf..000000000 --- a/extensions/vetur-web/syntaxes/vue-html.tmLanguage.json +++ /dev/null @@ -1,558 +0,0 @@ -{ - "name": "Vue HTML", - "scopeName": "text.html.vue-html", - "fileTypes": [], - "uuid": "ca2e4260-5d62-45bf-8cf1-d8b5cc19c8f8", - "patterns": [ - { - "include": "source.vue#vue-interpolations" - }, - { - "name": "meta.tag.any.html", - "begin": "(<)([A-Z][a-zA-Z0-9:-]*)(?=[^>]*>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "support.class.component.html" - } - }, - "end": "(>)(<)(/)(\\2)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - }, - "2": { - "name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" - }, - "3": { - "name": "punctuation.definition.tag.begin.html" - }, - "4": { - "name": "support.class.component.html" - }, - "5": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.any.html", - "begin": "(<)([a-z][a-zA-Z0-9:-]*)(?=[^>]*>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - } - }, - "end": "(>)(<)(/)(\\2)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - }, - "2": { - "name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" - }, - "3": { - "name": "punctuation.definition.tag.begin.html" - }, - "4": { - "name": "entity.name.tag.html" - }, - "5": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.preprocessor.xml.html", - "begin": "(<\\?)(xml)", - "end": "(\\?>)", - "captures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.xml.html" - } - }, - "patterns": [ - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - } - ] - }, - { - "name": "comment.block.html", - "begin": "", - "captures": { - "0": { - "name": "punctuation.definition.comment.html" - } - } - }, - { - "name": "meta.tag.sgml.html", - "begin": "", - "captures": { - "0": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "name": "meta.tag.sgml.doctype.html", - "begin": "(?i:DOCTYPE)", - "end": "(?=>)", - "captures": { - "1": { - "name": "entity.name.tag.doctype.html" - } - }, - "patterns": [ - { - "name": "string.quoted.double.doctype.identifiers-and-DTDs.html", - "match": "\"[^\">]*\"" - } - ] - }, - { - "name": "constant.other.inline-data.html", - "begin": "\\[CDATA\\[", - "end": "]](?=>)" - }, - { - "name": "invalid.illegal.bad-comments-or-CDATA.html", - "match": "(\\s*)(?!--|>)\\S(\\s*)" - } - ] - }, - { - "name": "meta.tag.block.any.html", - "begin": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.block.any.html", - "begin": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.structure.any.html", - "begin": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "captures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.structure.any.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.block.any.html", - "begin": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.inline.any.html", - "begin": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "name": "meta.tag.other.html", - "begin": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "include": "#entities" - }, - { - "name": "invalid.illegal.incomplete.html", - "match": "<>" - }, - { - "name": "invalid.illegal.bad-angle-bracket.html", - "match": "<" - } - ], - "repository": { - "entities": { - "patterns": [ - { - "name": "constant.character.entity.html", - "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { - "name": "punctuation.definition.entity.html" - }, - "3": { - "name": "punctuation.definition.entity.html" - } - } - }, - { - "name": "invalid.illegal.bad-ampersand.html", - "match": "&" - } - ] - }, - "string-double-quoted": { - "name": "string.quoted.double.html", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.vue#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - "string-single-quoted": { - "name": "string.quoted.single.html", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.vue#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - "tag-generic-attribute": { - "name": "entity.other.attribute-name.html", - "match": "(?<=[^=])\\b([a-zA-Z0-9:\\-_]+)" - }, - "tag-id-attribute": { - "name": "meta.attribute-with-value.id.html", - "begin": "\\b(id)\\b\\s*(=)", - "end": "(?!\\G)(?<='|\"|[^\\s<>/])", - "captures": { - "1": { - "name": "entity.other.attribute-name.id.html" - }, - "2": { - "name": "punctuation.separator.key-value.html" - } - }, - "patterns": [ - { - "name": "string.quoted.double.html", - "contentName": "meta.toc-list.id.html", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.vue#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - { - "name": "string.quoted.single.html", - "contentName": "meta.toc-list.id.html", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.vue#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - { - "name": "string.unquoted.html", - "match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+", - "captures": { - "0": { - "name": "meta.toc-list.id.html" - } - } - } - ] - }, - "tag-stuff": { - "patterns": [ - { - "include": "#vue-directives" - }, - { - "include": "#tag-id-attribute" - }, - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - }, - { - "include": "#unquoted-attribute" - } - ] - }, - "unquoted-attribute": { - "name": "string.unquoted.html", - "match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+" - }, - "vue-directives": { - "name": "meta.directive.vue", - "begin": "(?:\\b(v-)|(:|@|#))([a-zA-Z0-9\\-_]+)(?:\\:([a-zA-Z\\-_]+))?(?:\\.([a-zA-Z\\-_]+))*\\s*(=)", - "end": "(?<='|\")|(?=[\\s<>`])", - "captures": { - "1": { - "name": "entity.other.attribute-name.html" - }, - "2": { - "name": "punctuation.separator.key-value.html" - }, - "3": { - "name": "entity.other.attribute-name.html" - }, - "4": { - "name": "entity.other.attribute-name.html" - }, - "5": { - "name": "entity.other.attribute-name.html" - }, - "6": { - "name": "punctuation.separator.key-value.html" - } - }, - "patterns": [ - { - "name": "source.directive.vue", - "begin": "`", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "`", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - }, - { - "name": "source.directive.vue", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - }, - { - "name": "source.directive.vue", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - } - ] - } - } -} diff --git a/extensions/vetur-web/syntaxes/vue-postcss.json b/extensions/vetur-web/syntaxes/vue-postcss.json deleted file mode 100644 index 4295f5047..000000000 --- a/extensions/vetur-web/syntaxes/vue-postcss.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "patterns": [ - { - "patterns": [ - { - "include": "#comment-tag" - } - ], - "begin": "/\\*", - "name": "comment.block.postcss", - "end": "\\*/" - }, - { - "include": "#double-slash" - }, - { - "include": "#double-quoted" - }, - { - "include": "#single-quoted" - }, - { - "include": "#interpolation" - }, - { - "include": "#placeholder-selector" - }, - { - "include": "#variable" - }, - { - "include": "#variable-root-css" - }, - { - "include": "#numeric" - }, - { - "include": "#unit" - }, - { - "include": "#flag" - }, - { - "include": "#dotdotdot" - }, - { - "captures": { - "0": { - "name": "keyword.control.at-rule.css.postcss" - } - }, - "begin": "@include", - "name": "support.function.name.postcss.library", - "end": "(?=\\n|\\(|{|;)" - }, - { - "captures": { - "0": { - "name": "keyword.control.at-rule.css.postcss" - } - }, - "patterns": [ - { - "name": "entity.name.function", - "match": "[\\w-]+" - } - ], - "begin": "@mixin|@function", - "name": "support.function.name.postcss.no-completions", - "end": "$\\n?|(?=\\(|{)" - }, - { - "name": "string.quoted.double.css.postcss", - "match": "(?<=@import)\\s[\\w/.*-]+" - }, - { - "begin": "@", - "name": "keyword.control.at-rule.css.postcss", - "end": "$\\n?|\\s(?!(all|braille|embossed|handheld|print|projection|screen|speech|tty|tv|if|only|not)(\\s|,))|(?=;)" - }, - { - "patterns": [ - { - "include": "#interpolation" - }, - { - "include": "#pseudo-class" - } - ], - "begin": "#", - "name": "entity.other.attribute-name.id.css.postcss", - "end": "$\\n?|(?=\\s|,|;|\\(|\\)|\\.|\\[|{|>)" - }, - { - "patterns": [ - { - "include": "#interpolation" - }, - { - "include": "#pseudo-class" - } - ], - "begin": "\\.|(?<=&)(-|_)", - "name": "entity.other.attribute-name.class.css.postcss", - "end": "$\\n?|(?=\\s|,|;|\\(|\\)|\\[|{|>)" - }, - { - "patterns": [ - { - "include": "#double-quoted" - }, - { - "include": "#single-quoted" - }, - { - "name": "keyword.other.regex.postcss", - "match": "\\^|\\$|\\*|~" - } - ], - "begin": "\\[", - "name": "entity.other.attribute-selector.postcss", - "end": "\\]" - }, - { - "name": "entity.other.attribute-name.pseudo-class.css.postcss", - "match": "(?<=\\]|\\)|not\\(|\\*|>|>\\s):[a-z:-]+|(::|:-)[a-z:-]+" - }, - { - "patterns": [ - { - "include": "#double-slash" - }, - { - "include": "#double-quoted" - }, - { - "include": "#single-quoted" - }, - { - "include": "#interpolation" - }, - { - "include": "#variable" - }, - { - "include": "#rgb-value" - }, - { - "include": "#numeric" - }, - { - "include": "#unit" - }, - { - "include": "#flag" - }, - { - "include": "#function" - }, - { - "include": "#function-content" - }, - { - "include": "#function-content-var" - }, - { - "include": "#operator" - }, - { - "include": "#parent-selector" - }, - { - "include": "#property-value" - } - ], - "begin": ":", - "name": "meta.property-list.css.postcss", - "end": "$\\n?|(?=;|\\s\\(|and\\(|{|}|\\),)" - }, - { - "include": "#rgb-value" - }, - { - "include": "#function" - }, - { - "include": "#function-content" - }, - { - "patterns": [ - { - "include": "#interpolation" - }, - { - "include": "#pseudo-class" - } - ], - "begin": "(?|-|_)" - }, - { - "include": "#operator" - }, - { - "name": "support.type.property-name.css.postcss", - "match": "[a-z-]+((?=:|#{))" - }, - { - "include": "#reserved-words" - }, - { - "include": "#property-value" - } - ], - "name": "PostCSS", - "repository": { - "reserved-words": { - "name": "support.type.property-name.css.postcss", - "match": "\\b(false|from|in|not|null|through|to|true)\\b" - }, - "double-quoted": { - "patterns": [ - { - "include": "#quoted-interpolation" - } - ], - "begin": "\"", - "name": "string.quoted.double.css.postcss", - "end": "\"" - }, - "operator": { - "name": "keyword.operator.postcss", - "match": "\\+|\\s-\\s|\\s-(?=\\$)|(?<=\\()-(?=\\$)|\\s-(?=\\()|\\*|/|%|=|!|<|>|~" - }, - "function-content": { - "name": "string.quoted.double.css.postcss", - "match": "(?<=url\\(|format\\(|attr\\().+?(?=\\))" - }, - "double-slash": { - "patterns": [ - { - "include": "#comment-tag" - } - ], - "begin": "//", - "name": "comment.line.postcss", - "end": "$" - }, - "numeric": { - "name": "constant.numeric.css.postcss", - "match": "(-|\\.)?[0-9]+(\\.[0-9]+)?" - }, - "variable-root-css": { - "name": "variable.parameter.postcss", - "match": "(?", - "captures": { - "0": { - "name": "punctuation.definition.comment.html" - } - } - }, - { - "begin": "(<)(?=template.*[^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - } - }, - "end": "(/>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "begin": "(template)", - "beginCaptures": { - "1": { - "name": "entity.name.tag.template.html" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "include": "#tag-stuff" - } - ] - } - ] - }, - { - "begin": "(<)(template)(?=[^>]*>[^/>]*)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)" - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('jade'|\"jade\"|'pug'|\"pug\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.pug", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.pug" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('haml'|\"haml\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.haml", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.haml" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('slim'|\"slim\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.slim", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.slim" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('slm'|\"slm\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.jade.slm", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.jade.slm" - } - ] - } - ] - }, - { - "begin": "(<)(template)\\b(?=[^>]*lang=('liquid'|\"liquid\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.html.liquid", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "text.html.liquid" - } - ] - } - ] - }, - { - "begin": "(<)(template)(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - } - }, - "end": "^()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.template.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "text.html.vue-html", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=^)", - "patterns": [ - { - "include": "text.html.vue-html" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "(/>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "begin": "(<)(style)(?=[^>]*>[^/>]*)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)" - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('sass'|\"sass\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.sass", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.sass" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('scss'|\"scss\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css.scss", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css.scss" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('less'|\"less\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css.less", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css.less" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('stylus'|\"stylus\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.stylus", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.stylus" - } - ] - } - ] - }, - { - "begin": "(<)(style)\\b(?=[^>]*lang=('postcss'|\"postcss\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css.postcss", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css.postcss" - } - ] - } - ] - }, - { - "begin": "(<)(style)(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.style.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.css", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.css" - } - ] - } - ] - }, - { - "begin": "(<)(script)\\b(?=[^>]*/>$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "(/>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "begin": "(<)(script)(?=[^>]*>[^/>]*)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)" - } - ] - }, - { - "begin": "(<)(script)\\b(?=[^>]*lang=('ts'|\"ts\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.ts", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.ts" - } - ] - } - ] - }, - { - "begin": "(<)(script)\\b(?=[^>]*lang=('coffee'|\"coffee\"))(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.coffee", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.coffee" - } - ] - } - ] - }, - { - "begin": "(<)(script)(?![^/>]*/>\\s*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.script.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - }, - { - "contentName": "source.js", - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(?=)", - "patterns": [ - { - "include": "source.js" - } - ] - } - ] - } - ], - "repository": { - "entities": { - "patterns": [ - { - "name": "constant.character.entity.html", - "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { - "name": "punctuation.definition.entity.html" - }, - "3": { - "name": "punctuation.definition.entity.html" - } - } - }, - { - "name": "invalid.illegal.bad-ampersand.html", - "match": "&" - } - ] - }, - "string-double-quoted": { - "name": "string.quoted.double.html", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - "string-single-quoted": { - "name": "string.quoted.single.html", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - "tag-generic-attribute": { - "name": "entity.other.attribute-name.html", - "match": "\\b([a-zA-Z\\-:_]+)" - }, - "tag-id-attribute": { - "name": "meta.attribute-with-value.id.html", - "begin": "\\b(id)\\b\\s*(=)", - "end": "(?<='|\")", - "captures": { - "1": { - "name": "entity.other.attribute-name.id.html" - }, - "2": { - "name": "punctuation.separator.key-value.html" - } - }, - "patterns": [ - { - "name": "string.quoted.double.html", - "contentName": "meta.toc-list.id.html", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - }, - { - "name": "string.quoted.single.html", - "contentName": "meta.toc-list.id.html", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ] - } - ] - }, - "tag-stuff": { - "patterns": [ - { - "include": "#vue-directives" - }, - { - "include": "#tag-id-attribute" - }, - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - } - ] - }, - "vue-directives": { - "name": "meta.directive.vue", - "begin": "(?:\\b(v-)|(:|@|#))([a-zA-Z0-9\\-_]+)(?:\\:([a-zA-Z\\-_]+))?(?:\\.([a-zA-Z\\-_]+))*\\s*(=)", - "end": "(?<='|\")|(?=[\\s<>`])", - "captures": { - "1": { - "name": "entity.other.attribute-name.html" - }, - "2": { - "name": "punctuation.separator.key-value.html" - }, - "3": { - "name": "entity.other.attribute-name.html" - }, - "4": { - "name": "entity.other.attribute-name.html" - }, - "5": { - "name": "entity.other.attribute-name.html" - }, - "6": { - "name": "punctuation.separator.key-value.html" - } - }, - "patterns": [ - { - "name": "source.directive.vue", - "begin": "`", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "`", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - }, - { - "name": "source.directive.vue", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - }, - { - "name": "source.directive.vue", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - } - ] - }, - "vue-interpolations": { - "patterns": [ - { - "name": "expression.embedded.vue", - "begin": "\\{\\{\\{?", - "beginCaptures": { - "0": { - "name": "punctuation.definition.generic.begin.html" - } - }, - "end": "\\}\\}\\}?", - "endCaptures": { - "0": { - "name": "punctuation.definition.generic.end.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ] - } - ] - } - } -} diff --git a/extensions/vetur-web/syntaxes/vue.yaml b/extensions/vetur-web/syntaxes/vue.yaml deleted file mode 100644 index 417d75e82..000000000 --- a/extensions/vetur-web/syntaxes/vue.yaml +++ /dev/null @@ -1,528 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage -name: Vue -scopeName: source.vue -fileTypes: [vue] -uuid: 5512c10d-4cc5-434c-b8fc-53b912f55ab3 -patterns: - # comment - - name: comment.block.html - begin: - captures: - '0': { name: punctuation.definition.comment.html } - - # template - single line - # ) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - - # jade / pug - - begin: (<)(template)\b(?=[^>]*lang=('jade'|"jade"|'pug'|"pug"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: text.pug - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: text.pug - - # haml - - begin: (<)(template)\b(?=[^>]*lang=('haml'|"haml"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: text.haml - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: text.haml - - # slim - - begin: (<)(template)\b(?=[^>]*lang=('slim'|"slim"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: text.slim - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: text.slim - - # slm - - begin: (<)(template)\b(?=[^>]*lang=('slm'|"slm"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: text.jade.slm - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: text.jade.slm - - # liquid - - begin: (<)(template)\b(?=[^>]*lang=('liquid'|"liquid"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: text.html.liquid - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: text.html.liquid - - # html - - begin: (<)(template)(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - end: ^() - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.template.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: text.html.vue-html - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=^) - patterns: - - include: text.html.vue-html - - # style - single line - # - - begin: (<)(style)(?=[^>]*>[^/>]*) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - - # sass / scss - - begin: (<)(style)\b(?=[^>]*lang=('sass'|"sass"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.sass - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.sass - - begin: (<)(style)\b(?=[^>]*lang=('scss'|"scss"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.css.scss - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.css.scss - - # less - - begin: (<)(style)\b(?=[^>]*lang=('less'|"less"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.css.less - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.css.less - - # stylus - - begin: (<)(style)\b(?=[^>]*lang=('stylus'|"stylus"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.stylus - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.stylus - - # postcss - - begin: (<)(style)\b(?=[^>]*lang=('postcss'|"postcss"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.css.postcss - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.css.postcss - - # css - - begin: (<)(style)(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.style.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.css - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.css - - # script - single line - # - - begin: (<)(script)(?=[^>]*>[^/>]*) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - - # ts - - begin: (<)(script)\b(?=[^>]*lang=('ts'|"ts"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.ts - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.ts - - # coffee - - begin: (<)(script)\b(?=[^>]*lang=('coffee'|"coffee"))(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.coffee - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.coffee - - # js - - begin: (<)(script)(?![^/>]*/>\s*$) - beginCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - end: () - endCaptures: - '1': { name: punctuation.definition.tag.begin.html } - '2': { name: entity.name.tag.script.html } - '3': { name: punctuation.definition.tag.end.html } - patterns: - - include: '#tag-stuff' - - contentName: source.js - begin: (>) - beginCaptures: - '1': { name: punctuation.definition.tag.end.html } - end: (?=) - patterns: - - include: source.js - -# Repository -repository: - entities: - patterns: - - name: constant.character.entity.html - match: (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;) - captures: - '1': { name: punctuation.definition.entity.html } - '3': { name: punctuation.definition.entity.html } - - name: invalid.illegal.bad-ampersand.html - match: '&' - string-double-quoted: - name: string.quoted.double.html - begin: '"' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '"' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: '#vue-interpolations' - - include: '#entities' - string-single-quoted: - name: string.quoted.single.html - begin: "'" - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: "'" - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: '#vue-interpolations' - - include: '#entities' - tag-generic-attribute: - name: entity.other.attribute-name.html - match: \b([a-zA-Z\-:_]+) - tag-id-attribute: - name: meta.attribute-with-value.id.html - begin: \b(id)\b\s*(=) - end: (?<='|") - captures: - '1': { name: entity.other.attribute-name.id.html } - '2': { name: punctuation.separator.key-value.html } - patterns: - - name: string.quoted.double.html - contentName: meta.toc-list.id.html - begin: '"' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '"' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: '#vue-interpolations' - - include: '#entities' - - name: string.quoted.single.html - contentName: meta.toc-list.id.html - begin: "'" - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: "'" - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: '#vue-interpolations' - - include: '#entities' - tag-stuff: - patterns: - - include: '#vue-directives' - - include: '#tag-id-attribute' - - include: '#tag-generic-attribute' - - include: '#string-double-quoted' - - include: '#string-single-quoted' - vue-directives: - name: meta.directive.vue - begin: (?:\b(v-)|(:|@|#))([a-zA-Z0-9\-_]+)(?:\:([a-zA-Z\-_]+))?(?:\.([a-zA-Z\-_]+))*\s*(=) - end: (?<='|")|(?=[\s<>`]) - captures: - '1': { name: entity.other.attribute-name.html } - '2': { name: punctuation.separator.key-value.html } - '3': { name: entity.other.attribute-name.html } - '4': { name: entity.other.attribute-name.html } - '5': { name: entity.other.attribute-name.html } - '6': { name: punctuation.separator.key-value.html } - patterns: - - name: source.directive.vue - begin: '`' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '`' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.js#expression - - name: source.directive.vue - begin: '"' - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: '"' - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.js#expression - - name: source.directive.vue - begin: "'" - beginCaptures: - '0': { name: punctuation.definition.string.begin.html } - end: "'" - endCaptures: - '0': { name: punctuation.definition.string.end.html } - patterns: - - include: source.js#expression - vue-interpolations: - patterns: - - name: expression.embedded.vue - begin: \{\{\{? - beginCaptures: - '0': { name: punctuation.definition.generic.begin.html } - end: \}\}\}? - endCaptures: - '0': { name: punctuation.definition.generic.end.html } - patterns: - - include: source.js#expression diff --git a/package.json b/package.json index e7d538cc2..572575419 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lib": "lib" }, "devDependencies": { - "@github1s/vscode-web": "0.1.10", + "@github1s/vscode-web": "0.2.1", "@typescript-eslint/eslint-plugin": "^4.15.0", "@typescript-eslint/parser": "^4.15.0", "chokidar": "^3.5.1", diff --git a/resources/index-dev-vscode.html b/resources/index-dev-vscode.html index 7ad7e99ba..fe90d7e7e 100644 --- a/resources/index-dev-vscode.html +++ b/resources/index-dev-vscode.html @@ -28,14 +28,14 @@

You need to enable JavaScript to run this app.

self.require = { baseUrl: `${window.location.origin}/static/vscode`, recordStats: true, - trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', { + trustedTypesPolicy: window.trustedTypes ? window.trustedTypes.createPolicy('amdLoader', { createScriptURL(value) { if (value.startsWith(window.location.origin)) { return value; } throw new Error(`Invalid script url: ${value}`); }, - }), + }) : undefined, paths: { 'vscode-textmate': `${window.location.origin}/static/node_modules/vscode-textmate/release/main`, 'vscode-oniguruma': `${window.location.origin}/static/node_modules/vscode-oniguruma/release/main`, diff --git a/resources/index-hash.html b/resources/index-hash.html index 8bbeb9ebb..ebbf3f167 100644 --- a/resources/index-hash.html +++ b/resources/index-hash.html @@ -138,14 +138,14 @@

You need to enable JavaScript to run this app.

self.require = { baseUrl: `${window.location.origin}/static/{STATIC_HASH_CODE}/vscode`, recordStats: true, - trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', { + trustedTypesPolicy: window.trustedTypes ? window.trustedTypes.createPolicy('amdLoader', { createScriptURL(value) { if (value.startsWith(window.location.origin)) { return value; } throw new Error(`Invalid script url: ${value}`); }, - }), + }) : undefined, paths: { 'vscode-textmate': `${window.location.origin}/static/{STATIC_HASH_CODE}/node_modules/vscode-textmate/release/main`, 'vscode-oniguruma': `${window.location.origin}/static/{STATIC_HASH_CODE}/node_modules/vscode-oniguruma/release/main`, diff --git a/resources/index.html b/resources/index.html index 253867c73..9db371623 100644 --- a/resources/index.html +++ b/resources/index.html @@ -138,14 +138,14 @@

You need to enable JavaScript to run this app.

self.require = { baseUrl: `${window.location.origin}/static/vscode`, recordStats: true, - trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', { + trustedTypesPolicy: window.trustedTypes ? window.trustedTypes.createPolicy('amdLoader', { createScriptURL(value) { if (value.startsWith(window.location.origin)) { return value; } throw new Error(`Invalid script url: ${value}`); }, - }), + }) : undefined, paths: { 'vscode-textmate': `${window.location.origin}/static/node_modules/vscode-textmate/release/main`, 'vscode-oniguruma': `${window.location.origin}/static/node_modules/vscode-oniguruma/release/main`, diff --git a/scripts/serve-dist.js b/scripts/serve-dist.js index d5d8a5c2e..1bb1982d0 100755 --- a/scripts/serve-dist.js +++ b/scripts/serve-dist.js @@ -12,7 +12,7 @@ const options = { public: path.join(APP_ROOT, 'dist'), cleanUrls: false }; // now sourcegraph graphql api is refused the CORS check // just proxy the request to sourcegraph directly for a taste -const proxy = httpProxy.createProxyServer({ +const sourcegraphProxy = httpProxy.createProxyServer({ target: 'https://sourcegraph.com/.api/graphql', ignorePath: true, changeOrigin: false, @@ -21,14 +21,32 @@ const proxy = httpProxy.createProxyServer({ }, }); +const handleProxyError = (error) => { + res.writeHead(500, { + 'Content-Type': 'application/json', + }); + res.end(JSON.stringify({ message: error.message })); +}; + const sourcegraphProxyHandler = (req, res) => { - proxy.web(req, res); - proxy.on('error', (e) => { - res.writeHead(500, { - 'Content-Type': 'application/json', - }); - res.end(JSON.stringify({ message: e.message })); + sourcegraphProxy.web(req, res); + sourcegraphProxy.on('error', handleProxyError); +}; + +// proxy the request to vscode-unpkg.net +const vscodeUnpkgProxyHandler = (req, res, vscodeUnpkgMatches) => { + const publisher = vscodeUnpkgMatches[1]; + const restPartsPath = vscodeUnpkgMatches[2]; + const host = `${publisher}.vscode-unpkg.net`; + const proxy = httpProxy.createServer({ + target: `https://${host}/${publisher}/${restPartsPath}`, + ignorePath: true, + changeOrigin: false, + headers: { host }, }); + + proxy.web(req, res); + proxy.on('error', handleProxyError); }; const server = http.createServer((request, response) => { @@ -36,6 +54,13 @@ const server = http.createServer((request, response) => { if (urlObj.pathname.startsWith('/api/sourcegraph')) { return sourcegraphProxyHandler(request, response); } + + // prettier-ignore + const vscodeUnpkgMatches = urlObj.pathname.match(/^\/api\/vscode-unpkg\/([^/]+)\/(.*)/); + if (vscodeUnpkgMatches) { + return vscodeUnpkgProxyHandler(request, response, vscodeUnpkgMatches); + } + return fs.access( path.join(APP_ROOT, 'dist', urlObj.pathname), fs.constants.F_OK, diff --git a/tests/__tests__/__image_snapshots__/index-test-ts-should-load-successfully-1-snap.png b/tests/__tests__/__image_snapshots__/index-test-ts-should-load-successfully-1-snap.png index 502a07ed3..f95bbb598 100644 Binary files a/tests/__tests__/__image_snapshots__/index-test-ts-should-load-successfully-1-snap.png and b/tests/__tests__/__image_snapshots__/index-test-ts-should-load-successfully-1-snap.png differ diff --git a/tests/__tests__/__image_snapshots__/index-test-ts-should-open-file-correctly-1-snap.png b/tests/__tests__/__image_snapshots__/index-test-ts-should-open-file-correctly-1-snap.png index 31f801552..4180dc804 100644 Binary files a/tests/__tests__/__image_snapshots__/index-test-ts-should-open-file-correctly-1-snap.png and b/tests/__tests__/__image_snapshots__/index-test-ts-should-open-file-correctly-1-snap.png differ diff --git a/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-1-snap.png b/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-1-snap.png index 93b288274..3996fe0f2 100644 Binary files a/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-1-snap.png and b/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-1-snap.png differ diff --git a/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-2-snap.png b/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-2-snap.png index ae850c471..5462cf0e5 100644 Binary files a/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-2-snap.png and b/tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-2-snap.png differ diff --git a/tests/__tests__/index.test.ts b/tests/__tests__/index.test.ts index 373dbb0ac..393524713 100644 --- a/tests/__tests__/index.test.ts +++ b/tests/__tests__/index.test.ts @@ -4,6 +4,7 @@ import { MatchImageSnapshotOptions, } from 'jest-image-snapshot'; +jest.setTimeout(60000); expect.extend({ toMatchImageSnapshot }); const matchImageSnapshotOptions: MatchImageSnapshotOptions = { @@ -27,6 +28,19 @@ afterAll(async () => { beforeEach(async () => { page = await browser.newPage(); + // setup github oauth token + await page.goto(BASE_URL); + await page.click('.action-item .action-label[aria-label="GitHub1s"]'); + await page.waitForTimeout(3000); + const extensionIFrameHandle = await page.$( + '#webview-webviewview-github1s-views-settings iframe' + ); + const extensionIFrame = await extensionIFrameHandle?.contentFrame(); + const settingsIframeHandle = await extensionIFrame?.$('iframe#active-frame'); + const settingsIframe = await settingsIframeHandle?.contentFrame(); + await settingsIframe?.fill('#token-input', process.env.GITHUB_TOKEN || ''); + await settingsIframe?.dispatchEvent('#save-button', 'click'); + await page.waitForTimeout(3000); }); afterEach(async () => { @@ -50,7 +64,7 @@ it('should load successfully', async () => { (el) => el.innerHTML ); const tab = await page.$eval( - 'div[role="tab"]', + 'div[role="tab"] .label-name', (el: HTMLElement) => el.innerText ); expect(tab).toBe('[Preview] README.md'); @@ -91,15 +105,13 @@ it('should show PR list', async () => { await page.press('body', ' '); await page.press('body', 'Shift+Tab'); await page.press('body', ' '); - await page.waitForSelector('#list_id_3_1'); - await page.waitForSelector('#list_id_4_1'); + await page.waitForTimeout(3000); const container = await page.$('[id="workbench.parts.sidebar"]'); let image = await container?.screenshot(); expect(image).toMatchImageSnapshot(matchImageSnapshotOptions); - await page.click('#list_id_3_1'); - await page.click('#list_id_4_1'); + await page.click('.monaco-list-row[aria-posinset="3"]'); await page.waitForTimeout(3000); image = await container?.screenshot(); expect(image).toMatchImageSnapshot(matchImageSnapshotOptions); diff --git a/tests/yarn.lock b/tests/yarn.lock index 4f5e6a22c..f2f953cdb 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -3356,9 +3356,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== pause-stream@0.0.11: version "0.0.11" diff --git a/vercel.json b/vercel.json index 6a1e04a10..c7b547792 100644 --- a/vercel.json +++ b/vercel.json @@ -8,6 +8,10 @@ "source": "/api/github-auth-callback", "destination": "/api/github-auth-callback" }, + { + "source": "/api/vscode-unpkg/(.*)", + "destination": "/api/vscode-unpkg" + }, { "source": "/static/(.*)", "destination": "/api/static-fallback" diff --git a/vscode-web-github1s/extensions/typescript-language-features/src/typescriptServiceClient.ts b/vscode-web-github1s/extensions/typescript-language-features/src/typescriptServiceClient.ts deleted file mode 100644 index c28ec016f..000000000 --- a/vscode-web-github1s/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ /dev/null @@ -1,1050 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as path from 'path'; -import * as vscode from 'vscode'; -import * as nls from 'vscode-nls'; -import { DiagnosticKind, DiagnosticsManager } from './languageFeatures/diagnostics'; -import * as Proto from './protocol'; -import { EventName } from './protocol.const'; -import BufferSyncSupport from './tsServer/bufferSyncSupport'; -import { OngoingRequestCancellerFactory } from './tsServer/cancellation'; -import { ILogDirectoryProvider } from './tsServer/logDirectoryProvider'; -import { ITypeScriptServer, TsServerProcessFactory } from './tsServer/server'; -import { TypeScriptServerError } from './tsServer/serverError'; -import { TypeScriptServerSpawner } from './tsServer/spawner'; -import { TypeScriptVersionManager } from './tsServer/versionManager'; -import { ITypeScriptVersionProvider, TypeScriptVersion } from './tsServer/versionProvider'; -import { ClientCapabilities, ClientCapability, ExecConfig, ITypeScriptServiceClient, ServerResponse, TypeScriptRequests } from './typescriptService'; -import API from './utils/api'; -import { TsServerLogLevel, TypeScriptServiceConfiguration } from './utils/configuration'; -import { Disposable } from './utils/dispose'; -import * as fileSchemes from './utils/fileSchemes'; -import { Logger } from './utils/logger'; -import { isWeb } from './utils/platform'; -import { TypeScriptPluginPathsProvider } from './utils/pluginPathsProvider'; -import { PluginManager } from './utils/plugins'; -import { TelemetryProperties, TelemetryReporter, VSCodeTelemetryReporter } from './utils/telemetry'; -import Tracer from './utils/tracer'; -import { inferredProjectCompilerOptions, ProjectType } from './utils/tsconfig'; - -const localize = nls.loadMessageBundle(); - -export interface TsDiagnostics { - readonly kind: DiagnosticKind; - readonly resource: vscode.Uri; - readonly diagnostics: Proto.Diagnostic[]; -} - -interface ToCancelOnResourceChanged { - readonly resource: vscode.Uri; - cancel(): void; -} - -namespace ServerState { - export const enum Type { - None, - Running, - Errored - } - - export const None = { type: Type.None } as const; - - export class Running { - readonly type = Type.Running; - - constructor( - public readonly server: ITypeScriptServer, - - /** - * API version obtained from the version picker after checking the corresponding path exists. - */ - public readonly apiVersion: API, - - /** - * Version reported by currently-running tsserver. - */ - public tsserverVersion: string | undefined, - public languageServiceEnabled: boolean, - ) { } - - public readonly toCancelOnResourceChange = new Set(); - - updateTsserverVersion(tsserverVersion: string) { - this.tsserverVersion = tsserverVersion; - } - - updateLanguageServiceEnabled(enabled: boolean) { - this.languageServiceEnabled = enabled; - } - } - - export class Errored { - readonly type = Type.Errored; - constructor( - public readonly error: Error, - public readonly tsServerLogFile: string | undefined, - ) { } - } - - export type State = typeof None | Running | Errored; -} - -export default class TypeScriptServiceClient extends Disposable implements ITypeScriptServiceClient { - - private readonly pathSeparator: string; - private readonly inMemoryResourcePrefix = '^'; - - private readonly workspaceState: vscode.Memento; - - private _onReady?: { promise: Promise; resolve: () => void; reject: () => void; }; - private _configuration: TypeScriptServiceConfiguration; - private pluginPathsProvider: TypeScriptPluginPathsProvider; - private readonly _versionManager: TypeScriptVersionManager; - - private readonly logger = new Logger(); - private readonly tracer = new Tracer(this.logger); - - private readonly typescriptServerSpawner: TypeScriptServerSpawner; - private serverState: ServerState.State = ServerState.None; - private lastStart: number; - private numberRestarts: number; - private _isPromptingAfterCrash = false; - private isRestarting: boolean = false; - private hasServerFatallyCrashedTooManyTimes = false; - private readonly loadingIndicator = new ServerInitializingIndicator(); - - public readonly telemetryReporter: TelemetryReporter; - public readonly bufferSyncSupport: BufferSyncSupport; - public readonly diagnosticsManager: DiagnosticsManager; - public readonly pluginManager: PluginManager; - - private readonly logDirectoryProvider: ILogDirectoryProvider; - private readonly cancellerFactory: OngoingRequestCancellerFactory; - private readonly versionProvider: ITypeScriptVersionProvider; - private readonly processFactory: TsServerProcessFactory; - - constructor( - private readonly context: vscode.ExtensionContext, - onCaseInsenitiveFileSystem: boolean, - services: { - pluginManager: PluginManager, - logDirectoryProvider: ILogDirectoryProvider, - cancellerFactory: OngoingRequestCancellerFactory, - versionProvider: ITypeScriptVersionProvider, - processFactory: TsServerProcessFactory, - }, - allModeIds: readonly string[] - ) { - super(); - - this.workspaceState = context.workspaceState; - - this.pluginManager = services.pluginManager; - this.logDirectoryProvider = services.logDirectoryProvider; - this.cancellerFactory = services.cancellerFactory; - this.versionProvider = services.versionProvider; - this.processFactory = services.processFactory; - - this.pathSeparator = path.sep; - this.lastStart = Date.now(); - - let resolve: () => void; - let reject: () => void; - const p = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - this._onReady = { promise: p, resolve: resolve!, reject: reject! }; - - this.numberRestarts = 0; - - this._configuration = TypeScriptServiceConfiguration.loadFromWorkspace(); - this.versionProvider.updateConfiguration(this._configuration); - - this.pluginPathsProvider = new TypeScriptPluginPathsProvider(this._configuration); - this._versionManager = this._register(new TypeScriptVersionManager(this._configuration, this.versionProvider, this.workspaceState)); - this._register(this._versionManager.onDidPickNewVersion(() => { - this.restartTsServer(); - })); - - this.bufferSyncSupport = new BufferSyncSupport(this, allModeIds, onCaseInsenitiveFileSystem); - this.onReady(() => { this.bufferSyncSupport.listen(); }); - - this.diagnosticsManager = new DiagnosticsManager('typescript', onCaseInsenitiveFileSystem); - this.bufferSyncSupport.onDelete(resource => { - this.cancelInflightRequestsForResource(resource); - this.diagnosticsManager.delete(resource); - }, null, this._disposables); - - this.bufferSyncSupport.onWillChange(resource => { - this.cancelInflightRequestsForResource(resource); - }); - - vscode.workspace.onDidChangeConfiguration(() => { - const oldConfiguration = this._configuration; - this._configuration = TypeScriptServiceConfiguration.loadFromWorkspace(); - - this.versionProvider.updateConfiguration(this._configuration); - this._versionManager.updateConfiguration(this._configuration); - this.pluginPathsProvider.updateConfiguration(this._configuration); - this.tracer.updateConfiguration(); - - if (this.serverState.type === ServerState.Type.Running) { - if (!this._configuration.implictProjectConfiguration.isEqualTo(oldConfiguration.implictProjectConfiguration)) { - this.setCompilerOptionsForInferredProjects(this._configuration); - } - - if (!this._configuration.isEqualTo(oldConfiguration)) { - this.restartTsServer(); - } - } - }, this, this._disposables); - - this.telemetryReporter = this._register(new VSCodeTelemetryReporter(() => { - if (this.serverState.type === ServerState.Type.Running) { - if (this.serverState.tsserverVersion) { - return this.serverState.tsserverVersion; - } - } - return this.apiVersion.fullVersionString; - })); - - this.typescriptServerSpawner = new TypeScriptServerSpawner(this.versionProvider, this._versionManager, this.logDirectoryProvider, this.pluginPathsProvider, this.logger, this.telemetryReporter, this.tracer, this.processFactory); - - this._register(this.pluginManager.onDidUpdateConfig(update => { - this.configurePlugin(update.pluginId, update.config); - })); - - this._register(this.pluginManager.onDidChangePlugins(() => { - this.restartTsServer(); - })); - } - - public get capabilities() { - if (isWeb()) { - return new ClientCapabilities( - ClientCapability.Syntax, - ClientCapability.EnhancedSyntax); - } - - if (this.apiVersion.gte(API.v400)) { - return new ClientCapabilities( - ClientCapability.Syntax, - ClientCapability.EnhancedSyntax, - ClientCapability.Semantic); - } - - return new ClientCapabilities( - ClientCapability.Syntax, - ClientCapability.Semantic); - } - - private readonly _onDidChangeCapabilities = this._register(new vscode.EventEmitter()); - readonly onDidChangeCapabilities = this._onDidChangeCapabilities.event; - - private cancelInflightRequestsForResource(resource: vscode.Uri): void { - if (this.serverState.type !== ServerState.Type.Running) { - return; - } - - for (const request of this.serverState.toCancelOnResourceChange) { - if (request.resource.toString() === resource.toString()) { - request.cancel(); - } - } - } - - public get configuration() { - return this._configuration; - } - - public dispose() { - super.dispose(); - - this.bufferSyncSupport.dispose(); - - if (this.serverState.type === ServerState.Type.Running) { - this.serverState.server.kill(); - } - - this.loadingIndicator.reset(); - } - - public restartTsServer(): void { - if (this.serverState.type === ServerState.Type.Running) { - this.info('Killing TS Server'); - this.isRestarting = true; - this.serverState.server.kill(); - } - - this.serverState = this.startService(true); - } - - private readonly _onTsServerStarted = this._register(new vscode.EventEmitter<{ version: TypeScriptVersion, usedApiVersion: API }>()); - public readonly onTsServerStarted = this._onTsServerStarted.event; - - private readonly _onDiagnosticsReceived = this._register(new vscode.EventEmitter()); - public readonly onDiagnosticsReceived = this._onDiagnosticsReceived.event; - - private readonly _onConfigDiagnosticsReceived = this._register(new vscode.EventEmitter()); - public readonly onConfigDiagnosticsReceived = this._onConfigDiagnosticsReceived.event; - - private readonly _onResendModelsRequested = this._register(new vscode.EventEmitter()); - public readonly onResendModelsRequested = this._onResendModelsRequested.event; - - private readonly _onProjectLanguageServiceStateChanged = this._register(new vscode.EventEmitter()); - public readonly onProjectLanguageServiceStateChanged = this._onProjectLanguageServiceStateChanged.event; - - private readonly _onDidBeginInstallTypings = this._register(new vscode.EventEmitter()); - public readonly onDidBeginInstallTypings = this._onDidBeginInstallTypings.event; - - private readonly _onDidEndInstallTypings = this._register(new vscode.EventEmitter()); - public readonly onDidEndInstallTypings = this._onDidEndInstallTypings.event; - - private readonly _onTypesInstallerInitializationFailed = this._register(new vscode.EventEmitter()); - public readonly onTypesInstallerInitializationFailed = this._onTypesInstallerInitializationFailed.event; - - private readonly _onSurveyReady = this._register(new vscode.EventEmitter()); - public readonly onSurveyReady = this._onSurveyReady.event; - - public get apiVersion(): API { - if (this.serverState.type === ServerState.Type.Running) { - return this.serverState.apiVersion; - } - return API.defaultVersion; - } - - public onReady(f: () => void): Promise { - return this._onReady!.promise.then(f); - } - - private info(message: string, data?: any): void { - this.logger.info(message, data); - } - - private error(message: string, data?: any): void { - this.logger.error(message, data); - } - - private logTelemetry(eventName: string, properties?: TelemetryProperties) { - this.telemetryReporter.logTelemetry(eventName, properties); - } - - private service(): ServerState.Running { - if (this.serverState.type === ServerState.Type.Running) { - return this.serverState; - } - if (this.serverState.type === ServerState.Type.Errored) { - throw this.serverState.error; - } - const newState = this.startService(); - if (newState.type === ServerState.Type.Running) { - return newState; - } - throw new Error(`Could not create TS service. Service state:${JSON.stringify(newState)}`); - } - - public ensureServiceStarted() { - if (this.serverState.type !== ServerState.Type.Running) { - this.startService(); - } - } - - private token: number = 0; - private startService(resendModels: boolean = false): ServerState.State { - this.info(`Starting TS Server `); - - if (this.isDisposed) { - this.info(`Not starting server. Disposed `); - return ServerState.None; - } - - if (this.hasServerFatallyCrashedTooManyTimes) { - this.info(`Not starting server. Too many crashes.`); - return ServerState.None; - } - - let version = this._versionManager.currentVersion; - if (!version.isValid) { - vscode.window.showWarningMessage(localize('noServerFound', 'The path {0} doesn\'t point to a valid tsserver install. Falling back to bundled TypeScript version.', version.path)); - - this._versionManager.reset(); - version = this._versionManager.currentVersion; - } - - this.info(`Using tsserver from: ${version.path}`); - - const apiVersion = version.apiVersion || API.defaultVersion; - const mytoken = ++this.token; - const handle = this.typescriptServerSpawner.spawn(version, this.capabilities, this.configuration, this.pluginManager, this.cancellerFactory, { - onFatalError: (command, err) => this.fatalError(command, err), - }); - this.serverState = new ServerState.Running(handle, apiVersion, undefined, true); - this.lastStart = Date.now(); - - /* __GDPR__ - "tsserver.spawned" : { - "${include}": [ - "${TypeScriptCommonProperties}" - ], - "localTypeScriptVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "typeScriptVersionSource": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.logTelemetry('tsserver.spawned', { - localTypeScriptVersion: this.versionProvider.localVersion ? this.versionProvider.localVersion.displayName : '', - typeScriptVersionSource: version.source, - }); - - handle.onError((err: Error) => { - if (this.token !== mytoken) { - // this is coming from an old process - return; - } - - if (err) { - vscode.window.showErrorMessage(localize('serverExitedWithError', 'TypeScript language server exited with error. Error message is: {0}', err.message || err.name)); - } - - this.serverState = new ServerState.Errored(err, handle.tsServerLogFile); - this.error('TSServer errored with error.', err); - if (handle.tsServerLogFile) { - this.error(`TSServer log file: ${handle.tsServerLogFile}`); - } - - /* __GDPR__ - "tsserver.error" : { - "${include}": [ - "${TypeScriptCommonProperties}" - ] - } - */ - this.logTelemetry('tsserver.error'); - this.serviceExited(false); - }); - - handle.onExit((code: any) => { - if (this.token !== mytoken) { - // this is coming from an old process - return; - } - - if (code === null || typeof code === 'undefined') { - this.info('TSServer exited'); - } else { - // In practice, the exit code is an integer with no ties to any identity, - // so it can be classified as SystemMetaData, rather than CallstackOrException. - this.error(`TSServer exited with code: ${code}`); - /* __GDPR__ - "tsserver.exitWithCode" : { - "code" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, - "${include}": [ - "${TypeScriptCommonProperties}" - ] - } - */ - this.logTelemetry('tsserver.exitWithCode', { code: code }); - } - - if (handle.tsServerLogFile) { - this.info(`TSServer log file: ${handle.tsServerLogFile}`); - } - this.serviceExited(!this.isRestarting); - this.isRestarting = false; - }); - - handle.onEvent(event => this.dispatchEvent(event)); - - if (apiVersion.gte(API.v300) && this.capabilities.has(ClientCapability.Semantic)) { - this.loadingIndicator.startedLoadingProject(undefined /* projectName */); - } - - this.serviceStarted(resendModels); - - this._onReady!.resolve(); - this._onTsServerStarted.fire({ version: version, usedApiVersion: apiVersion }); - this._onDidChangeCapabilities.fire(); - return this.serverState; - } - - public async showVersionPicker(): Promise { - this._versionManager.promptUserForVersion(); - } - - public async openTsServerLogFile(): Promise { - if (this._configuration.tsServerLogLevel === TsServerLogLevel.Off) { - vscode.window.showErrorMessage( - localize( - 'typescript.openTsServerLog.loggingNotEnabled', - 'TS Server logging is off. Please set `typescript.tsserver.log` and restart the TS server to enable logging'), - { - title: localize( - 'typescript.openTsServerLog.enableAndReloadOption', - 'Enable logging and restart TS server'), - }) - .then(selection => { - if (selection) { - return vscode.workspace.getConfiguration().update('typescript.tsserver.log', 'verbose', true).then(() => { - this.restartTsServer(); - }); - } - return undefined; - }); - return false; - } - - if (this.serverState.type !== ServerState.Type.Running || !this.serverState.server.tsServerLogFile) { - vscode.window.showWarningMessage(localize( - 'typescript.openTsServerLog.noLogFile', - 'TS Server has not started logging.')); - return false; - } - - try { - const doc = await vscode.workspace.openTextDocument(vscode.Uri.file(this.serverState.server.tsServerLogFile)); - await vscode.window.showTextDocument(doc); - return true; - } catch { - // noop - } - - try { - await vscode.commands.executeCommand('revealFileInOS', vscode.Uri.file(this.serverState.server.tsServerLogFile)); - return true; - } catch { - vscode.window.showWarningMessage(localize( - 'openTsServerLog.openFileFailedFailed', - 'Could not open TS Server log file')); - return false; - } - } - - private serviceStarted(resendModels: boolean): void { - this.bufferSyncSupport.reset(); - - const watchOptions = this.apiVersion.gte(API.v380) - ? this.configuration.watchOptions - : undefined; - - const configureOptions: Proto.ConfigureRequestArguments = { - hostInfo: 'vscode', - preferences: { - providePrefixAndSuffixTextForRename: true, - allowRenameOfImportPath: true, - includePackageJsonAutoImports: this._configuration.includePackageJsonAutoImports, - }, - watchOptions - }; - this.executeWithoutWaitingForResponse('configure', configureOptions); - this.setCompilerOptionsForInferredProjects(this._configuration); - if (resendModels) { - this._onResendModelsRequested.fire(); - this.bufferSyncSupport.reinitialize(); - this.bufferSyncSupport.requestAllDiagnostics(); - } - - // Reconfigure any plugins - for (const [config, pluginName] of this.pluginManager.configurations()) { - this.configurePlugin(config, pluginName); - } - } - - private setCompilerOptionsForInferredProjects(configuration: TypeScriptServiceConfiguration): void { - const args: Proto.SetCompilerOptionsForInferredProjectsArgs = { - options: this.getCompilerOptionsForInferredProjects(configuration) - }; - this.executeWithoutWaitingForResponse('compilerOptionsForInferredProjects', args); - } - - private getCompilerOptionsForInferredProjects(configuration: TypeScriptServiceConfiguration): Proto.ExternalProjectCompilerOptions { - return { - ...inferredProjectCompilerOptions(ProjectType.TypeScript, configuration), - allowJs: true, - allowSyntheticDefaultImports: true, - allowNonTsExtensions: true, - resolveJsonModule: true, - }; - } - - private serviceExited(restart: boolean): void { - this.loadingIndicator.reset(); - - const previousState = this.serverState; - this.serverState = ServerState.None; - - if (restart) { - const diff = Date.now() - this.lastStart; - this.numberRestarts++; - let startService = true; - - const reportIssueItem: vscode.MessageItem = { - title: localize('serverDiedReportIssue', 'Report Issue'), - }; - let prompt: Thenable | undefined = undefined; - - if (this.numberRestarts > 5) { - this.numberRestarts = 0; - if (diff < 10 * 1000 /* 10 seconds */) { - this.lastStart = Date.now(); - startService = false; - this.hasServerFatallyCrashedTooManyTimes = true; - prompt = vscode.window.showErrorMessage( - localize('serverDiedAfterStart', 'The TypeScript language service died 5 times right after it got started. The service will not be restarted.'), - reportIssueItem); - - /* __GDPR__ - "serviceExited" : { - "${include}": [ - "${TypeScriptCommonProperties}" - ] - } - */ - this.logTelemetry('serviceExited'); - } else if (diff < 60 * 1000 * 5 /* 5 Minutes */) { - this.lastStart = Date.now(); - prompt = vscode.window.showWarningMessage( - localize('serverDied', 'The TypeScript language service died unexpectedly 5 times in the last 5 Minutes.'), - reportIssueItem); - } - } else if (['vscode-insiders', 'code-oss'].includes(vscode.env.uriScheme)) { - // Prompt after a single restart - if (!this._isPromptingAfterCrash && previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError) { - this.numberRestarts = 0; - this._isPromptingAfterCrash = true; - prompt = vscode.window.showWarningMessage( - localize('serverDiedOnce', 'The TypeScript language service died unexpectedly.'), - reportIssueItem); - } - } - - prompt?.then(item => { - this._isPromptingAfterCrash = false; - - if (item === reportIssueItem) { - const args = previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError - ? getReportIssueArgsForError(previousState.error, previousState.tsServerLogFile) - : undefined; - vscode.commands.executeCommand('workbench.action.openIssueReporter', args); - } - }); - - if (startService) { - this.startService(true); - } - } - } - - public normalizedPath(resource: vscode.Uri): string | undefined { - if (fileSchemes.disabledSchemes.has(resource.scheme)) { - return undefined; - } - - switch (resource.scheme) { - case fileSchemes.file: - { - let result = resource.fsPath; - if (!result) { - return undefined; - } - result = path.normalize(result); - - // Both \ and / must be escaped in regular expressions - return result.replace(new RegExp('\\' + this.pathSeparator, 'g'), '/'); - } - default: - { - return this.inMemoryResourcePrefix + resource.toString(true); - } - } - } - - public toPath(resource: vscode.Uri): string | undefined { - return this.normalizedPath(resource); - } - - public toOpenedFilePath(document: vscode.TextDocument, options: { suppressAlertOnFailure?: boolean } = {}): string | undefined { - if (!this.bufferSyncSupport.ensureHasBuffer(document.uri)) { - if (!options.suppressAlertOnFailure && !fileSchemes.disabledSchemes.has(document.uri.scheme)) { - console.error(`Unexpected resource ${document.uri}`); - } - return undefined; - } - return this.toPath(document.uri); - } - - public hasCapabilityForResource(resource: vscode.Uri, capability: ClientCapability): boolean { - switch (capability) { - case ClientCapability.Semantic: - { - return fileSchemes.semanticSupportedSchemes.includes(resource.scheme); - } - case ClientCapability.Syntax: - case ClientCapability.EnhancedSyntax: - { - return true; - } - } - } - - public toResource(filepath: string): vscode.Uri { - if (isWeb()) { - // On web, treat absolute paths as pointing to standard lib files - if (filepath.startsWith('/')) { - // below codes are changed by github1s - return vscode.Uri.joinPath(this.context.extensionUri, 'dist', 'browser', 'typescript', filepath.slice(1)); - // about codes are changed by github1s - } - } - - if (filepath.startsWith(this.inMemoryResourcePrefix)) { - const resource = vscode.Uri.parse(filepath.slice(1)); - return this.bufferSyncSupport.toVsCodeResource(resource); - } - return this.bufferSyncSupport.toResource(filepath); - } - - public getWorkspaceRootForResource(resource: vscode.Uri): string | undefined { - const roots = vscode.workspace.workspaceFolders ? Array.from(vscode.workspace.workspaceFolders) : undefined; - if (!roots || !roots.length) { - return undefined; - } - - if (resource.scheme === fileSchemes.file || resource.scheme === fileSchemes.untitled) { - for (const root of roots.sort((a, b) => a.uri.fsPath.length - b.uri.fsPath.length)) { - if (resource.fsPath.startsWith(root.uri.fsPath + path.sep)) { - return root.uri.fsPath; - } - } - return roots[0].uri.fsPath; - } - - return undefined; - } - - public execute(command: keyof TypeScriptRequests, args: any, token: vscode.CancellationToken, config?: ExecConfig): Promise> { - let execution: Promise>; - - if (config?.cancelOnResourceChange) { - const runningServerState = this.service(); - - const source = new vscode.CancellationTokenSource(); - token.onCancellationRequested(() => source.cancel()); - - const inFlight: ToCancelOnResourceChanged = { - resource: config.cancelOnResourceChange, - cancel: () => source.cancel(), - }; - runningServerState.toCancelOnResourceChange.add(inFlight); - - execution = this.executeImpl(command, args, { - isAsync: false, - token: source.token, - expectsResult: true, - ...config, - }).finally(() => { - runningServerState.toCancelOnResourceChange.delete(inFlight); - source.dispose(); - }); - } else { - execution = this.executeImpl(command, args, { - isAsync: false, - token, - expectsResult: true, - ...config, - }); - } - - if (config?.nonRecoverable) { - execution.catch(err => this.fatalError(command, err)); - } - - return execution; - } - - public executeWithoutWaitingForResponse(command: keyof TypeScriptRequests, args: any): void { - this.executeImpl(command, args, { - isAsync: false, - token: undefined, - expectsResult: false - }); - } - - public executeAsync(command: keyof TypeScriptRequests, args: Proto.GeterrRequestArgs, token: vscode.CancellationToken): Promise> { - return this.executeImpl(command, args, { - isAsync: true, - token, - expectsResult: true - }); - } - - private executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: false, lowPriority?: boolean, requireSemantic?: boolean }): undefined; - private executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, requireSemantic?: boolean }): Promise>; - private executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, requireSemantic?: boolean }): Promise> | undefined { - this.bufferSyncSupport.beforeCommand(command); - const runningServerState = this.service(); - return runningServerState.server.executeImpl(command, args, executeInfo); - } - - public interruptGetErr(f: () => R): R { - return this.bufferSyncSupport.interruptGetErr(f); - } - - private fatalError(command: string, error: unknown): void { - /* __GDPR__ - "fatalError" : { - "${include}": [ - "${TypeScriptCommonProperties}", - "${TypeScriptRequestErrorProperties}" - ], - "command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.logTelemetry('fatalError', { ...(error instanceof TypeScriptServerError ? error.telemetry : { command }) }); - console.error(`A non-recoverable error occured while executing tsserver command: ${command}`); - if (error instanceof TypeScriptServerError && error.serverErrorText) { - console.error(error.serverErrorText); - } - - if (this.serverState.type === ServerState.Type.Running) { - this.info('Killing TS Server'); - const logfile = this.serverState.server.tsServerLogFile; - this.serverState.server.kill(); - if (error instanceof TypeScriptServerError) { - this.serverState = new ServerState.Errored(error, logfile); - } - } - } - - private dispatchEvent(event: Proto.Event) { - switch (event.event) { - case EventName.syntaxDiag: - case EventName.semanticDiag: - case EventName.suggestionDiag: - // This event also roughly signals that projects have been loaded successfully (since the TS server is synchronous) - this.loadingIndicator.reset(); - - const diagnosticEvent = event as Proto.DiagnosticEvent; - if (diagnosticEvent.body && diagnosticEvent.body.diagnostics) { - this._onDiagnosticsReceived.fire({ - kind: getDignosticsKind(event), - resource: this.toResource(diagnosticEvent.body.file), - diagnostics: diagnosticEvent.body.diagnostics - }); - } - break; - - case EventName.configFileDiag: - this._onConfigDiagnosticsReceived.fire(event as Proto.ConfigFileDiagnosticEvent); - break; - - case EventName.telemetry: - { - const body = (event as Proto.TelemetryEvent).body; - this.dispatchTelemetryEvent(body); - break; - } - case EventName.projectLanguageServiceState: - { - const body = (event as Proto.ProjectLanguageServiceStateEvent).body!; - if (this.serverState.type === ServerState.Type.Running) { - this.serverState.updateLanguageServiceEnabled(body.languageServiceEnabled); - } - this._onProjectLanguageServiceStateChanged.fire(body); - break; - } - case EventName.projectsUpdatedInBackground: - this.loadingIndicator.reset(); - - const body = (event as Proto.ProjectsUpdatedInBackgroundEvent).body; - const resources = body.openFiles.map(file => this.toResource(file)); - this.bufferSyncSupport.getErr(resources); - break; - - case EventName.beginInstallTypes: - this._onDidBeginInstallTypings.fire((event as Proto.BeginInstallTypesEvent).body); - break; - - case EventName.endInstallTypes: - this._onDidEndInstallTypings.fire((event as Proto.EndInstallTypesEvent).body); - break; - - case EventName.typesInstallerInitializationFailed: - this._onTypesInstallerInitializationFailed.fire((event as Proto.TypesInstallerInitializationFailedEvent).body); - break; - - case EventName.surveyReady: - this._onSurveyReady.fire((event as Proto.SurveyReadyEvent).body); - break; - - case EventName.projectLoadingStart: - this.loadingIndicator.startedLoadingProject((event as Proto.ProjectLoadingStartEvent).body.projectName); - break; - - case EventName.projectLoadingFinish: - this.loadingIndicator.finishedLoadingProject((event as Proto.ProjectLoadingFinishEvent).body.projectName); - break; - } - } - - private dispatchTelemetryEvent(telemetryData: Proto.TelemetryEventBody): void { - const properties: { [key: string]: string } = Object.create(null); - switch (telemetryData.telemetryEventName) { - case 'typingsInstalled': - const typingsInstalledPayload: Proto.TypingsInstalledTelemetryEventPayload = (telemetryData.payload as Proto.TypingsInstalledTelemetryEventPayload); - properties['installedPackages'] = typingsInstalledPayload.installedPackages; - - if (typeof typingsInstalledPayload.installSuccess === 'boolean') { - properties['installSuccess'] = typingsInstalledPayload.installSuccess.toString(); - } - if (typeof typingsInstalledPayload.typingsInstallerVersion === 'string') { - properties['typingsInstallerVersion'] = typingsInstalledPayload.typingsInstallerVersion; - } - break; - - default: - const payload = telemetryData.payload; - if (payload) { - Object.keys(payload).forEach((key) => { - try { - if (payload.hasOwnProperty(key)) { - properties[key] = typeof payload[key] === 'string' ? payload[key] : JSON.stringify(payload[key]); - } - } catch (e) { - // noop - } - }); - } - break; - } - if (telemetryData.telemetryEventName === 'projectInfo') { - if (this.serverState.type === ServerState.Type.Running) { - this.serverState.updateTsserverVersion(properties['version']); - } - } - - /* __GDPR__ - "typingsInstalled" : { - "installedPackages" : { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }, - "installSuccess": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, - "typingsInstallerVersion": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }, - "${include}": [ - "${TypeScriptCommonProperties}" - ] - } - */ - // __GDPR__COMMENT__: Other events are defined by TypeScript. - this.logTelemetry(telemetryData.telemetryEventName, properties); - } - - private configurePlugin(pluginName: string, configuration: {}): any { - if (this.apiVersion.gte(API.v314)) { - this.executeWithoutWaitingForResponse('configurePlugin', { pluginName, configuration }); - } - } -} - -function getReportIssueArgsForError( - error: TypeScriptServerError, - logPath: string | undefined, -): { extensionId: string, issueTitle: string, issueBody: string } | undefined { - if (!error.serverStack || !error.serverMessage) { - return undefined; - } - - // Note these strings are intentionally not localized - // as we want users to file issues in english - - const sections = [ - `❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️`, - `**TypeScript Version:** ${error.version.apiVersion?.fullVersionString}`, - `**Steps to reproduce crash** - -1. -2. -3.`, - ]; - - if (logPath) { - sections.push(`**TS Server Log** - -❗️ Please review and upload this log file to help us diagnose this crash: - -\`${logPath}\` - -The log file may contain personal data, including full paths and source code from your workspace. You can scrub the log file to remove paths or other personal information. -`); - } else { - - sections.push(`**TS Server Log** - -❗️Server logging disabled. To help us fix crashes like this, please enable logging by setting: - -\`\`\`json -"typescript.tsserver.log": "verbose" -\`\`\` - -After enabling this setting, future crash reports will include the server log.`); - } - - sections.push(`**TS Server Error Stack** - -Server: \`${error.serverId}\` - -\`\`\` -${error.serverStack} -\`\`\``); - - return { - extensionId: 'vscode.typescript-language-features', - issueTitle: `TS Server fatal error: ${error.serverMessage}`, - - issueBody: sections.join('\n\n') - }; -} - -function getDignosticsKind(event: Proto.Event) { - switch (event.event) { - case 'syntaxDiag': return DiagnosticKind.Syntax; - case 'semanticDiag': return DiagnosticKind.Semantic; - case 'suggestionDiag': return DiagnosticKind.Suggestion; - } - throw new Error('Unknown dignostics kind'); -} - -class ServerInitializingIndicator extends Disposable { - private _task?: { project: string | undefined, resolve: () => void, reject: () => void }; - - public reset(): void { - if (this._task) { - this._task.reject(); - this._task = undefined; - } - } - - /** - * Signal that a project has started loading. - */ - public startedLoadingProject(projectName: string | undefined): void { - // TS projects are loaded sequentially. Cancel existing task because it should always be resolved before - // the incoming project loading task is. - this.reset(); - - vscode.window.withProgress({ - location: vscode.ProgressLocation.Window, - title: localize('serverLoading.progress', "Initializing JS/TS language features"), - }, () => new Promise((resolve, reject) => { - this._task = { project: projectName, resolve, reject }; - })); - } - - public finishedLoadingProject(projectName: string | undefined): void { - if (this._task && this._task.project === projectName) { - this._task.resolve(); - this._task = undefined; - } - } -} - diff --git a/vscode-web-github1s/package.json b/vscode-web-github1s/package.json index fd5009021..9ed48ae40 100644 --- a/vscode-web-github1s/package.json +++ b/vscode-web-github1s/package.json @@ -1,6 +1,6 @@ { "name": "@github1s/vscode-web", - "version": "0.1.10", + "version": "0.2.1", "description": "VS Code web for GitHub1s", "author": "github1s", "license": "MIT", diff --git a/vscode-web-github1s/resources/builtin-extensions.json b/vscode-web-github1s/resources/builtin-extensions.json index 2c53d66b2..87959873c 100644 --- a/vscode-web-github1s/resources/builtin-extensions.json +++ b/vscode-web-github1s/resources/builtin-extensions.json @@ -31,6 +31,10 @@ "name": "css-language-features", "path": "extensions/css-language-features" }, + { + "name": "dart", + "path": "extensions/dart" + }, { "name": "docker", "path": "extensions/docker" @@ -83,6 +87,10 @@ "name": "ini", "path": "extensions/ini" }, + { + "name": "ipynb", + "path": "extensions/ipynb" + }, { "name": "java", "path": "extensions/java" @@ -127,6 +135,10 @@ "name": "markdown-language-features", "path": "extensions/markdown-language-features" }, + { + "name": "markdown-math", + "path": "extensions/markdown-math" + }, { "name": "merge-conflict", "path": "extensions/merge-conflict" @@ -135,10 +147,6 @@ "name": "microsoft-authentication", "path": "extensions/microsoft-authentication" }, - { - "name": "notebook-markdown-extensions", - "path": "extensions/notebook-markdown-extensions" - }, { "name": "npm", "path": "extensions/npm" diff --git a/vscode-web-github1s/scripts/clone.sh b/vscode-web-github1s/scripts/clone.sh index 0ed3cc009..8052472d9 100755 --- a/vscode-web-github1s/scripts/clone.sh +++ b/vscode-web-github1s/scripts/clone.sh @@ -13,7 +13,7 @@ function main() { fi mkdir -p lib cd lib - git clone --depth 1 -b 1.55.0 https://github.com/microsoft/vscode.git vscode + git clone --depth 1 -b 1.60.0 https://github.com/microsoft/vscode.git vscode cd vscode yarn --frozen-lockfile } diff --git a/vscode-web-github1s/scripts/sync-code.sh b/vscode-web-github1s/scripts/sync-code.sh index 23a393f13..990bc1898 100755 --- a/vscode-web-github1s/scripts/sync-code.sh +++ b/vscode-web-github1s/scripts/sync-code.sh @@ -9,7 +9,9 @@ echo $APP_ROOT function main() { cd ${APP_ROOT} rsync -a src/ lib/vscode/src - rsync -a extensions/ lib/vscode/extensions + if [ -e extensions ]; then + rsync -a extensions/ lib/vscode/extensions + fi } main "$@" diff --git a/vscode-web-github1s/scripts/watch/watch-dist.js b/vscode-web-github1s/scripts/watch/watch-dist.js index 6f1698e25..26a4684d4 100755 --- a/vscode-web-github1s/scripts/watch/watch-dist.js +++ b/vscode-web-github1s/scripts/watch/watch-dist.js @@ -26,7 +26,9 @@ const autoSyncVscodeOut = async () => { const SOURCE = path.join(APP_ROOT, 'vscode-web-github1s/lib/vscode/out'); const TARGET = path.join(APP_ROOT, 'dist/static/vscode'); - await util.promisify(cp.exec)(`rsync -a ${SOURCE}/ ${TARGET}`); + await util + .promisify(cp.exec)(`rsync -a ${SOURCE}/ ${TARGET}`) + .catch(() => {}); chokidar.watch(SOURCE).on( 'all', diff --git a/vscode-web-github1s/src/vs/base/common/platform.ts b/vscode-web-github1s/src/vs/base/common/platform.ts index 9820e719b..055fffa17 100644 --- a/vscode-web-github1s/src/vs/base/common/platform.ts +++ b/vscode-web-github1s/src/vs/base/common/platform.ts @@ -28,7 +28,7 @@ interface NLSConfig { } export interface IProcessEnvironment { - [key: string]: string; + [key: string]: string | undefined; } /** @@ -40,6 +40,7 @@ export interface IProcessEnvironment { */ export interface INodeProcess { platform: string; + arch: string; env: IProcessEnvironment; nextTick?: (callback: (...args: any[]) => void) => void; versions?: { @@ -57,36 +58,16 @@ declare const self: unknown; export const globals: any = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); let nodeProcess: INodeProcess | undefined = undefined; -if (typeof process !== 'undefined') { - // Native environment (non-sandboxed) - nodeProcess = process; -} else if (typeof globals.vscode !== 'undefined') { +if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') { // Native environment (sandboxed) nodeProcess = globals.vscode.process; +} else if (typeof process !== 'undefined') { + // Native environment (non-sandboxed) + nodeProcess = process; } const isElectronRenderer = typeof nodeProcess?.versions?.electron === 'string' && nodeProcess.type === 'renderer'; export const isElectronSandboxed = isElectronRenderer && nodeProcess?.sandboxed; -export const browserCodeLoadingCacheStrategy: 'none' | 'code' | 'bypassHeatCheck' | 'bypassHeatCheckAndEagerCompile' | undefined = (() => { - - // Always enabled when sandbox is enabled - if (isElectronSandboxed) { - return 'bypassHeatCheck'; - } - - // Otherwise, only enabled conditionally - const env = nodeProcess?.env['ENABLE_VSCODE_BROWSER_CODE_LOADING']; - if (typeof env === 'string') { - if (env === 'none' || env === 'code' || env === 'bypassHeatCheck' || env === 'bypassHeatCheckAndEagerCompile') { - return env; - } - - return 'bypassHeatCheck'; - } - - return undefined; -})(); -export const isPreferringBrowserCodeLoad = typeof browserCodeLoadingCacheStrategy === 'string'; interface INavigator { userAgent: string; @@ -215,7 +196,7 @@ export namespace Language { export const locale = _locale; /** - * The translatios that are available through language packs. + * The translations that are available through language packs. */ export const translationsConfigFile = _translationsConfigFile; diff --git a/vscode-web-github1s/src/vs/code/browser/workbench/workbench.ts b/vscode-web-github1s/src/vs/code/browser/workbench/workbench.ts index 7cd7ff01f..08f7380e0 100644 --- a/vscode-web-github1s/src/vs/code/browser/workbench/workbench.ts +++ b/vscode-web-github1s/src/vs/code/browser/workbench/workbench.ts @@ -3,22 +3,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IWorkbenchConstructionOptions, create, ICredentialsProvider, IURLCallbackProvider, IWorkspaceProvider, IWorkspace, IWindowIndicator, IProductQualityChangeHandler, ISettingsSyncOptions } from 'vs/workbench/workbench.web.api'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { Event, Emitter } from 'vs/base/common/event'; -import { generateUuid } from 'vs/base/common/uuid'; -import { CancellationToken } from 'vs/base/common/cancellation'; +import { isStandalone } from 'vs/base/browser/browser'; import { streamToBuffer } from 'vs/base/common/buffer'; +import { CancellationToken } from 'vs/base/common/cancellation'; +import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { request } from 'vs/base/parts/request/browser/request'; -import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/windows/common/windows'; +import { Schemas } from 'vs/base/common/network'; import { isEqual } from 'vs/base/common/resources'; -import { isStandalone } from 'vs/base/browser/browser'; +import { URI, UriComponents } from 'vs/base/common/uri'; +import { generateUuid } from 'vs/base/common/uuid'; +import { request } from 'vs/base/parts/request/browser/request'; import { localize } from 'vs/nls'; -import { Schemas } from 'vs/base/common/network'; -import product from 'vs/platform/product/common/product'; import { parseLogLevel } from 'vs/platform/log/common/log'; +import product from 'vs/platform/product/common/product'; +import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/windows/common/windows'; // below codes are changed by github1s +import { create, ICredentialsProvider, IProductQualityChangeHandler, ISettingsSyncOptions, IURLCallbackProvider, IWindowIndicator, IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/workbench.web.api'; // eslint-disable-next-line import { getBrowserUrl, replaceBrowserUrl } from 'vs/github1s/util'; // eslint-disable-next-line @@ -300,27 +300,32 @@ class WorkspaceProvider implements IWorkspaceProvider { readonly trusted = true; constructor( - public readonly workspace: IWorkspace, - public readonly payload: object + readonly workspace: IWorkspace, + readonly payload: object ) { } - async open(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise { + async open(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): Promise { if (options?.reuse && !options.payload && this.isSame(this.workspace, workspace)) { - return; // return early if workspace and environment is not changing and we are reusing window + return true; // return early if workspace and environment is not changing and we are reusing window } const targetHref = this.createTargetUrl(workspace, options); if (targetHref) { if (options?.reuse) { window.location.href = targetHref; + return true; } else { + let result; if (isStandalone) { - window.open(targetHref, '_blank', 'toolbar=no'); // ensures to open another 'standalone' window! + result = window.open(targetHref, '_blank', 'toolbar=no'); // ensures to open another 'standalone' window! } else { - window.open(targetHref); + result = window.open(targetHref); } + + return !!result; } } + return false; } private createTargetUrl(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): string | undefined { @@ -400,6 +405,10 @@ class WindowIndicator implements IWindowIndicator { uri = workspace.workspaceUri; } + if (uri?.scheme === 'github' || uri?.scheme === 'codespace') { + [repositoryOwner, repositoryName] = uri.authority.split('+'); + } + // below codes are changed by github1s if (uri?.scheme === 'github1s') { [repositoryOwner = 'conwnet', repositoryName = 'github1s'] = URI.parse(getBrowserUrl()).path.split('/').filter(Boolean); @@ -436,13 +445,6 @@ class WindowIndicator implements IWindowIndicator { const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = JSON.parse(configElementAttribute); - // Revive static extension locations - if (Array.isArray(config.staticExtensions)) { - config.staticExtensions.forEach(extension => { - extension.extensionLocation = URI.revive(extension.extensionLocation); - }); - } - // Find workspace to open and payload let foundWorkspace = false; let workspace: IWorkspace; @@ -509,6 +511,15 @@ class WindowIndicator implements IWindowIndicator { // icon: 'code', // title: localize('home', "Home") // }; + + // Welcome Banner + // const welcomeBanner: IWelcomeBanner = { + // message: localize('welcomeBannerMessage', "{0} Web. Browser based playground for testing.", product.nameShort), + // actions: [{ + // href: 'https://github.com/microsoft/vscode', + // label: localize('learnMore', "Learn More") + // }] + // }; // above codes are changed by github1s // Window indicator (unless connected to a remote) @@ -535,19 +546,6 @@ class WindowIndicator implements IWindowIndicator { // settings sync options const settingsSyncOptions: ISettingsSyncOptions | undefined = config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, - enablementHandler: (enablement) => { - let queryString = `settingsSync=${enablement ? 'true' : 'false'}`; - - // Save all other query params we might have - const query = new URL(document.location.href).searchParams; - query.forEach((value, key) => { - if (key !== 'settingsSync') { - queryString += `&${key}=${value}`; - } - }); - - window.location.href = `${window.location.origin}?${queryString}`; - } } : undefined; // Finally create workbench @@ -556,12 +554,16 @@ class WindowIndicator implements IWindowIndicator { // below codes are changed by github1s commands: getGitHub1sCustomCommands(), // above codes are changed by github1s - logLevel: logLevel ? parseLogLevel(logLevel) : undefined, + developmentOptions: { + logLevel: logLevel ? parseLogLevel(logLevel) : undefined, + ...config.developmentOptions + }, settingsSyncOptions, // below codes are changed by github1s // homeIndicator, - // above codes are changed by github1s windowIndicator, + // welcomeBanner, + // above codes are changed by github1s productQualityChangeHandler, workspaceProvider, urlCallbackProvider: new PollingURLCallbackProvider(), diff --git a/vscode-web-github1s/src/vs/editor/browser/controller/textAreaHandler.ts b/vscode-web-github1s/src/vs/editor/browser/controller/textAreaHandler.ts deleted file mode 100644 index 78e2b3dba..000000000 --- a/vscode-web-github1s/src/vs/editor/browser/controller/textAreaHandler.ts +++ /dev/null @@ -1,678 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import 'vs/css!./textAreaHandler'; -import * as nls from 'vs/nls'; -import * as browser from 'vs/base/browser/browser'; -import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import * as platform from 'vs/base/common/platform'; -import * as strings from 'vs/base/common/strings'; -import { Configuration } from 'vs/editor/browser/config/configuration'; -import { CopyOptions, ICompositionData, IPasteData, ITextAreaInputHost, TextAreaInput, ClipboardDataToCopy } from 'vs/editor/browser/controller/textAreaInput'; -import { ISimpleModel, ITypeData, PagedScreenReaderStrategy, TextAreaState, _debugComposition } from 'vs/editor/browser/controller/textAreaState'; -import { ViewController } from 'vs/editor/browser/view/viewController'; -import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/view/viewPart'; -import { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers'; -import { Margin } from 'vs/editor/browser/viewParts/margin/margin'; -import { RenderLineNumbersType, EditorOption, IComputedEditorOptions, EditorOptions } from 'vs/editor/common/config/editorOptions'; -import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; -import { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier'; -import { Position } from 'vs/editor/common/core/position'; -import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; -import { ScrollType } from 'vs/editor/common/editorCommon'; -import { EndOfLinePreference } from 'vs/editor/common/model'; -import { RenderingContext, RestrictedRenderingContext, HorizontalPosition } from 'vs/editor/common/view/renderingContext'; -import { ViewContext } from 'vs/editor/common/view/viewContext'; -import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; -import { IEditorAriaOptions } from 'vs/editor/browser/editorBrowser'; -import { MOUSE_CURSOR_TEXT_CSS_CLASS_NAME } from 'vs/base/browser/ui/mouseCursor/mouseCursor'; - -export interface ITextAreaHandlerHelper { - visibleRangeForPositionRelativeToEditor(lineNumber: number, column: number): HorizontalPosition | null; -} - -class VisibleTextAreaData { - _visibleTextAreaBrand: void; - - public readonly top: number; - public readonly left: number; - public readonly width: number; - - constructor(top: number, left: number, width: number) { - this.top = top; - this.left = left; - this.width = width; - } - - public setWidth(width: number): VisibleTextAreaData { - return new VisibleTextAreaData(this.top, this.left, width); - } -} - -const canUseZeroSizeTextarea = (browser.isFirefox); - -export class TextAreaHandler extends ViewPart { - - private readonly _viewController: ViewController; - private readonly _viewHelper: ITextAreaHandlerHelper; - private _scrollLeft: number; - private _scrollTop: number; - - private _accessibilitySupport!: AccessibilitySupport; - private _accessibilityPageSize!: number; - private _contentLeft: number; - private _contentWidth: number; - private _contentHeight: number; - private _fontInfo: BareFontInfo; - private _lineHeight: number; - private _emptySelectionClipboard: boolean; - private _copyWithSyntaxHighlighting: boolean; - - /** - * Defined only when the text area is visible (composition case). - */ - private _visibleTextArea: VisibleTextAreaData | null; - private _selections: Selection[]; - private _modelSelections: Selection[]; - - /** - * The position at which the textarea was rendered. - * This is useful for hit-testing and determining the mouse position. - */ - private _lastRenderPosition: Position | null; - - public readonly textArea: FastDomNode; - public readonly textAreaCover: FastDomNode; - private readonly _textAreaInput: TextAreaInput; - - constructor(context: ViewContext, viewController: ViewController, viewHelper: ITextAreaHandlerHelper) { - super(context); - - this._viewController = viewController; - this._viewHelper = viewHelper; - this._scrollLeft = 0; - this._scrollTop = 0; - - const options = this._context.configuration.options; - const layoutInfo = options.get(EditorOption.layoutInfo); - - this._setAccessibilityOptions(options); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - this._contentHeight = layoutInfo.height; - this._fontInfo = options.get(EditorOption.fontInfo); - this._lineHeight = options.get(EditorOption.lineHeight); - this._emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard); - this._copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting); - - this._visibleTextArea = null; - this._selections = [new Selection(1, 1, 1, 1)]; - this._modelSelections = [new Selection(1, 1, 1, 1)]; - this._lastRenderPosition = null; - - // Text Area (The focus will always be in the textarea when the cursor is blinking) - this.textArea = createFastDomNode(document.createElement('textarea')); - PartFingerprints.write(this.textArea, PartFingerprint.TextArea); - this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`); - this.textArea.setAttribute('wrap', 'off'); - this.textArea.setAttribute('autocorrect', 'off'); - this.textArea.setAttribute('autocapitalize', 'off'); - this.textArea.setAttribute('autocomplete', 'off'); - this.textArea.setAttribute('spellcheck', 'false'); - this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); - this.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex))); - this.textArea.setAttribute('role', 'textbox'); - this.textArea.setAttribute('aria-roledescription', nls.localize('editor', "editor")); - this.textArea.setAttribute('aria-multiline', 'true'); - this.textArea.setAttribute('aria-haspopup', 'false'); - this.textArea.setAttribute('aria-autocomplete', 'both'); - - // below codes are changed by github1s - if (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) { - // above codes are changed by github1s - this.textArea.setAttribute('readonly', 'true'); - } - - this.textAreaCover = createFastDomNode(document.createElement('div')); - this.textAreaCover.setPosition('absolute'); - - const simpleModel: ISimpleModel = { - getLineCount: (): number => { - return this._context.model.getLineCount(); - }, - getLineMaxColumn: (lineNumber: number): number => { - return this._context.model.getLineMaxColumn(lineNumber); - }, - getValueInRange: (range: Range, eol: EndOfLinePreference): string => { - return this._context.model.getValueInRange(range, eol); - } - }; - - const textAreaInputHost: ITextAreaInputHost = { - getDataToCopy: (generateHTML: boolean): ClipboardDataToCopy => { - const rawTextToCopy = this._context.model.getPlainTextToCopy(this._modelSelections, this._emptySelectionClipboard, platform.isWindows); - const newLineCharacter = this._context.model.getEOL(); - - const isFromEmptySelection = (this._emptySelectionClipboard && this._modelSelections.length === 1 && this._modelSelections[0].isEmpty()); - const multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null); - const text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy); - - let html: string | null | undefined = undefined; - let mode: string | null = null; - if (generateHTML) { - if (CopyOptions.forceCopyWithSyntaxHighlighting || (this._copyWithSyntaxHighlighting && text.length < 65536)) { - const richText = this._context.model.getRichTextToCopy(this._modelSelections, this._emptySelectionClipboard); - if (richText) { - html = richText.html; - mode = richText.mode; - } - } - } - return { - isFromEmptySelection, - multicursorText, - text, - html, - mode - }; - }, - getScreenReaderContent: (currentState: TextAreaState): TextAreaState => { - if (this._accessibilitySupport === AccessibilitySupport.Disabled) { - // We know for a fact that a screen reader is not attached - // On OSX, we write the character before the cursor to allow for "long-press" composition - // Also on OSX, we write the word before the cursor to allow for the Accessibility Keyboard to give good hints - if (platform.isMacintosh) { - const selection = this._selections[0]; - if (selection.isEmpty()) { - const position = selection.getStartPosition(); - - let textBefore = this._getWordBeforePosition(position); - if (textBefore.length === 0) { - textBefore = this._getCharacterBeforePosition(position); - } - - if (textBefore.length > 0) { - return new TextAreaState(textBefore, textBefore.length, textBefore.length, position, position); - } - } - } - return TextAreaState.EMPTY; - } - - if (browser.isAndroid) { - // when tapping in the editor on a word, Android enters composition mode. - // in the `compositionstart` event we cannot clear the textarea, because - // it then forgets to ever send a `compositionend`. - // we therefore only write the current word in the textarea - const selection = this._selections[0]; - if (selection.isEmpty()) { - const position = selection.getStartPosition(); - const [wordAtPosition, positionOffsetInWord] = this._getAndroidWordAtPosition(position); - if (wordAtPosition.length > 0) { - return new TextAreaState(wordAtPosition, positionOffsetInWord, positionOffsetInWord, position, position); - } - } - return TextAreaState.EMPTY; - } - - return PagedScreenReaderStrategy.fromEditorSelection(currentState, simpleModel, this._selections[0], this._accessibilityPageSize, this._accessibilitySupport === AccessibilitySupport.Unknown); - }, - - deduceModelPosition: (viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position => { - return this._context.model.deduceModelPositionRelativeToViewPosition(viewAnchorPosition, deltaOffset, lineFeedCnt); - } - }; - - this._textAreaInput = this._register(new TextAreaInput(textAreaInputHost, this.textArea)); - - this._register(this._textAreaInput.onKeyDown((e: IKeyboardEvent) => { - this._viewController.emitKeyDown(e); - })); - - this._register(this._textAreaInput.onKeyUp((e: IKeyboardEvent) => { - this._viewController.emitKeyUp(e); - })); - - this._register(this._textAreaInput.onPaste((e: IPasteData) => { - let pasteOnNewLine = false; - let multicursorText: string[] | null = null; - let mode: string | null = null; - if (e.metadata) { - pasteOnNewLine = (this._emptySelectionClipboard && !!e.metadata.isFromEmptySelection); - multicursorText = (typeof e.metadata.multicursorText !== 'undefined' ? e.metadata.multicursorText : null); - mode = e.metadata.mode; - } - this._viewController.paste(e.text, pasteOnNewLine, multicursorText, mode); - })); - - this._register(this._textAreaInput.onCut(() => { - this._viewController.cut(); - })); - - this._register(this._textAreaInput.onType((e: ITypeData) => { - if (e.replacePrevCharCnt || e.replaceNextCharCnt || e.positionDelta) { - // must be handled through the new command - if (_debugComposition) { - console.log(` => compositionType: <<${e.text}>>, ${e.replacePrevCharCnt}, ${e.replaceNextCharCnt}, ${e.positionDelta}`); - } - this._viewController.compositionType(e.text, e.replacePrevCharCnt, e.replaceNextCharCnt, e.positionDelta); - } else { - if (_debugComposition) { - console.log(` => type: <<${e.text}>>`); - } - this._viewController.type(e.text); - } - })); - - this._register(this._textAreaInput.onSelectionChangeRequest((modelSelection: Selection) => { - this._viewController.setSelection(modelSelection); - })); - - this._register(this._textAreaInput.onCompositionStart((e) => { - const lineNumber = this._selections[0].startLineNumber; - const column = this._selections[0].startColumn + e.revealDeltaColumns; - - this._context.model.revealRange( - 'keyboard', - true, - new Range(lineNumber, column, lineNumber, column), - viewEvents.VerticalRevealType.Simple, - ScrollType.Immediate - ); - - // Find range pixel position - const visibleRange = this._viewHelper.visibleRangeForPositionRelativeToEditor(lineNumber, column); - - if (visibleRange) { - this._visibleTextArea = new VisibleTextAreaData( - this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber), - visibleRange.left, - canUseZeroSizeTextarea ? 0 : 1 - ); - this._render(); - } - - // Show the textarea - this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ime-input`); - - this._viewController.compositionStart(); - this._context.model.onCompositionStart(); - })); - - this._register(this._textAreaInput.onCompositionUpdate((e: ICompositionData) => { - if (!this._visibleTextArea) { - return; - } - // adjust width by its size - this._visibleTextArea = this._visibleTextArea.setWidth(measureText(e.data, this._fontInfo)); - this._render(); - })); - - this._register(this._textAreaInput.onCompositionEnd(() => { - - this._visibleTextArea = null; - this._render(); - - this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`); - this._viewController.compositionEnd(); - this._context.model.onCompositionEnd(); - })); - - this._register(this._textAreaInput.onFocus(() => { - this._context.model.setHasFocus(true); - })); - - this._register(this._textAreaInput.onBlur(() => { - this._context.model.setHasFocus(false); - })); - } - - public dispose(): void { - super.dispose(); - } - - private _getAndroidWordAtPosition(position: Position): [string, number] { - const ANDROID_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:",.<>/?'; - const lineContent = this._context.model.getLineContent(position.lineNumber); - const wordSeparators = getMapForWordSeparators(ANDROID_WORD_SEPARATORS); - - let goingLeft = true; - let startColumn = position.column; - let goingRight = true; - let endColumn = position.column; - let distance = 0; - while (distance < 50 && (goingLeft || goingRight)) { - if (goingLeft && startColumn <= 1) { - goingLeft = false; - } - if (goingLeft) { - const charCode = lineContent.charCodeAt(startColumn - 2); - const charClass = wordSeparators.get(charCode); - if (charClass !== WordCharacterClass.Regular) { - goingLeft = false; - } else { - startColumn--; - } - } - if (goingRight && endColumn > lineContent.length) { - goingRight = false; - } - if (goingRight) { - const charCode = lineContent.charCodeAt(endColumn - 1); - const charClass = wordSeparators.get(charCode); - if (charClass !== WordCharacterClass.Regular) { - goingRight = false; - } else { - endColumn++; - } - } - distance++; - } - - return [lineContent.substring(startColumn - 1, endColumn - 1), position.column - startColumn]; - } - - private _getWordBeforePosition(position: Position): string { - const lineContent = this._context.model.getLineContent(position.lineNumber); - const wordSeparators = getMapForWordSeparators(this._context.configuration.options.get(EditorOption.wordSeparators)); - - let column = position.column; - let distance = 0; - while (column > 1) { - const charCode = lineContent.charCodeAt(column - 2); - const charClass = wordSeparators.get(charCode); - if (charClass !== WordCharacterClass.Regular || distance > 50) { - return lineContent.substring(column - 1, position.column - 1); - } - distance++; - column--; - } - return lineContent.substring(0, position.column - 1); - } - - private _getCharacterBeforePosition(position: Position): string { - if (position.column > 1) { - const lineContent = this._context.model.getLineContent(position.lineNumber); - const charBefore = lineContent.charAt(position.column - 2); - if (!strings.isHighSurrogate(charBefore.charCodeAt(0))) { - return charBefore; - } - } - return ''; - } - - private _getAriaLabel(options: IComputedEditorOptions): string { - const accessibilitySupport = options.get(EditorOption.accessibilitySupport); - if (accessibilitySupport === AccessibilitySupport.Disabled) { - return nls.localize('accessibilityOffAriaLabel', "The editor is not accessible at this time. Press {0} for options.", platform.isLinux ? 'Shift+Alt+F1' : 'Alt+F1'); - } - return options.get(EditorOption.ariaLabel); - } - - private _setAccessibilityOptions(options: IComputedEditorOptions): void { - this._accessibilitySupport = options.get(EditorOption.accessibilitySupport); - const accessibilityPageSize = options.get(EditorOption.accessibilityPageSize); - if (this._accessibilitySupport === AccessibilitySupport.Enabled && accessibilityPageSize === EditorOptions.accessibilityPageSize.defaultValue) { - // If a screen reader is attached and the default value is not set we shuold automatically increase the page size to 1000 for a better experience - this._accessibilityPageSize = 1000; - } else { - this._accessibilityPageSize = accessibilityPageSize; - } - } - - // --- begin event handlers - - public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - const options = this._context.configuration.options; - const layoutInfo = options.get(EditorOption.layoutInfo); - - this._setAccessibilityOptions(options); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - this._contentHeight = layoutInfo.height; - this._fontInfo = options.get(EditorOption.fontInfo); - this._lineHeight = options.get(EditorOption.lineHeight); - this._emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard); - this._copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting); - this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); - this.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex))); - - // below codes are changed by github1s - if (e.hasChanged(EditorOption.domReadOnly) || e.hasChanged(EditorOption.readOnly)) { - if (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) { - // above codes are changed by github1s - this.textArea.setAttribute('readonly', 'true'); - } else { - this.textArea.removeAttribute('readonly'); - } - } - - if (e.hasChanged(EditorOption.accessibilitySupport)) { - this._textAreaInput.writeScreenReaderContent('strategy changed'); - } - - return true; - } - public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { - this._selections = e.selections.slice(0); - this._modelSelections = e.modelSelections.slice(0); - this._textAreaInput.writeScreenReaderContent('selection changed'); - return true; - } - public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { - // true for inline decorations that can end up relayouting text - return true; - } - public onFlushed(e: viewEvents.ViewFlushedEvent): boolean { - return true; - } - public onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean { - return true; - } - public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean { - return true; - } - public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean { - return true; - } - public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { - this._scrollLeft = e.scrollLeft; - this._scrollTop = e.scrollTop; - return true; - } - public onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean { - return true; - } - - // --- end event handlers - - // --- begin view API - - public isFocused(): boolean { - return this._textAreaInput.isFocused(); - } - - public focusTextArea(): void { - this._textAreaInput.focusTextArea(); - } - - public refreshFocusState() { - this._textAreaInput.refreshFocusState(); - } - - public getLastRenderData(): Position | null { - return this._lastRenderPosition; - } - - public setAriaOptions(options: IEditorAriaOptions): void { - if (options.activeDescendant) { - this.textArea.setAttribute('aria-haspopup', 'true'); - this.textArea.setAttribute('aria-autocomplete', 'list'); - this.textArea.setAttribute('aria-activedescendant', options.activeDescendant); - } else { - this.textArea.setAttribute('aria-haspopup', 'false'); - this.textArea.setAttribute('aria-autocomplete', 'both'); - this.textArea.removeAttribute('aria-activedescendant'); - } - if (options.role) { - this.textArea.setAttribute('role', options.role); - } - } - - // --- end view API - - private _primaryCursorPosition: Position = new Position(1, 1); - private _primaryCursorVisibleRange: HorizontalPosition | null = null; - - public prepareRender(ctx: RenderingContext): void { - this._primaryCursorPosition = new Position(this._selections[0].positionLineNumber, this._selections[0].positionColumn); - this._primaryCursorVisibleRange = ctx.visibleRangeForPosition(this._primaryCursorPosition); - } - - public render(ctx: RestrictedRenderingContext): void { - this._textAreaInput.writeScreenReaderContent('render'); - this._render(); - } - - private _render(): void { - if (this._visibleTextArea) { - // The text area is visible for composition reasons - this._renderInsideEditor( - null, - this._visibleTextArea.top - this._scrollTop, - this._contentLeft + this._visibleTextArea.left - this._scrollLeft, - this._visibleTextArea.width, - this._lineHeight - ); - return; - } - - if (!this._primaryCursorVisibleRange) { - // The primary cursor is outside the viewport => place textarea to the top left - this._renderAtTopLeft(); - return; - } - - const left = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft; - if (left < this._contentLeft || left > this._contentLeft + this._contentWidth) { - // cursor is outside the viewport - this._renderAtTopLeft(); - return; - } - - const top = this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber) - this._scrollTop; - if (top < 0 || top > this._contentHeight) { - // cursor is outside the viewport - this._renderAtTopLeft(); - return; - } - - // The primary cursor is in the viewport (at least vertically) => place textarea on the cursor - - if (platform.isMacintosh) { - // For the popup emoji input, we will make the text area as high as the line height - // We will also make the fontSize and lineHeight the correct dimensions to help with the placement of these pickers - this._renderInsideEditor( - this._primaryCursorPosition, - top, left, - canUseZeroSizeTextarea ? 0 : 1, this._lineHeight - ); - return; - } - - this._renderInsideEditor( - this._primaryCursorPosition, - top, left, - canUseZeroSizeTextarea ? 0 : 1, canUseZeroSizeTextarea ? 0 : 1 - ); - } - - private _renderInsideEditor(renderedPosition: Position | null, top: number, left: number, width: number, height: number): void { - this._lastRenderPosition = renderedPosition; - const ta = this.textArea; - const tac = this.textAreaCover; - - Configuration.applyFontInfo(ta, this._fontInfo); - - ta.setTop(top); - ta.setLeft(left); - ta.setWidth(width); - ta.setHeight(height); - - tac.setTop(0); - tac.setLeft(0); - tac.setWidth(0); - tac.setHeight(0); - } - - private _renderAtTopLeft(): void { - this._lastRenderPosition = null; - const ta = this.textArea; - const tac = this.textAreaCover; - - Configuration.applyFontInfo(ta, this._fontInfo); - ta.setTop(0); - ta.setLeft(0); - tac.setTop(0); - tac.setLeft(0); - - if (canUseZeroSizeTextarea) { - ta.setWidth(0); - ta.setHeight(0); - tac.setWidth(0); - tac.setHeight(0); - return; - } - - // (in WebKit the textarea is 1px by 1px because it cannot handle input to a 0x0 textarea) - // specifically, when doing Korean IME, setting the textarea to 0x0 breaks IME badly. - - ta.setWidth(1); - ta.setHeight(1); - tac.setWidth(1); - tac.setHeight(1); - - const options = this._context.configuration.options; - - if (options.get(EditorOption.glyphMargin)) { - tac.setClassName('monaco-editor-background textAreaCover ' + Margin.OUTER_CLASS_NAME); - } else { - if (options.get(EditorOption.lineNumbers).renderType !== RenderLineNumbersType.Off) { - tac.setClassName('monaco-editor-background textAreaCover ' + LineNumbersOverlay.CLASS_NAME); - } else { - tac.setClassName('monaco-editor-background textAreaCover'); - } - } - } -} - -function measureText(text: string, fontInfo: BareFontInfo): number { - // adjust width by its size - const canvasElem = document.createElement('canvas'); - const context = canvasElem.getContext('2d')!; - context.font = createFontString(fontInfo); - const metrics = context.measureText(text); - - if (browser.isFirefox) { - return metrics.width + 2; // +2 for Japanese... - } else { - return metrics.width; - } -} - -function createFontString(bareFontInfo: BareFontInfo): string { - return doCreateFontString('normal', bareFontInfo.fontWeight, bareFontInfo.fontSize, bareFontInfo.lineHeight, bareFontInfo.fontFamily); -} - -function doCreateFontString(fontStyle: string, fontWeight: string, fontSize: number, lineHeight: number, fontFamily: string): string { - // The full font syntax is: - // style | variant | weight | stretch | size/line-height | fontFamily - // (https://developer.mozilla.org/en-US/docs/Web/CSS/font) - // But it appears Edge and IE11 cannot properly parse `stretch`. - return `${fontStyle} normal ${fontWeight} ${fontSize}px / ${lineHeight}px ${fontFamily}`; -} diff --git a/vscode-web-github1s/src/vs/editor/common/config/editorOptions.ts b/vscode-web-github1s/src/vs/editor/common/config/editorOptions.ts index 22d856573..857ff39fd 100644 --- a/vscode-web-github1s/src/vs/editor/common/config/editorOptions.ts +++ b/vscode-web-github1s/src/vs/editor/common/config/editorOptions.ts @@ -75,7 +75,7 @@ export interface IEditorOptions { /** * Control the rendering of line numbers. * If it is a function, it will be invoked when rendering a line number and the return value will be rendered. - * Otherwise, if it is a truey, line numbers will be rendered normally (equivalent of using an identity function). + * Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function). * Otherwise, line numbers will not be rendered. * Defaults to `on`. */ @@ -382,8 +382,9 @@ export interface IEditorOptions { * Suggest options. */ suggest?: ISuggestOptions; + inlineSuggest?: IInlineSuggestOptions; /** - * Smart select opptions; + * Smart select options. */ smartSelect?: ISmartSelectOptions; /** @@ -547,6 +548,11 @@ export interface IEditorOptions { * Defaults to true. */ foldingHighlight?: boolean; + /** + * Auto fold imports folding regions. + * Defaults to true. + */ + foldingImportsByDefault?: boolean; /** * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter. * Defaults to 'mouseover'. @@ -564,7 +570,7 @@ export interface IEditorOptions { matchBrackets?: 'never' | 'near' | 'always'; /** * Enable rendering of whitespace. - * Defaults to none. + * Defaults to 'selection'. */ renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; /** @@ -637,7 +643,11 @@ export interface IEditorOptions { /** * Control the behavior and rendering of the inline hints. */ - inlineHints?: IEditorInlineHintsOptions; + inlayHints?: IEditorInlayHintsOptions; + /** + * Control if the editor should use shadow DOM. + */ + useShadowDOM?: boolean; } /** @@ -704,7 +714,7 @@ export interface IDiffEditorOptions extends IEditorOptions { */ originalAriaLabel?: string; /** - * Aria label for modifed editor. + * Aria label for modified editor. */ modifiedAriaLabel?: string; } @@ -906,7 +916,7 @@ class EditorBooleanOption extends SimpleEditorOption extends SimpleEditorOption extends SimpleEditorOption extends SimpleEditorOption extends this._allowedValues = allowedValues; } - public validate(input: any): V { + public override validate(input: any): V { return stringSet(input, this.defaultValue, this._allowedValues); } } @@ -1112,7 +1122,7 @@ class EditorAccessibilitySupport extends BaseEditorOption constructor() { const defaults: EditorFindOptions = { cursorMoveOnType: true, - seedSearchStringFromSelection: true, + seedSearchStringFromSelection: 'always', autoFindInSelection: 'never', globalFindClipboard: false, addExtraSpaceOnTop: true, @@ -1393,8 +1403,14 @@ class EditorFind extends BaseEditorOption description: nls.localize('find.cursorMoveOnType', "Controls whether the cursor should jump to find matches while typing.") }, 'editor.find.seedSearchStringFromSelection': { - type: 'boolean', + type: 'string', + enum: ['never', 'always', 'selection'], default: defaults.seedSearchStringFromSelection, + enumDescriptions: [ + nls.localize('editor.find.seedSearchStringFromSelection.never', 'Never seed search string from the editor selection.'), + nls.localize('editor.find.seedSearchStringFromSelection.always', 'Always seed search string from the editor selection, including word at cursor position.'), + nls.localize('editor.find.seedSearchStringFromSelection.selection', 'Only seed search string from the editor selection.') + ], description: nls.localize('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.") }, 'editor.find.autoFindInSelection': { @@ -1402,11 +1418,11 @@ class EditorFind extends BaseEditorOption enum: ['never', 'always', 'multiline'], default: defaults.autoFindInSelection, enumDescriptions: [ - nls.localize('editor.find.autoFindInSelection.never', 'Never turn on Find in selection automatically (default).'), - nls.localize('editor.find.autoFindInSelection.always', 'Always turn on Find in selection automatically.'), - nls.localize('editor.find.autoFindInSelection.multiline', 'Turn on Find in selection automatically when multiple lines of content are selected.') + nls.localize('editor.find.autoFindInSelection.never', 'Never turn on Find in Selection automatically (default).'), + nls.localize('editor.find.autoFindInSelection.always', 'Always turn on Find in Selection automatically.'), + nls.localize('editor.find.autoFindInSelection.multiline', 'Turn on Find in Selection automatically when multiple lines of content are selected.') ], - description: nls.localize('find.autoFindInSelection', "Controls the condition for turning on find in selection automatically.") + description: nls.localize('find.autoFindInSelection', "Controls the condition for turning on Find in Selection automatically.") }, 'editor.find.globalFindClipboard': { type: 'boolean', @@ -1436,7 +1452,9 @@ class EditorFind extends BaseEditorOption const input = _input as IEditorFindOptions; return { cursorMoveOnType: boolean(input.cursorMoveOnType, this.defaultValue.cursorMoveOnType), - seedSearchStringFromSelection: boolean(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection), + seedSearchStringFromSelection: typeof _input.seedSearchStringFromSelection === 'boolean' + ? (_input.seedSearchStringFromSelection ? 'always' : 'never') + : stringSet<'never' | 'always' | 'selection'>(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, ['never', 'always', 'selection']), autoFindInSelection: typeof _input.autoFindInSelection === 'boolean' ? (_input.autoFindInSelection ? 'always' : 'never') : stringSet<'never' | 'always' | 'multiline'>(input.autoFindInSelection, this.defaultValue.autoFindInSelection, ['never', 'always', 'multiline']), @@ -1533,14 +1551,14 @@ class EditorFontSize extends SimpleEditorOption { ); } - public validate(input: any): number { + public override validate(input: any): number { let r = EditorFloatOption.float(input, this.defaultValue); if (r === 0) { return EDITOR_FONT_DEFAULTS.fontSize; } return EditorFloatOption.clamp(r, 6, 100); } - public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number { + public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number { // The final fontSize respects the editor zoom level. // So take the result from env.fontInfo return env.fontInfo.fontSize; @@ -1643,6 +1661,7 @@ class EditorGoToLocation extends BaseEditorOption minimapCanvasInnerHeight); - if (isViewportWrapping && fitBecomesFill) { - // remember for next time - memory.stableMinimapLayoutInput = input; - memory.stableFitRemainingWidth = remainingWidth; - } else { - memory.stableMinimapLayoutInput = null; - memory.stableFitRemainingWidth = 0; - } } } @@ -2138,14 +2154,28 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption configuredMinimapScale) { minimapWidthMultiplier = Math.min(2, minimapScale / configuredMinimapScale); } minimapCharWidth = minimapScale / pixelRatio / minimapWidthMultiplier; minimapCanvasInnerHeight = Math.ceil((Math.max(typicalViewportLineCount, viewLineCount + extraLinesBeyondLastLine)) * minimapLineHeight); - if (isViewportWrapping && fitBecomesFill) { + if (isViewportWrapping) { + // remember for next time + memory.stableMinimapLayoutInput = input; + memory.stableFitRemainingWidth = remainingWidth; memory.stableFitMaxMinimapScale = minimapScale; + } else { + memory.stableMinimapLayoutInput = null; + memory.stableFitRemainingWidth = 0; } } } @@ -2390,12 +2420,12 @@ class EditorLightbulb extends BaseEditorOption>; +export type EditorInlayHintsOptions = Readonly>; -class EditorInlineHints extends BaseEditorOption { +class EditorInlayHints extends BaseEditorOption { constructor() { - const defaults: EditorInlineHintsOptions = { enabled: true, fontSize: 0, fontFamily: EDITOR_FONT_DEFAULTS.fontFamily }; + const defaults: EditorInlayHintsOptions = { enabled: true, fontSize: 0, fontFamily: '' }; super( - EditorOption.inlineHints, 'inlineHints', defaults, + EditorOption.inlayHints, 'inlayHints', defaults, { - 'editor.inlineHints.enabled': { + 'editor.inlayHints.enabled': { type: 'boolean', default: defaults.enabled, - description: nls.localize('inlineHints.enable', "Enables the inline hints in the editor.") + description: nls.localize('inlayHints.enable', "Enables the inlay hints in the editor.") }, - 'editor.inlineHints.fontSize': { + 'editor.inlayHints.fontSize': { type: 'number', default: defaults.fontSize, - description: nls.localize('inlineHints.fontSize', "Controls font size of inline hints in the editor. When set to `0`, the 90% of `#editor.fontSize#` is used.") + markdownDescription: nls.localize('inlayHints.fontSize', "Controls font size of inlay hints in the editor. When set to `0`, the 90% of `#editor.fontSize#` is used.") }, - 'editor.inlineHints.fontFamily': { + 'editor.inlayHints.fontFamily': { type: 'string', default: defaults.fontFamily, - description: nls.localize('inlineHints.fontFamily', "Controls font family of inline hints in the editor.") + description: nls.localize('inlayHints.fontFamily', "Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.") }, } ); } - public validate(_input: any): EditorInlineHintsOptions { + public validate(_input: any): EditorInlayHintsOptions { if (!_input || typeof _input !== 'object') { return this.defaultValue; } - const input = _input as IEditorInlineHintsOptions; + const input = _input as IEditorInlayHintsOptions; return { enabled: boolean(input.enabled, this.defaultValue.enabled), fontSize: EditorIntOption.clampedInt(input.fontSize, this.defaultValue.fontSize, 0, 100), @@ -2460,17 +2490,18 @@ class EditorInlineHints extends BaseEditorOption { +class EditorLineHeight extends EditorFloatOption { constructor() { super( EditorOption.lineHeight, 'lineHeight', - EDITOR_FONT_DEFAULTS.lineHeight, 0, 150, - { description: nls.localize('lineHeight', "Controls the line height. Use 0 to compute the line height from the font size.") } + EDITOR_FONT_DEFAULTS.lineHeight, + x => EditorFloatOption.clamp(x, 0, 150), + { markdownDescription: nls.localize('lineHeight', "Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.") } ); } - public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number { + public override compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, value: number): number { // The lineHeight is computed from the fontSize if it is 0. // Moreover, the final lineHeight respects the editor zoom level. // So take the result from env.fontInfo @@ -2766,7 +2797,7 @@ export type ValidQuickSuggestionsOptions = boolean | Readonly { - public readonly defaultValue: Readonly>; + public override readonly defaultValue: Readonly>; constructor() { const defaults: ValidQuickSuggestionsOptions = { @@ -2989,6 +3020,7 @@ export interface IEditorScrollbarOptions { /** * The size of arrows (if displayed). * Defaults to 11. + * **NOTE**: This option cannot be updated using `updateOptions()` */ arrowSize?: number; /** @@ -3004,16 +3036,19 @@ export interface IEditorScrollbarOptions { /** * Cast horizontal and vertical shadows when the content is scrolled. * Defaults to true. + * **NOTE**: This option cannot be updated using `updateOptions()` */ useShadows?: boolean; /** * Render arrows at the top and bottom of the vertical scrollbar. * Defaults to false. + * **NOTE**: This option cannot be updated using `updateOptions()` */ verticalHasArrows?: boolean; /** * Render arrows at the left and right of the horizontal scrollbar. * Defaults to false. + * **NOTE**: This option cannot be updated using `updateOptions()` */ horizontalHasArrows?: boolean; /** @@ -3024,6 +3059,7 @@ export interface IEditorScrollbarOptions { /** * Always consume mouse wheel events (always call preventDefault() and stopPropagation() on the browser events). * Defaults to true. + * **NOTE**: This option cannot be updated using `updateOptions()` */ alwaysConsumeMouseWheel?: boolean; /** @@ -3039,11 +3075,13 @@ export interface IEditorScrollbarOptions { /** * Width in pixels for the vertical slider. * Defaults to `verticalScrollbarSize`. + * **NOTE**: This option cannot be updated using `updateOptions()` */ verticalSliderSize?: number; /** * Height in pixels for the horizontal slider. * Defaults to `horizontalScrollbarSize`. + * **NOTE**: This option cannot be updated using `updateOptions()` */ horizontalSliderSize?: number; /** @@ -3083,22 +3121,61 @@ function _scrollbarVisibilityFromString(visibility: string | undefined, defaultV class EditorScrollbar extends BaseEditorOption { constructor() { + const defaults: InternalEditorScrollbarOptions = { + vertical: ScrollbarVisibility.Auto, + horizontal: ScrollbarVisibility.Auto, + arrowSize: 11, + useShadows: true, + verticalHasArrows: false, + horizontalHasArrows: false, + horizontalScrollbarSize: 12, + horizontalSliderSize: 12, + verticalScrollbarSize: 14, + verticalSliderSize: 14, + handleMouseWheel: true, + alwaysConsumeMouseWheel: true, + scrollByPage: false + }; super( - EditorOption.scrollbar, 'scrollbar', + EditorOption.scrollbar, 'scrollbar', defaults, { - vertical: ScrollbarVisibility.Auto, - horizontal: ScrollbarVisibility.Auto, - arrowSize: 11, - useShadows: true, - verticalHasArrows: false, - horizontalHasArrows: false, - horizontalScrollbarSize: 12, - horizontalSliderSize: 12, - verticalScrollbarSize: 14, - verticalSliderSize: 14, - handleMouseWheel: true, - alwaysConsumeMouseWheel: true, - scrollByPage: false + 'editor.scrollbar.vertical': { + type: 'string', + enum: ['auto', 'visible', 'hidden'], + enumDescriptions: [ + nls.localize('scrollbar.vertical.auto', "The vertical scrollbar will be visible only when necessary."), + nls.localize('scrollbar.vertical.visible', "The vertical scrollbar will always be visible."), + nls.localize('scrollbar.vertical.fit', "The vertical scrollbar will always be hidden."), + ], + default: 'auto', + description: nls.localize('scrollbar.vertical', "Controls the visibility of the vertical scrollbar.") + }, + 'editor.scrollbar.horizontal': { + type: 'string', + enum: ['auto', 'visible', 'hidden'], + enumDescriptions: [ + nls.localize('scrollbar.horizontal.auto', "The horizontal scrollbar will be visible only when necessary."), + nls.localize('scrollbar.horizontal.visible', "The horizontal scrollbar will always be visible."), + nls.localize('scrollbar.horizontal.fit', "The horizontal scrollbar will always be hidden."), + ], + default: 'auto', + description: nls.localize('scrollbar.horizontal', "Controls the visibility of the horizontal scrollbar.") + }, + 'editor.scrollbar.verticalScrollbarSize': { + type: 'number', + default: defaults.verticalScrollbarSize, + description: nls.localize('scrollbar.verticalScrollbarSize', "The width of the vertical scrollbar.") + }, + 'editor.scrollbar.horizontalScrollbarSize': { + type: 'number', + default: defaults.horizontalScrollbarSize, + description: nls.localize('scrollbar.horizontalScrollbarSize', "The height of the horizontal scrollbar.") + }, + 'editor.scrollbar.scrollByPage': { + type: 'boolean', + default: defaults.scrollByPage, + description: nls.localize('scrollbar.scrollByPage', "Controls whether clicks scroll by page or jump to click position.") + } } ); } @@ -3130,6 +3207,118 @@ class EditorScrollbar extends BaseEditorOption>; + +/** + * Configuration options for inline suggestions + */ +class InlineEditorSuggest extends BaseEditorOption { + constructor() { + const defaults: InternalInlineSuggestOptions = { + enabled: true, + mode: 'subwordSmart' + }; + + super( + EditorOption.inlineSuggest, 'inlineSuggest', defaults, + { + 'editor.inlineSuggest.enabled': { + type: 'boolean', + default: defaults.enabled, + description: nls.localize('inlineSuggest.enabled', "Controls whether to automatically show inline suggestions in the editor.") + }, + 'editor.inlineSuggest.mode': { + type: 'string', + enum: ['prefix', 'subword', 'subwordSmart'], + enumDescriptions: [ + nls.localize('inlineSuggest.mode.prefix', "Only render an inline suggestion if the replace text is a prefix of the insert text."), + nls.localize('inlineSuggest.mode.subword', "Only render an inline suggestion if the replace text is a subword of the insert text."), + nls.localize('inlineSuggest.mode.subwordSmart', "Only render an inline suggestion if the replace text is a subword of the insert text, but the subword must start after the cursor."), + ], + default: defaults.mode, + description: nls.localize('inlineSuggest.mode', "Controls which mode to use for rendering inline suggestions.") + }, + } + ); + } + + public validate(_input: any): InternalInlineSuggestOptions { + if (!_input || typeof _input !== 'object') { + return this.defaultValue; + } + const input = _input as IInlineSuggestOptions; + return { + enabled: boolean(input.enabled, this.defaultValue.enabled), + mode: stringSet(input.mode, this.defaultValue.mode, ['prefix', 'subword', 'subwordSmart']), + }; + } +} + +//#endregion + +//#region bracketPairColorization + +export interface IBracketPairColorizationOptions { + /** + * Enable or disable bracket pair colorization. + */ + enabled?: boolean; +} + +export type InternalBracketPairColorizationOptions = Readonly>; + +/** + * Configuration options for inline suggestions + */ +class BracketPairColorization extends BaseEditorOption { + constructor() { + const defaults: InternalBracketPairColorizationOptions = { + enabled: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled + }; + + super( + EditorOption.bracketPairColorization, 'bracketPairColorization', defaults, + { + 'editor.bracketPairColorization.enabled': { + type: 'boolean', + default: defaults.enabled, + description: nls.localize('bracketPairColorization.enabled', "Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.") + } + } + ); + } + + public validate(_input: any): InternalBracketPairColorizationOptions { + if (!_input || typeof _input !== 'object') { + return this.defaultValue; + } + const input = _input as IBracketPairColorizationOptions; + return { + enabled: boolean(input.enabled, this.defaultValue.enabled) + }; + } +} + +//#endregion + //#region suggest /** @@ -3164,6 +3353,14 @@ export interface ISuggestOptions { * Enable or disable the suggest status bar. */ showStatusBar?: boolean; + /** + * Enable or disable the rendering of the suggestion preview. + */ + preview?: boolean; + /** + * Configures the mode of the preview. + */ + previewMode?: 'prefix' | 'subword' | 'subwordSmart'; /** * Show details inline with the label. Defaults to true. */ @@ -3180,6 +3377,10 @@ export interface ISuggestOptions { * Show constructor-suggestions. */ showConstructors?: boolean; + /** + * Show deprecated-suggestions. + */ + showDeprecated?: boolean; /** * Show field-suggestions. */ @@ -3291,10 +3492,13 @@ class EditorSuggest extends BaseEditorOption .content .github1sWelcomePage { + height: 100%; + min-height: 100%; +} + + .monaco-workbench .part.editor > .content .welcomePageContainer { align-items: center; display: flex; @@ -259,7 +265,9 @@ .file-icons-enabled .show-file-icons .vs_code_welcome_page-name-file-icon.file-icon::before { content: ' '; - background-image: url('../../../../browser/media/code-icon.svg'); + /* below codes are changed by github1s */ + background-image: url('../workbench/browser/media/code-icon.svg'); + /* above codes are changed by github1s */ } .monaco-workbench .part.editor > .content .welcomePage .mac-only, diff --git a/vscode-web-github1s/src/vs/github1s/welcomePage.ts b/vscode-web-github1s/src/vs/github1s/welcomePage.ts new file mode 100644 index 000000000..138435fe3 --- /dev/null +++ b/vscode-web-github1s/src/vs/github1s/welcomePage.ts @@ -0,0 +1,193 @@ +/* eslint-disable header/header */ +/** + * @file custom welcome page + * @author netcon + */ + +import 'vs/css!./welcomePage'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IProductService } from 'vs/platform/product/common/productService'; +import { escape } from 'vs/base/common/strings'; +import { localize } from 'vs/nls'; +import * as marked from 'vs/base/common/marked/marked'; +const configurationKey = 'workbench.startupEditor'; + +const buildTemplate = () => ` +
+
+
+

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

+

+ One second to read GitHub code with VS Code +

+
+
+
+
+

Rate limit Info:

+
    +
  • ------------------------------
  • +
  • X-RateLimit-Limit:
  • +
  • X-RateLimit-Remaining:
  • +
  • X-RateLimit-Reset:
  • +
  • ------------------------------
  • +
  • Current rate limit window will reset after s
  • +
  • GitHub Rate limiting Documentation
  • +
+
+
+

${escape(localize('welcomePage.help', "Help"))}

+ +
+

+
+
+
+

Authentication

+
+
+
+
+
+
+
+

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

+
+
+
+
+
+
+
+
+
+`; + +export class GitHub1sWelcomePage { + private container?: HTMLElement; + + constructor( + @IConfigurationService private readonly configurationService: IConfigurationService, + @IProductService private readonly productService: IProductService, + @ICommandService private readonly commandService: ICommandService, + ) { } + + public render() { + if (this.container) { + return this.container; + } + const content = marked(buildTemplate()); + this.container = document.createElement('div'); + this.container.classList.add('github1sWelcomePage'); + this.container.innerHTML = content; + this.onReady(this.container); + + return this.container; + } + + onReady(container: HTMLElement) { + const enabled = this.configurationService.getValue(configurationKey) === 'welcomePage'; + const showOnStartup = container.querySelector('#showOnStartup'); + if (enabled) { + showOnStartup.setAttribute('checked', 'checked'); + } + showOnStartup.addEventListener('click', e => { + this.configurationService.updateValue(configurationKey, showOnStartup.checked ? 'welcomePage' : 'newUntitledFile'); + }); + + const prodName = container.querySelector('.welcomePage .title .caption') as HTMLElement; + if (prodName) { + prodName.textContent = this.productService.nameLong; + } + + const gitHubTokenStatus = this.getGitHubTokenStatus(); + gitHubTokenStatus.then(tokenStatus => this.doUpdateGitHubTokenStatus(container, tokenStatus)); + this.registerGitHub1sListeners(container); + } + + registerGitHub1sListeners(container: HTMLElement) { + container.querySelector('.refresh-button')?.addEventListener('click', () => this.refreshGitHubTokenStatus(container)); + container.querySelector('.create-new-token')?.addEventListener('click', () => window?.open('https://github.com/settings/tokens/new?scopes=repo&description=GitHub1s')); + container.querySelector('.update-oauth-token')?.addEventListener('click', () => this.commandService.executeCommand('github1s.authorizing-github-with-overlay').then(() => this.refreshGitHubTokenStatus(container))); + container.querySelector('.clear-oauth-token')?.addEventListener('click', () => this.commandService.executeCommand('github1s.clear-token').then(() => this.refreshGitHubTokenStatus(container))); + container.querySelector('.show-all-commands')?.addEventListener('click', () => this.commandService.executeCommand('workbench.action.showCommands')); + container.querySelector('.show-interface-overview')?.addEventListener('click', () => this.commandService.executeCommand('workbench.action.showInterfaceOverview')); + } + + updateElementText(element: HTMLElement, text: string | number, type?: 'SUCCESS' | 'WARNING' | 'ERROR') { + if (!element) { + return; + } + element.innerText = `${text}`; + element.classList.remove('text-warning', 'text-error', 'text-success'); + if (type === 'SUCCESS') { + element.classList.add('text-success'); + } else if (type === 'WARNING') { + element.classList.add('text-warning'); + } else if (type === 'ERROR') { + element.classList.add('text-error'); + } + } + + + getGitHubTokenStatus() { + return this.commandService.executeCommand('github1s.validate-token', '', true); + } + + refreshGitHubTokenStatus(container: HTMLElement) { + const statusElement = container.querySelector('.rate-limit-status'); + this.updateElementText(statusElement, ''); + this.getGitHubTokenStatus().then(tokenStatus => { + this.doUpdateGitHubTokenStatus(container, tokenStatus); + }); + } + + doUpdateGitHubTokenStatus(container: HTMLElement, tokenStatus?: any) { + const statusElement = container.querySelector('.rate-limit-status'); + const limitElement = container.querySelector('.x-rate-limit-limit'); + const remainingElement = container.querySelector('.x-rate-limit-remaining'); + const resetElement = container.querySelector('.x-rate-limit-reset'); + const timerElement = container.querySelector('.rate-limit-reset-seconds'); + + if (!tokenStatus) { + this.updateElementText(statusElement, 'Unknown', 'WARNING'); + this.updateElementText(limitElement, 'Unknown', 'WARNING'); + this.updateElementText(remainingElement, 'Unknown', 'WARNING'); + this.updateElementText(resetElement, 'Unknown'); + this.updateElementText(timerElement, 'Unknown', 'WARNING'); + return; + } + + const textType = (value: number) => { + if (value <= 0) { + return 'ERROR'; + } + if (value > 99) { + return 'SUCCESS'; + } + return 'WARNING'; + }; + this.updateElementText(limitElement, tokenStatus.limit, textType(+tokenStatus.limit)); + this.updateElementText(remainingElement, tokenStatus.remaining, textType(+tokenStatus.remaining)); + this.updateElementText(resetElement, tokenStatus.reset); + this.updateElementText(timerElement, Math.max(tokenStatus.reset - Math.ceil(Date.now() / 1000), 0)); + + if (!tokenStatus.token) { + this.updateElementText(statusElement, 'Unauthorized', 'WARNING'); + return; + } + if (tokenStatus.valid) { + this.updateElementText(statusElement, 'Authorized', 'SUCCESS'); + return; + } + this.updateElementText(statusElement, 'Invalid Token', 'ERROR'); + } +}; diff --git a/vscode-web-github1s/src/vs/loader.js b/vscode-web-github1s/src/vs/loader.js index 10ee09e8d..27a9344b7 100644 --- a/vscode-web-github1s/src/vs/loader.js +++ b/vscode-web-github1s/src/vs/loader.js @@ -627,7 +627,7 @@ var AMDLoader; } /** * Attach load / error listeners to a script element and remove them when either one has fired. - * Implemented for browssers supporting HTML5 standard 'load' and 'error' events. + * Implemented for browsers supporting HTML5 standard 'load' and 'error' events. */ BrowserScriptLoader.prototype.attachListeners = function (script, callback, errorback) { var unbind = function () { @@ -766,6 +766,9 @@ var AMDLoader; require.resolve = function resolve(request, options) { return Module._resolveFilename(request, mod, false, options); }; + require.resolve.paths = function paths(request) { + return Module._resolveLookupPaths(request, mod); + }; require.main = process.mainModule; require.extensions = Module._extensions; require.cache = Module._cache; @@ -1245,7 +1248,7 @@ var AMDLoader; this._knownModules2 = []; this._inverseDependencies2 = []; this._inversePluginDependencies2 = new Map(); - this._currentAnnonymousDefineCall = null; + this._currentAnonymousDefineCall = null; this._recorder = null; this._buildInfoPath = []; this._buildInfoDefineStack = []; @@ -1327,18 +1330,18 @@ var AMDLoader; }; /** * Defines an anonymous module (without an id). Its name will be resolved as we receive a callback from the scriptLoader. - * @param dependecies @see defineModule + * @param dependencies @see defineModule * @param callback @see defineModule */ ModuleManager.prototype.enqueueDefineAnonymousModule = function (dependencies, callback) { - if (this._currentAnnonymousDefineCall !== null) { + if (this._currentAnonymousDefineCall !== null) { throw new Error('Can only have one anonymous define call per script file'); } var stack = null; if (this._config.isBuild()) { stack = new Error('StackLocation').stack || null; } - this._currentAnnonymousDefineCall = { + this._currentAnonymousDefineCall = { stack: stack, dependencies: dependencies, callback: callback @@ -1445,9 +1448,9 @@ var AMDLoader; * This means its code is available and has been executed. */ ModuleManager.prototype._onLoad = function (moduleId) { - if (this._currentAnnonymousDefineCall !== null) { - var defineCall = this._currentAnnonymousDefineCall; - this._currentAnnonymousDefineCall = null; + if (this._currentAnonymousDefineCall !== null) { + var defineCall = this._currentAnonymousDefineCall; + this._currentAnonymousDefineCall = null; // Hit an anonymous define call this.defineModule(this._moduleIdProvider.getStrModuleId(moduleId), defineCall.dependencies, defineCall.callback, null, defineCall.stack); } diff --git a/vscode-web-github1s/src/vs/platform/product/common/product.ts b/vscode-web-github1s/src/vs/platform/product/common/product.ts index 0ee9d5b40..ddf315879 100644 --- a/vscode-web-github1s/src/vs/platform/product/common/product.ts +++ b/vscode-web-github1s/src/vs/platform/product/common/product.ts @@ -4,15 +4,52 @@ *--------------------------------------------------------------------------------------------*/ import { FileAccess } from 'vs/base/common/network'; -import { isWeb } from 'vs/base/common/platform'; +import { globals } from 'vs/base/common/platform'; import { env } from 'vs/base/common/process'; +import { IProductConfiguration } from 'vs/base/common/product'; import { dirname, joinPath } from 'vs/base/common/resources'; -import { IProductConfiguration } from 'vs/platform/product/common/productService'; +import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; let product: IProductConfiguration; -// Web or Native (sandbox TODO@sandbox need to add all properties of product.json) -if (isWeb || typeof require === 'undefined' || typeof require.__$__nodeRequire !== 'function') { +// Native sandbox environment +if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.context !== 'undefined') { + const configuration: ISandboxConfiguration | undefined = globals.vscode.context.configuration(); + if (configuration) { + product = configuration.product; + } else { + throw new Error('Sandbox: unable to resolve product configuration from preload script.'); + } +} + +// Native node.js environment +else if (typeof require?.__$__nodeRequire === 'function') { + + // Obtain values from product.json and package.json + const rootPath = dirname(FileAccess.asFileUri('', require)); + + product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath); + const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; }; + + // Running out of sources + if (env['VSCODE_DEV']) { + Object.assign(product, { + nameShort: `${product.nameShort} Dev`, + nameLong: `${product.nameLong} Dev`, + dataFolderName: `${product.dataFolderName}-dev` + }); + } + + Object.assign(product, { + version: pkg.version + }); +} + +// Web environment or unknown +else { + // below codes are changed by github1s + const currentOrigin = window.location.origin; + // above codes are changed by github1s // Built time configuration (do NOT modify) product = { /*BUILD->INSERT_PRODUCT_CONFIGURATION*/ } as IProductConfiguration; @@ -20,11 +57,11 @@ if (isWeb || typeof require === 'undefined' || typeof require.__$__nodeRequire ! // Running out of sources if (Object.keys(product).length === 0) { Object.assign(product, { - version: '1.55.0-dev', + version: '1.60.0-dev', // below codes are changed by github1s nameShort: 'GitHub1s', nameLong: 'GitHub1s', - // below codes are changed by github1s + // above codes are changed by github1s applicationName: 'code-oss', dataFolderName: '.vscode-oss', urlProtocol: 'code-oss', @@ -34,44 +71,31 @@ if (isWeb || typeof require === 'undefined' || typeof require.__$__nodeRequire ! extensionAllowedProposedApi: [ 'ms-vscode.vscode-js-profile-flame', 'ms-vscode.vscode-js-profile-table', - 'ms-vscode.github-browser', 'ms-vscode.remotehub', - 'ms-vscode.remotehub-insiders' + 'ms-vscode.remotehub-insiders', + 'GitHub.remotehub', + 'GitHub.remotehub-insiders' ], // below codes are changed by github1s extensionsGallery: { serviceUrl: 'https://marketplace.visualstudio.com/_apis/public/gallery', cacheUrl: 'https://vscode.blob.core.windows.net/gallery/index', itemUrl: 'https://marketplace.visualstudio.com/items', + resourceUrlTemplate: `${currentOrigin}/api/vscode-unpkg/{publisher}/{name}/{version}/{path}`, controlUrl: 'https://az764295.vo.msecnd.net/extensions/marketplace.json', - recommendationsUrl: 'https://az764295.vo.msecnd.net/extensions/workspaceRecommendations.json.gz', - } - // below codes are changed by github1s - }); - } -} - -// Native (non-sandboxed) -else { - - // Obtain values from product.json and package.json - const rootPath = dirname(FileAccess.asFileUri('', require)); - - product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath); - const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; }; - - // Running out of sources - if (env['VSCODE_DEV']) { - Object.assign(product, { - nameShort: `${product.nameShort} Dev`, - nameLong: `${product.nameLong} Dev`, - dataFolderName: `${product.dataFolderName}-dev` + recommendationsUrl: 'https://az764295.vo.msecnd.net/extensions/workspaceRecommendations.json.gz' + }, + linkProtectionTrustedDomains: [ + '*.github.com', + '*.microsoft.com', + '*.github1s.com', + '*.vercel.com', + '*.sourcegraph.com', + '*.gitpod.io', + ] + // above codes are changed by github1s }); } - - Object.assign(product, { - version: pkg.version - }); } export default product; diff --git a/vscode-web-github1s/src/vs/platform/telemetry/common/telemetryService.ts b/vscode-web-github1s/src/vs/platform/telemetry/common/telemetryService.ts index 52a8eaa87..b8e7c83cb 100644 --- a/vscode-web-github1s/src/vs/platform/telemetry/common/telemetryService.ts +++ b/vscode-web-github1s/src/vs/platform/telemetry/common/telemetryService.ts @@ -3,18 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import product from 'vs/platform/product/common/product'; -import { localize } from 'vs/nls'; -import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { ITelemetryService, ITelemetryInfo, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; -import { optional } from 'vs/platform/instantiation/common/instantiation'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { cloneAndChange, mixin } from 'vs/base/common/objects'; +import { escapeRegExpCharacters } from 'vs/base/common/strings'; +import { localize } from 'vs/nls'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; +import { optional } from 'vs/platform/instantiation/common/instantiation'; +import product from 'vs/platform/product/common/product'; import { Registry } from 'vs/platform/registry/common/platform'; -import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; +import { ClassifiedEvent, GDPRClassification, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings'; +import { ITelemetryData, ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils'; export interface ITelemetryServiceConfig { appender: ITelemetryAppender; @@ -220,13 +220,15 @@ Registry.as(Extensions.Configuration).registerConfigurat 'type': 'boolean', 'markdownDescription': !product.privacyStatementUrl ? - localize('telemetry.enableTelemetry', "Enable usage data and errors to be sent to a Microsoft online service.") : - localize('telemetry.enableTelemetryMd', "Enable usage data and errors to be sent to a Microsoft online service. Read our privacy statement [here]({0}).", product.privacyStatementUrl), + localize('telemetry.enableTelemetry', "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.", product.nameLong) : + localize('telemetry.enableTelemetryMd', "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made. [Read more]({1}) about what we collect and our privacy statement.", product.nameLong, product.privacyStatementUrl), // below codes are changed by github1s // disable telemetry by default https://github.com/conwnet/github1s/issues/196 'default': false, // above codes are changed by github1s - 'tags': ['usesOnlineServices'] + 'restricted': true, + 'scope': ConfigurationScope.APPLICATION, + 'tags': ['usesOnlineServices', 'telemetry'] } } }); diff --git a/vscode-web-github1s/src/vs/workbench/api/worker/extHostExtensionService.ts b/vscode-web-github1s/src/vs/workbench/api/worker/extHostExtensionService.ts index c0c706364..391f037e3 100644 --- a/vscode-web-github1s/src/vs/workbench/api/worker/extHostExtensionService.ts +++ b/vscode-web-github1s/src/vs/workbench/api/worker/extHostExtensionService.ts @@ -12,6 +12,7 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio import { ExtensionRuntime } from 'vs/workbench/api/common/extHostTypes'; import { timeout } from 'vs/base/common/async'; import { MainContext, MainThreadConsoleShape } from 'vs/workbench/api/common/extHost.protocol'; +import { FileAccess } from 'vs/base/common/network'; namespace TrustedFunction { @@ -73,7 +74,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { protected async _beforeAlmostReadyToRunExtensions(): Promise { const mainThreadConsole = this._extHostContext.getProxy(MainContext.MainThreadConsole); - wrapConsoleMethods(mainThreadConsole); + wrapConsoleMethods(mainThreadConsole, this._initData.environment.isExtensionDevelopmentDebug); // initialize API and register actors const apiFactory = this._instaService.invokeFunction(createApiFactoryAndRegisterActors); @@ -94,7 +95,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { if (extensionId) { performance.mark(`code/extHost/willFetchExtensionCode/${extensionId.value}`); } - const response = await fetch(module.toString(true)); + const response = await fetch(FileAccess.asBrowserUri(module).toString(true)); if (extensionId) { performance.mark(`code/extHost/didFetchExtensionCode/${extensionId.value}`); } @@ -155,7 +156,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { } async $setRemoteEnvironment(_env: { [key: string]: string | null }): Promise { - throw new Error('Not supported'); + return; } private async _waitForDebuggerAttachment(waitTimeout = 5000) { @@ -176,15 +177,19 @@ function ensureSuffix(path: string, suffix: string): string { } // copied from bootstrap-fork.js -function wrapConsoleMethods(service: MainThreadConsoleShape) { +function wrapConsoleMethods(service: MainThreadConsoleShape, callToNative: boolean) { wrap('info', 'log'); wrap('log', 'log'); wrap('warn', 'warn'); wrap('error', 'error'); function wrap(method: 'error' | 'warn' | 'info' | 'log', severity: 'error' | 'warn' | 'log') { + const original = console[method]; console[method] = function () { service.$logExtensionHostMessage({ type: '__$console', severity, arguments: safeToArray(arguments) }); + if (callToNative) { + original.apply(console, arguments as any); + } }; } diff --git a/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index 50285f582..4487974fd 100644 --- a/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -16,7 +16,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { activeContrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { ActivityAction, ActivityActionViewItem, ICompositeBar, ICompositeBarColors, ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/compositeBarActions'; +import { ActivityAction, ActivityActionViewItem, IActivityHoverOptions, ICompositeBar, ICompositeBarColors, ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/compositeBarActions'; import { CATEGORIES } from 'vs/workbench/common/actions'; import { IActivity } from 'vs/workbench/common/activity'; import { ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER, ACTIVITY_BAR_ACTIVE_BACKGROUND } from 'vs/workbench/common/theme'; @@ -35,6 +35,8 @@ import { AnchorAlignment, AnchorAxisAlignment } from 'vs/base/browser/ui/context import { getTitleBarStyle } from 'vs/platform/windows/common/windows'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { IHoverService } from 'vs/workbench/services/hover/browser/hover'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; export class ViewContainerActivityAction extends ActivityAction { @@ -56,7 +58,7 @@ export class ViewContainerActivityAction extends ActivityAction { this.activity = activity; } - async run(event: unknown): Promise { + override async run(event: any | { preserveFocus: boolean }): Promise { if (event instanceof MouseEvent && event.button === 2) { return; // do not run on right click } @@ -72,11 +74,12 @@ export class ViewContainerActivityAction extends ActivityAction { const activeViewlet = this.viewletService.getActiveViewlet(); const focusBehavior = this.configurationService.getValue('workbench.activityBar.iconClickBehavior'); + const focus = (event && 'preserveFocus' in event) ? !event.preserveFocus : true; if (sideBarVisible && activeViewlet?.getId() === this.activity.id) { switch (focusBehavior) { case 'focus': this.logAction('refocus'); - this.viewletService.openViewlet(this.activity.id, true); + this.viewletService.openViewlet(this.activity.id, focus); break; case 'toggle': default: @@ -90,7 +93,7 @@ export class ViewContainerActivityAction extends ActivityAction { } this.logAction('show'); - await this.viewletService.openViewlet(this.activity.id, true); + await this.viewletService.openViewlet(this.activity.id, focus); return this.activate(); } @@ -111,17 +114,20 @@ class MenuActivityActionViewItem extends ActivityActionViewItem { action: ActivityAction, private contextMenuActionsProvider: () => IAction[], colors: (theme: IColorTheme) => ICompositeBarColors, + hoverOptions: IActivityHoverOptions, @IThemeService themeService: IThemeService, + @IHoverService hoverService: IHoverService, @IMenuService protected readonly menuService: IMenuService, @IContextMenuService protected readonly contextMenuService: IContextMenuService, @IContextKeyService protected readonly contextKeyService: IContextKeyService, - @IConfigurationService protected readonly configurationService: IConfigurationService, - @IWorkbenchEnvironmentService protected readonly environmentService: IWorkbenchEnvironmentService + @IConfigurationService configurationService: IConfigurationService, + @IWorkbenchEnvironmentService protected readonly environmentService: IWorkbenchEnvironmentService, + @IKeybindingService keybindingService: IKeybindingService, ) { - super(action, { draggable: false, colors, icon: true, hasPopup: true }, themeService); + super(action, { draggable: false, colors, icon: true, hasPopup: true, hoverOptions }, themeService, hoverService, configurationService, keybindingService); } - render(container: HTMLElement): void { + override render(container: HTMLElement): void { super.render(container); // Context menus are triggered on mouse down so that an item can be picked @@ -184,25 +190,23 @@ class MenuActivityActionViewItem extends ActivityActionViewItem { // below codes are changed by github1s // Add a button to the top of menubar which is used to jump back to GitHub -export class HomeActivityActionViewItem extends MenuActivityActionViewItem { +export class HomeActivityActionViewItem extends ActivityActionViewItem { static readonly HOME_BAR_VISIBILITY_PREFERENCE = 'workbench.activity.showHomeIndicator'; constructor( action: ActivityAction, - contextMenuActionsProvider: () => IAction[], colors: (theme: IColorTheme) => ICompositeBarColors, + hoverOptions: IActivityHoverOptions, @IThemeService themeService: IThemeService, - @IMenuService menuService: IMenuService, - @IContextMenuService contextMenuService: IContextMenuService, - @IContextKeyService contextKeyService: IContextKeyService, + @IHoverService hoverService: IHoverService, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, + @IKeybindingService keybindingService: IKeybindingService, ) { - super(MenuId.MenubarHomeMenu, action, contextMenuActionsProvider, colors, themeService, menuService, contextMenuService, contextKeyService, configurationService, environmentService); + super(action, { draggable: false, colors, icon: true, hasPopup: true, hoverOptions }, themeService, hoverService, configurationService, keybindingService); } - render(container: HTMLElement): void { + override render(container: HTMLElement): void { super.render(container); this._register(addDisposableListener(this.container, EventType.CLICK, (e: MouseEvent) => { @@ -240,7 +244,9 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { action: ActivityAction, contextMenuActionsProvider: () => IAction[], colors: (theme: IColorTheme) => ICompositeBarColors, + activityHoverOptions: IActivityHoverOptions, @IThemeService themeService: IThemeService, + @IHoverService hoverService: IHoverService, @IContextMenuService contextMenuService: IContextMenuService, @IMenuService menuService: IMenuService, @IContextKeyService contextKeyService: IContextKeyService, @@ -248,12 +254,13 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IProductService private readonly productService: IProductService, @IConfigurationService configurationService: IConfigurationService, - @IStorageService private readonly storageService: IStorageService + @IStorageService private readonly storageService: IStorageService, + @IKeybindingService keybindingService: IKeybindingService, ) { - super(MenuId.AccountsContext, action, contextMenuActionsProvider, colors, themeService, menuService, contextMenuService, contextKeyService, configurationService, environmentService); + super(MenuId.AccountsContext, action, contextMenuActionsProvider, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); } - protected async resolveMainMenuActions(accountsMenu: IMenu, disposables: DisposableStore): Promise { + protected override async resolveMainMenuActions(accountsMenu: IMenu, disposables: DisposableStore): Promise { await super.resolveMainMenuActions(accountsMenu, disposables); const otherCommands = accountsMenu.getActions(); @@ -329,7 +336,7 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { return menus; } - protected async resolveContextMenuActions(disposables: DisposableStore): Promise { + protected override async resolveContextMenuActions(disposables: DisposableStore): Promise { const actions = await super.resolveContextMenuActions(disposables); actions.unshift(...[ @@ -347,14 +354,17 @@ export class GlobalActivityActionViewItem extends MenuActivityActionViewItem { action: ActivityAction, contextMenuActionsProvider: () => IAction[], colors: (theme: IColorTheme) => ICompositeBarColors, + activityHoverOptions: IActivityHoverOptions, @IThemeService themeService: IThemeService, + @IHoverService hoverService: IHoverService, @IMenuService menuService: IMenuService, @IContextMenuService contextMenuService: IContextMenuService, @IContextKeyService contextKeyService: IContextKeyService, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, + @IKeybindingService keybindingService: IKeybindingService, ) { - super(MenuId.GlobalActivity, action, contextMenuActionsProvider, colors, themeService, menuService, contextMenuService, contextKeyService, configurationService, environmentService); + super(MenuId.GlobalActivity, action, contextMenuActionsProvider, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); } } diff --git a/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 5a92d971f..4f8e42ac8 100644 --- a/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/vscode-web-github1s/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -12,7 +12,7 @@ import { Part } from 'vs/workbench/browser/part'; import { GlobalActivityActionViewItem, ViewContainerActivityAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewContainerActivityAction, AccountsActivityActionViewItem, HomeActivityActionViewItem } from 'vs/workbench/browser/parts/activitybar/activitybarActions'; // above codes are changed by github1s import { IBadge, NumberBadge } from 'vs/workbench/services/activity/common/activity'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; +import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/layout/browser/layoutService'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle'; import { ToggleActivityBarVisibilityAction, ToggleSidebarPositionAction } from 'vs/workbench/browser/actions/layoutActions'; @@ -24,7 +24,7 @@ import { Dimension, createCSSRule, asCSSUrl, addDisposableListener, EventType } import { IStorageService, StorageScope, IStorageValueChangeEvent, StorageTarget } from 'vs/platform/storage/common/storage'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { URI, UriComponents } from 'vs/base/common/uri'; -import { ToggleCompositePinnedAction, ICompositeBarColors, ActivityAction, ICompositeActivity } from 'vs/workbench/browser/parts/compositeBarActions'; +import { ToggleCompositePinnedAction, ICompositeBarColors, ActivityAction, ICompositeActivity, IActivityHoverOptions } from 'vs/workbench/browser/parts/compositeBarActions'; import { IViewDescriptorService, ViewContainer, IViewContainerModel, ViewContainerLocation, IViewsService, getEnabledViewContainerContextKey } from 'vs/workbench/common/views'; import { IContextKeyService, ContextKeyExpr, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { assertIsDefined, isString } from 'vs/base/common/types'; @@ -45,6 +45,7 @@ import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { CATEGORIES } from 'vs/workbench/common/actions'; import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; import { StringSHA1 } from 'vs/base/common/hash'; +import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; interface IPlaceholderViewContainer { readonly id: string; @@ -163,6 +164,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { return this._register(this.instantiationService.createInstance(CompositeBar, cachedItems, { icon: true, orientation: ActionsOrientation.VERTICAL, + activityHoverOptions: this.getActivityHoverOptions(), preventLoopNavigation: true, openComposite: compositeId => this.viewsService.openViewContainer(compositeId, true), getActivityAction: compositeId => this.getCompositeActions(compositeId).activityAction, @@ -174,16 +176,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { // Menu const menuBarVisibility = getMenuBarVisibility(this.configurationService); if (menuBarVisibility === 'compact' || menuBarVisibility === 'hidden' || menuBarVisibility === 'toggle') { - topActions.push({ - id: 'toggleMenuVisibility', - label: localize('menu', "Menu"), - class: undefined, - tooltip: localize('menu', "Menu"), - checked: menuBarVisibility === 'compact', - enabled: true, - run: async () => this.configurationService.updateValue('window.menuBarVisibility', menuBarVisibility === 'compact' ? 'toggle' : 'compact'), - dispose: () => { } - }); + topActions.push(toAction({ id: 'toggleMenuVisibility', label: localize('menu', "Menu"), checked: menuBarVisibility === 'compact', run: () => this.configurationService.updateValue('window.menuBarVisibility', menuBarVisibility === 'compact' ? 'toggle' : 'compact') })); } if (topActions.length) { @@ -192,26 +185,14 @@ export class ActivitybarPart extends Part implements IActivityBarService { // Accounts actions.push(new Separator()); - actions.push({ - id: 'toggleAccountsVisibility', - label: localize('accounts', "Accounts"), - class: undefined, - tooltip: localize('accounts', "Accounts"), - checked: this.accountsVisibilityPreference, - enabled: true, - run: async () => this.accountsVisibilityPreference = !this.accountsVisibilityPreference, - dispose: () => { } - }); - + actions.push(toAction({ id: 'toggleAccountsVisibility', label: localize('accounts', "Accounts"), checked: this.accountsVisibilityPreference, run: () => this.accountsVisibilityPreference = !this.accountsVisibilityPreference })); actions.push(new Separator()); // Toggle Sidebar - actions.push(this.instantiationService.createInstance(ToggleSidebarPositionAction, ToggleSidebarPositionAction.ID, ToggleSidebarPositionAction.getLabel(this.layoutService))); + actions.push(toAction({ id: ToggleSidebarPositionAction.ID, label: ToggleSidebarPositionAction.getLabel(this.layoutService), run: () => this.instantiationService.invokeFunction(accessor => new ToggleSidebarPositionAction().run(accessor)) })); // Toggle Activity Bar - // below codes are changed by github1s typo - actions.push(toAction({ id: ToggleActivityBarVisibilityAction.ID, label: localize('hideActivityBar', "Hide Activity Bar"), run: async () => this.instantiationService.invokeFunction(accessor => new ToggleActivityBarVisibilityAction().run(accessor)) })); - // above codes are changed by github1s + actions.push(toAction({ id: ToggleActivityBarVisibilityAction.ID, label: localize('hideActivitBar', "Hide Activity Bar"), run: () => this.instantiationService.invokeFunction(accessor => new ToggleActivityBarVisibilityAction().run(accessor)) })); }, getContextMenuActionsForComposite: compositeId => this.getContextMenuActionsForComposite(compositeId), getDefaultCompositeId: () => this.viewDescriptorService.getDefaultViewContainer(this.location)!.id, @@ -227,6 +208,12 @@ export class ActivitybarPart extends Part implements IActivityBarService { })); } + private getActivityHoverOptions(): IActivityHoverOptions { + return { + position: () => this.layoutService.getSideBarPosition() === Position.LEFT ? HoverPosition.RIGHT : HoverPosition.LEFT, + }; + } + private getContextMenuActionsForComposite(compositeId: string): IAction[] { const actions: IAction[] = []; @@ -278,7 +265,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { })); } - private onDidChangeViewContainers(added: ReadonlyArray<{ container: ViewContainer, location: ViewContainerLocation; }>, removed: ReadonlyArray<{ container: ViewContainer, location: ViewContainerLocation; }>) { + private onDidChangeViewContainers(added: readonly { container: ViewContainer, location: ViewContainerLocation; }[], removed: readonly { container: ViewContainer, location: ViewContainerLocation; }[]) { removed.filter(({ location }) => location === ViewContainerLocation.Sidebar).forEach(({ container }) => this.onDidDeregisterViewContainer(container)); this.onDidRegisterViewContainers(added.filter(({ location }) => location === ViewContainerLocation.Sidebar).map(({ container }) => container)); } @@ -462,7 +449,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.registerKeyboardNavigationListeners(); } - createContentArea(parent: HTMLElement): HTMLElement { + override createContentArea(parent: HTMLElement): HTMLElement { this.element = parent; this.content = document.createElement('div'); @@ -545,7 +532,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.homeBarContainer.classList.add('home-bar'); this.homeBar = this._register(new ActionBar(this.homeBarContainer, { - actionViewItemProvider: action => this.instantiationService.createInstance(HomeActivityActionViewItem, action as ActivityAction, () => this.compositeBar.getContextMenuActions(), (theme: IColorTheme) => this.getActivitybarItemColors(theme)), + actionViewItemProvider: action => this.instantiationService.createInstance(HomeActivityActionViewItem, action as ActivityAction, (theme: IColorTheme) => this.getActivitybarItemColors(theme), this.getActivityHoverOptions()), orientation: ActionsOrientation.VERTICAL, ariaLabel: localize('home', "Open on GitHub"), animated: false, @@ -571,11 +558,11 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.globalActivityActionBar = this._register(new ActionBar(container, { actionViewItemProvider: action => { if (action.id === 'workbench.actions.manage') { - return this.instantiationService.createInstance(GlobalActivityActionViewItem, action as ActivityAction, () => this.compositeBar.getContextMenuActions(), (theme: IColorTheme) => this.getActivitybarItemColors(theme)); + return this.instantiationService.createInstance(GlobalActivityActionViewItem, action as ActivityAction, () => this.compositeBar.getContextMenuActions(), (theme: IColorTheme) => this.getActivitybarItemColors(theme), this.getActivityHoverOptions()); } if (action.id === 'workbench.actions.accounts') { - return this.instantiationService.createInstance(AccountsActivityActionViewItem, action as ActivityAction, () => this.compositeBar.getContextMenuActions(), (theme: IColorTheme) => this.getActivitybarItemColors(theme)); + return this.instantiationService.createInstance(AccountsActivityActionViewItem, action as ActivityAction, () => this.compositeBar.getContextMenuActions(), (theme: IColorTheme) => this.getActivitybarItemColors(theme), this.getActivityHoverOptions()); } throw new Error(`No view item for action '${action.id}'`); @@ -647,7 +634,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { return compositeActions; } - private onDidRegisterViewContainers(viewContainers: ReadonlyArray): void { + private onDidRegisterViewContainers(viewContainers: readonly ViewContainer[]): void { for (const viewContainer of viewContainers) { this.addComposite(viewContainer); @@ -814,7 +801,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.compositeBar.focus(); } - updateStyles(): void { + override updateStyles(): void { super.updateStyles(); const container = assertIsDefined(this.getContainer()); @@ -839,7 +826,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { }; } - layout(width: number, height: number): void { + override layout(width: number, height: number): void { if (!this.layoutService.isVisible(Parts.ACTIVITYBAR_PART)) { return; } @@ -863,7 +850,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { return viewContainer && this.viewDescriptorService.getViewContainerLocation(viewContainer) === this.location ? viewContainer : undefined; } - private getViewContainers(): ReadonlyArray { + private getViewContainers(): readonly ViewContainer[] { return this.viewDescriptorService.getViewContainersByLocation(this.location); } @@ -1017,14 +1004,12 @@ export class ActivitybarPart extends Part implements IActivityBarService { return this._placeholderViewContainersValue; } - // below codes are changed by github1s typo - private set placeholderViewContainersValue(placeholderViewContainsValue: string) { - if (this.placeholderViewContainersValue !== placeholderViewContainsValue) { - this._placeholderViewContainersValue = placeholderViewContainsValue; - this.setStoredPlaceholderViewContainersValue(placeholderViewContainsValue); + private set placeholderViewContainersValue(placeholderViewContainesValue: string) { + if (this.placeholderViewContainersValue !== placeholderViewContainesValue) { + this._placeholderViewContainersValue = placeholderViewContainesValue; + this.setStoredPlaceholderViewContainersValue(placeholderViewContainesValue); } } - // above codes are changed by github1s private getStoredPlaceholderViewContainersValue(): string { return this.storageService.get(ActivitybarPart.PLACEHOLDER_VIEW_CONTAINERS, StorageScope.GLOBAL, '[]'); diff --git a/vscode-web-github1s/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/vscode-web-github1s/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index bf60c532b..488135954 100644 --- a/vscode-web-github1s/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/vscode-web-github1s/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -42,6 +42,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { Schemas } from 'vs/base/common/network'; import { withNullAsUndefined } from 'vs/base/common/types'; import { Codicon, iconRegistry } from 'vs/base/common/codicons'; +import { getVirtualWorkspaceLocation } from 'vs/platform/remote/common/remoteHosts'; export class TitlebarPart extends Part implements ITitleService { @@ -165,6 +166,7 @@ export class TitlebarPart extends Part implements ITitleService { if (activeEditor) { this.activeEditorListeners.add(activeEditor.onDidChangeDirty(() => this.titleUpdater.schedule())); this.activeEditorListeners.add(activeEditor.onDidChangeLabel(() => this.titleUpdater.schedule())); + this.activeEditorListeners.add(activeEditor.onDidChangeCapabilities(() => this.titleUpdater.schedule())); } } @@ -278,6 +280,19 @@ export class TitlebarPart extends Part implements ITitleService { folder = withNullAsUndefined(this.contextService.getWorkspaceFolder(editorResource)); } + // Compute remote + // vscode-remtoe: use as is + // otherwise figure out if we have a virtual folder opened + let remoteName: string | undefined = undefined; + if (this.environmentService.remoteAuthority) { + remoteName = this.labelService.getHostLabel(Schemas.vscodeRemote, this.environmentService.remoteAuthority); + } else { + const virtualWorkspaceLocation = getVirtualWorkspaceLocation(workspace); + if (virtualWorkspaceLocation) { + remoteName = this.labelService.getHostLabel(virtualWorkspaceLocation.scheme, virtualWorkspaceLocation.authority); + } + } + // Variables const activeEditorShort = editor ? editor.getTitle(Verbosity.SHORT) : ''; const activeEditorMedium = editor ? editor.getTitle(Verbosity.MEDIUM) : activeEditorShort; @@ -291,10 +306,9 @@ export class TitlebarPart extends Part implements ITitleService { const folderPath = folder ? this.labelService.getUriLabel(folder.uri) : ''; const dirty = editor?.isDirty() && !editor.isSaving() ? TitlebarPart.TITLE_DIRTY : ''; const appName = this.productService.nameLong; - const remoteName = this.labelService.getHostLabel(Schemas.vscodeRemote, this.environmentService.remoteAuthority); const separator = this.configurationService.getValue('window.titleSeparator'); const titleTemplate = this.configurationService.getValue('window.title'); - // below codes are changed by github1s + // below codes are changed by github1s TEMP!! const [owner = 'conwnet', repo = 'github1s'] = URI.parse(window.location.href).path.split('/').filter(Boolean); // above codes are changed by github1s @@ -348,7 +362,7 @@ export class TitlebarPart extends Part implements ITitleService { this._register(this.customMenubar.onVisibilityChange(e => this.onMenubarVisibilityChanged(e))); } - createContentArea(parent: HTMLElement): HTMLElement { + override createContentArea(parent: HTMLElement): HTMLElement { this.element = parent; // App Icon (Native Windows/Linux and Web) @@ -420,7 +434,7 @@ export class TitlebarPart extends Part implements ITitleService { return this.element; } - updateStyles(): void { + override updateStyles(): void { super.updateStyles(); // Part container @@ -507,9 +521,9 @@ export class TitlebarPart extends Part implements ITitleService { if (getTitleBarStyle(this.configurationService) === 'custom') { // Only prevent zooming behavior on macOS or when the menubar is not visible if ((!isWeb && isMacintosh) || this.currentMenubarVisibility === 'hidden') { - this.title.style.zoom = `${1 / getZoomFactor()}`; + (this.title.style as any).zoom = `${1 / getZoomFactor()}`; } else { - this.title.style.zoom = ''; + (this.title.style as any).zoom = ''; } runAtThisOrScheduleAtNextAnimationFrame(() => this.adjustTitleMarginToCenter()); @@ -521,7 +535,7 @@ export class TitlebarPart extends Part implements ITitleService { } } - layout(width: number, height: number): void { + override layout(width: number, height: number): void { this.updateLayout(new Dimension(width, height)); super.layoutContents(width, height); diff --git a/vscode-web-github1s/src/vs/workbench/browser/web.main.ts b/vscode-web-github1s/src/vs/workbench/browser/web.main.ts index 624857b32..1bce19949 100644 --- a/vscode-web-github1s/src/vs/workbench/browser/web.main.ts +++ b/vscode-web-github1s/src/vs/workbench/browser/web.main.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { mark } from 'vs/base/common/performance'; -import { domContentLoaded, detectFullscreen, getCookieValue } from 'vs/base/browser/dom'; +import { domContentLoaded, detectFullscreen, getCookieValue, WebFileSystemAccess } from 'vs/base/browser/dom'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { ILogService, ConsoleLogger, MultiplexLogService, getLogLevel } from 'vs/platform/log/common/log'; import { ConsoleLogInAutomationLogger } from 'vs/platform/log/browser/log'; @@ -60,6 +60,11 @@ import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/ur import { UriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentityService'; import { BrowserWindow } from 'vs/workbench/browser/window'; import { ITimerService } from 'vs/workbench/services/timer/browser/timerService'; +import { WorkspaceTrustEnablementService, WorkspaceTrustManagementService } from 'vs/workbench/services/workspaces/common/workspaceTrust'; +import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust'; +import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { safeStringify } from 'vs/base/common/objects'; class BrowserMain extends Disposable { @@ -79,10 +84,9 @@ class BrowserMain extends Disposable { } async open(): Promise { - const services = await this.initServices(); - await domContentLoaded(); - mark('code/willStartWorkbench'); + // Init services and wait for DOM to be ready in parallel + const [services] = await Promise.all([this.initServices(), domContentLoaded()]); // Create Workbench const workbench = new Workbench(this.domElement, services.serviceCollection, services.logService); @@ -97,23 +101,29 @@ class BrowserMain extends Disposable { this._register(instantiationService.createInstance(BrowserWindow)); // Logging - services.logService.trace('workbench configuration', JSON.stringify(this.configuration)); + services.logService.trace('workbench configuration', safeStringify(this.configuration)); // Return API Facade return instantiationService.invokeFunction(accessor => { const commandService = accessor.get(ICommandService); const lifecycleService = accessor.get(ILifecycleService); const timerService = accessor.get(ITimerService); + const openerService = accessor.get(IOpenerService); + const productService = accessor.get(IProductService); return { commands: { executeCommand: (command, ...args) => commandService.executeCommand(command, ...args) }, env: { + uriScheme: productService.urlProtocol, async retrievePerformanceMarks() { await timerService.whenReady(); return timerService.getPerformanceMarks(); + }, + async openUri(uri: URI): Promise { + return openerService.open(uri, {}); } }, shutdown: () => lifecycleService.shutdown() @@ -130,7 +140,7 @@ class BrowserMain extends Disposable { } })); this._register(workbench.onWillShutdown(() => storageService.close())); - this._register(workbench.onShutdown(() => this.dispose())); + this._register(workbench.onDidShutdown(() => this.dispose())); } private async initServices(): Promise<{ serviceCollection: ServiceCollection, configurationService: IWorkbenchConfigurationService, logService: ILogService, storageService: BrowserStorageService }> { @@ -174,7 +184,7 @@ class BrowserMain extends Disposable { serviceCollection.set(IFileService, fileService); await this.registerFileSystemProviders(environmentService, fileService, remoteAgentService, logService, logsPath); - // IURIIdentityService + // URI Identity const uriIdentityService = new UriIdentityService(fileService); serviceCollection.set(IUriIdentityService, uriIdentityService); @@ -191,7 +201,7 @@ class BrowserMain extends Disposable { return service; }), - this.createStorageService(payload, environmentService, fileService, logService).then(service => { + this.createStorageService(payload, logService).then(service => { // Storage serviceCollection.set(IStorageService, service); @@ -200,6 +210,17 @@ class BrowserMain extends Disposable { }) ]); + // Workspace Trust Service + const workspaceTrustEnablementService = new WorkspaceTrustEnablementService(configurationService, environmentService); + serviceCollection.set(IWorkspaceTrustEnablementService, workspaceTrustEnablementService); + + const workspaceTrustManagementService = new WorkspaceTrustManagementService(configurationService, remoteAuthorityResolverService, storageService, uriIdentityService, environmentService, configurationService, workspaceTrustEnablementService); + serviceCollection.set(IWorkspaceTrustManagementService, workspaceTrustManagementService); + + // Update workspace trust so that configuration is updated accordingly + configurationService.updateWorkspaceTrust(workspaceTrustManagementService.isWorkspaceTrusted()); + this._register(workspaceTrustManagementService.onDidChangeTrust(() => configurationService.updateWorkspaceTrust(workspaceTrustManagementService.isWorkspaceTrusted()))); + // Request Service const requestService = new BrowserRequestService(remoteAgentService, configurationService, logService); serviceCollection.set(IRequestService, requestService); @@ -219,9 +240,7 @@ class BrowserMain extends Disposable { await userDataInitializationService.initializeRequiredResources(); // Important: Reload only local user configuration after initializing - // below codes are changed by github1s typo - // Reloading complete configuration blocks workbench until remote configuration is loaded. - // above codes are changed by github1s + // Reloading complete configuraiton blocks workbench until remote configuration is loaded. await configurationService.reloadLocalUserConfiguration(); mark('code/didInitRequiredUserData'); @@ -237,7 +256,7 @@ class BrowserMain extends Disposable { (async () => { let indexedDBLogProvider: IFileSystemProvider | null = null; try { - indexedDBLogProvider = await indexedDB.createFileSystemProvider(logsPath.scheme, INDEXEDDB_LOGS_OBJECT_STORE); + indexedDBLogProvider = await indexedDB.createFileSystemProvider(logsPath.scheme, INDEXEDDB_LOGS_OBJECT_STORE, false); } catch (error) { onUnexpectedError(error); } @@ -250,7 +269,7 @@ class BrowserMain extends Disposable { logService.logger = new MultiplexLogService(coalesce([ new ConsoleLogger(logService.getLevel()), - new FileLogger('window', environmentService.logFile, logService.getLevel(), fileService), + new FileLogger('window', environmentService.logFile, logService.getLevel(), false, fileService), // Extension development test CLI: forward everything to test runner environmentService.isExtensionDevelopment && !!environmentService.extensionTestsLocationURI ? new ConsoleLogInAutomationLogger(logService.getLevel()) : undefined ])); @@ -267,11 +286,20 @@ class BrowserMain extends Disposable { // User data let indexedDBUserDataProvider: IIndexedDBFileSystemProvider | null = null; try { - indexedDBUserDataProvider = await indexedDB.createFileSystemProvider(Schemas.userData, INDEXEDDB_USERDATA_OBJECT_STORE); + indexedDBUserDataProvider = await indexedDB.createFileSystemProvider(Schemas.userData, INDEXEDDB_USERDATA_OBJECT_STORE, true); } catch (error) { onUnexpectedError(error); } - fileService.registerProvider(Schemas.userData, indexedDBUserDataProvider || new InMemoryFileSystemProvider()); + + let userDataProvider: IFileSystemProvider | undefined; + if (indexedDBUserDataProvider) { + userDataProvider = indexedDBUserDataProvider; + } else { + logService.info('using in-memory user data provider'); + userDataProvider = new InMemoryFileSystemProvider(); + } + + fileService.registerProvider(Schemas.userData, userDataProvider); if (indexedDBUserDataProvider) { registerAction2(class ResetUserDataAction extends Action2 { @@ -289,22 +317,31 @@ class BrowserMain extends Disposable { async run(accessor: ServicesAccessor): Promise { const dialogService = accessor.get(IDialogService); const hostService = accessor.get(IHostService); + const storageService = accessor.get(IStorageService); const result = await dialogService.confirm({ message: localize('reset user data message', "Would you like to reset your data (settings, keybindings, extensions, snippets and UI State) and reload?") }); if (result.confirmed) { await indexedDBUserDataProvider?.reset(); + if (storageService instanceof BrowserStorageService) { + await storageService.clear(); + } } hostService.reload(); } }); } + + if (WebFileSystemAccess.supported(window)) { + fileService.registerProvider(Schemas.file, new HTMLFileSystemProvider()); + } + fileService.registerProvider(Schemas.tmp, new InMemoryFileSystemProvider()); } - private async createStorageService(payload: IWorkspaceInitializationPayload, environmentService: IWorkbenchEnvironmentService, fileService: IFileService, logService: ILogService): Promise { - const storageService = new BrowserStorageService(payload, environmentService, fileService); + private async createStorageService(payload: IWorkspaceInitializationPayload, logService: ILogService): Promise { + const storageService = new BrowserStorageService(payload, logService); try { await storageService.initialize(); diff --git a/vscode-web-github1s/src/vs/workbench/browser/workbench.contribution.ts b/vscode-web-github1s/src/vs/workbench/browser/workbench.contribution.ts index 8d60f334c..25a8eb81e 100644 --- a/vscode-web-github1s/src/vs/workbench/browser/workbench.contribution.ts +++ b/vscode-web-github1s/src/vs/workbench/browser/workbench.contribution.ts @@ -10,9 +10,10 @@ import { isMacintosh, isWindows, isLinux, isWeb, isNative } from 'vs/base/common import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; import { isStandalone } from 'vs/base/browser/browser'; +const registry = Registry.as(ConfigurationExtensions.Configuration); + // Configuration (function registerConfiguration(): void { - const registry = Registry.as(ConfigurationExtensions.Configuration); // Workbench registry.registerConfiguration({ @@ -88,10 +89,16 @@ import { isStandalone } from 'vs/base/browser/browser'; }, 'workbench.editor.untitled.hint': { 'type': 'string', - 'enum': ['text', 'button', 'hidden', 'default'], - 'default': 'default', + 'enum': ['text', 'hidden'], + 'default': 'text', 'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'untitledHint' }, "Controls if the untitled hint should be inline text in the editor or a floating button or hidden.") }, + 'workbench.editor.languageDetection': { + type: 'boolean', + default: true, + description: localize('workbench.editor.languageDetection', "Controls whether the language in a text editor is automatically detected unless the language has been explicitly set by the language picker. This can also be scoped by language so you can specify which languages you do not want to be switched off of. This is useful for languages like Markdown that often contain other languages that might trick language detection into thinking it's the embedded language and not Markdown."), + scope: ConfigurationScope.LANGUAGE_OVERRIDABLE + }, 'workbench.editor.tabCloseButton': { 'type': 'string', 'enum': ['left', 'right', 'off'], @@ -181,6 +188,19 @@ import { isStandalone } from 'vs/base/browser/browser'; 'description': localize('closeEmptyGroups', "Controls the behavior of empty editor groups when the last tab in the group is closed. When enabled, empty groups will automatically close. When disabled, empty groups will remain part of the grid."), 'default': true }, + 'workbench.editor.experimentalAutoLockGroups': { + 'type': 'object', + 'description': localize('workbench.editor.experimentalAutoLockGroups', "Experimental: If an editor matching one of the listed types is opened as the first in an editor group and more than one group is open, the group is automatically locked. Locked groups will only be used for opening editors when explicitly chosen by user gesture (e.g. drag and drop), but not by default. Consequently the active editor in a locked group is less likely to be replaced accidentally with a different editor."), + 'default': { + 'terminalEditor': true, + 'mainThreadWebview-markdown.preview': false, + 'default': false + }, + 'additionalProperties': { + 'type': 'boolean', + 'enum': [true, false] + }, + }, 'workbench.editor.revealIfOpen': { 'type': 'boolean', 'description': localize('revealIfOpen', "Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group."), @@ -193,10 +213,15 @@ import { isStandalone } from 'vs/base/browser/browser'; }, 'workbench.editor.restoreViewState': { 'type': 'boolean', - 'description': localize('restoreViewState', "Restores the last view state (e.g. scroll position) when re-opening textual editors after they have been closed."), + 'markdownDescription': localize('restoreViewState', "Restores the last editor view state (e.g. scroll position) when re-opening editors after they have been closed. Editor view state is stored per editor group and discarded when a group closes. Use the `#workbench.editor.sharedViewState#` setting to use the last known view state across all editor groups in case no previous view state was found for a editor group."), 'default': true, 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE }, + 'workbench.editor.sharedViewState': { + 'type': 'boolean', + 'description': localize('sharedViewState', "Preserves the most recent editor view state (e.g. scroll position) across all editor groups and restores that if no specific editor view state is found for the editor group."), + 'default': false + }, 'workbench.editor.centeredLayoutAutoResize': { 'type': 'boolean', 'default': true, diff --git a/vscode-web-github1s/src/vs/workbench/common/editor/resourceEditorInput.ts b/vscode-web-github1s/src/vs/workbench/common/editor/resourceEditorInput.ts new file mode 100644 index 000000000..33870509a --- /dev/null +++ b/vscode-web-github1s/src/vs/workbench/common/editor/resourceEditorInput.ts @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { localize } from 'vs/nls'; +import { Verbosity, IEditorInputWithPreferredResource, EditorInputCapabilities } from 'vs/workbench/common/editor'; +import { EditorInput } from 'vs/workbench/common/editor/editorInput'; +import { URI } from 'vs/base/common/uri'; +import { IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { dirname, isEqual } from 'vs/base/common/resources'; + +/** + * The base class for all editor inputs that open resources. + */ +export abstract class AbstractResourceEditorInput extends EditorInput implements IEditorInputWithPreferredResource { + + override get capabilities(): EditorInputCapabilities { + let capabilities = EditorInputCapabilities.None; + + if (this.fileService.canHandleResource(this.resource)) { + if (this.fileService.hasCapability(this.resource, FileSystemProviderCapabilities.Readonly)) { + capabilities |= EditorInputCapabilities.Readonly; + } + } else { + capabilities |= EditorInputCapabilities.Untitled; + } + + return capabilities; + } + + private _preferredResource: URI; + get preferredResource(): URI { return this._preferredResource; } + + constructor( + readonly resource: URI, + preferredResource: URI | undefined, + @ILabelService protected readonly labelService: ILabelService, + @IFileService protected readonly fileService: IFileService + ) { + super(); + + this._preferredResource = preferredResource || resource; + + this.registerListeners(); + } + + private registerListeners(): void { + + // Clear our labels on certain label related events + this._register(this.labelService.onDidChangeFormatters(e => this.onLabelEvent(e.scheme))); + this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e => this.onLabelEvent(e.scheme))); + this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e => this.onLabelEvent(e.scheme))); + } + + private onLabelEvent(scheme: string): void { + if (scheme === this._preferredResource.scheme) { + this.updateLabel(); + } + } + + private updateLabel(): void { + + // Clear any cached labels from before + this._name = undefined; + this._shortDescription = undefined; + this._mediumDescription = undefined; + this._longDescription = undefined; + this._shortTitle = undefined; + this._mediumTitle = undefined; + this._longTitle = undefined; + + // Trigger recompute of label + this._onDidChangeLabel.fire(); + } + + setPreferredResource(preferredResource: URI): void { + if (!isEqual(preferredResource, this._preferredResource)) { + this._preferredResource = preferredResource; + + this.updateLabel(); + } + } + + private _name: string | undefined = undefined; + override getName(skipDecorate?: boolean): string { + if (typeof this._name !== 'string') { + this._name = this.labelService.getUriBasenameLabel(this._preferredResource); + } + + return skipDecorate ? this._name : this.decorateLabel(this._name); + } + + override getDescription(verbosity = Verbosity.MEDIUM): string | undefined { + switch (verbosity) { + case Verbosity.SHORT: + return this.shortDescription; + case Verbosity.LONG: + return this.longDescription; + case Verbosity.MEDIUM: + default: + return this.mediumDescription; + } + } + + private _shortDescription: string | undefined = undefined; + private get shortDescription(): string { + if (typeof this._shortDescription !== 'string') { + this._shortDescription = this.labelService.getUriBasenameLabel(dirname(this._preferredResource)); + } + + return this._shortDescription; + } + + private _mediumDescription: string | undefined = undefined; + private get mediumDescription(): string { + if (typeof this._mediumDescription !== 'string') { + this._mediumDescription = this.labelService.getUriLabel(dirname(this._preferredResource), { relative: true }); + } + + return this._mediumDescription; + } + + private _longDescription: string | undefined = undefined; + private get longDescription(): string { + if (typeof this._longDescription !== 'string') { + this._longDescription = this.labelService.getUriLabel(dirname(this._preferredResource)); + } + + return this._longDescription; + } + + private _shortTitle: string | undefined = undefined; + private get shortTitle(): string { + if (typeof this._shortTitle !== 'string') { + this._shortTitle = this.getName(true /* skip decorations */); + } + + return this._shortTitle; + } + + private _mediumTitle: string | undefined = undefined; + private get mediumTitle(): string { + if (typeof this._mediumTitle !== 'string') { + this._mediumTitle = this.labelService.getUriLabel(this._preferredResource, { relative: true }); + } + + return this._mediumTitle; + } + + private _longTitle: string | undefined = undefined; + private get longTitle(): string { + if (typeof this._longTitle !== 'string') { + this._longTitle = this.labelService.getUriLabel(this._preferredResource); + } + + return this._longTitle; + } + + override getTitle(verbosity?: Verbosity): string { + switch (verbosity) { + case Verbosity.SHORT: + return this.decorateLabel(this.shortTitle); + case Verbosity.LONG: + return this.decorateLabel(this.longTitle); + default: + case Verbosity.MEDIUM: + return this.decorateLabel(this.mediumTitle); + } + } + + private decorateLabel(label: string): string { + // below codes are changed by github1s + // remove read-only tips + return decorateFileEditorLabel(label, { orphaned: false, readonly: false }); + // above codes are changed by github1s + } + + isOrphaned(): boolean { + return false; + } +} + +export function decorateFileEditorLabel(label: string, state: { orphaned: boolean, readonly: boolean }): string { + if (state.orphaned && state.readonly) { + return localize('orphanedReadonlyFile', "{0} (deleted, read-only)", label); + } + + if (state.orphaned) { + return localize('orphanedFile', "{0} (deleted)", label); + } + + if (state.readonly) { + return localize('readonlyFile', "{0} (read-only)", label); + } + + return label; +} diff --git a/vscode-web-github1s/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/vscode-web-github1s/src/vs/workbench/contrib/files/browser/views/explorerView.ts index 369ad5e5a..0e4cbe2e0 100644 --- a/vscode-web-github1s/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/vscode-web-github1s/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri'; import * as perf from 'vs/base/common/performance'; import { IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; import { memoize } from 'vs/base/common/decorators'; -import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, ExplorerResourceCut, ExplorerResourceMoveableToTrash, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, ExplorerCompressedLastFocusContext, ExplorerResourceAvailableEditorIdsContext, VIEW_ID, VIEWLET_ID } from 'vs/workbench/contrib/files/common/files'; +import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, ExplorerResourceCut, ExplorerResourceMoveableToTrash, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, ExplorerCompressedLastFocusContext, ExplorerResourceAvailableEditorIdsContext, VIEW_ID, VIEWLET_ID, ExplorerResourceNotReadonlyContext } from 'vs/workbench/contrib/files/common/files'; import { FileCopiedContext, NEW_FILE_COMMAND_ID, NEW_FOLDER_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileActions'; import * as DOM from 'vs/base/browser/dom'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; @@ -19,7 +19,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IContextKeyService, IContextKey, ContextKeyEqualsExpr } from 'vs/platform/contextkey/common/contextkey'; +import { IContextKeyService, IContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { ResourceContextKey } from 'vs/workbench/common/resources'; import { IDecorationsService } from 'vs/workbench/services/decorations/browser/decorations'; import { WorkbenchCompressibleAsyncDataTree } from 'vs/platform/list/browser/listService'; @@ -55,6 +55,7 @@ import { IExplorerService } from 'vs/workbench/contrib/files/browser/files'; import { Codicon } from 'vs/base/common/codicons'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; +import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService'; interface IExplorerViewColors extends IColorMapping { listDropBackground?: ColorValue | undefined; @@ -130,6 +131,11 @@ export function getContext(focus: ExplorerItem[], selection: ExplorerItem[], res return [focusedStat]; } +export interface IExplorerViewContainerDelegate { + willOpenElement(event?: UIEvent): void; + didOpenElement(event?: UIEvent): void; +} + export class ExplorerView extends ViewPane { static readonly TREE_VIEW_STATE_STORAGE_KEY: string = 'workbench.explorer.treeViewState'; @@ -155,27 +161,27 @@ export class ExplorerView extends ViewPane { private horizontalScrolling: boolean | undefined; - // Refresh is needed on the initial explorer open - private shouldRefresh = true; private dragHandler!: DelayedDragHandler; private autoReveal: boolean | 'focusNoScroll' = false; private decorationsProvider: ExplorerDecorationsProvider | undefined; constructor( options: IViewPaneOptions, + private readonly delegate: IExplorerViewContainerDelegate, @IContextMenuService contextMenuService: IContextMenuService, @IViewDescriptorService viewDescriptorService: IViewDescriptorService, @IInstantiationService instantiationService: IInstantiationService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @IProgressService private readonly progressService: IProgressService, @IEditorService private readonly editorService: IEditorService, + @IEditorResolverService private readonly editorResolverService: IEditorResolverService, @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, @IKeybindingService keybindingService: IKeybindingService, @IContextKeyService contextKeyService: IContextKeyService, @IConfigurationService configurationService: IConfigurationService, @IDecorationsService private readonly decorationService: IDecorationsService, @ILabelService private readonly labelService: ILabelService, - @IThemeService protected themeService: IWorkbenchThemeService, + @IThemeService themeService: IWorkbenchThemeService, @IMenuService private readonly menuService: IMenuService, @ITelemetryService telemetryService: ITelemetryService, @IExplorerService private readonly explorerService: IExplorerService, @@ -207,11 +213,11 @@ export class ExplorerView extends ViewPane { return this.labelService.getWorkspaceLabel(this.contextService.getWorkspace()); } - get title(): string { + override get title(): string { return this.name; } - set title(_: string) { + override set title(_: string) { // noop } @@ -232,7 +238,7 @@ export class ExplorerView extends ViewPane { // Split view methods - protected renderHeader(container: HTMLElement): void { + protected override renderHeader(container: HTMLElement): void { super.renderHeader(container); // Expand on drag over @@ -259,12 +265,12 @@ export class ExplorerView extends ViewPane { setHeader(); } - protected layoutBody(height: number, width: number): void { + protected override layoutBody(height: number, width: number): void { super.layoutBody(height, width); this.tree.layout(height, width); } - renderBody(container: HTMLElement): void { + override renderBody(container: HTMLElement): void { super.renderBody(container); this.container = container; @@ -293,18 +299,15 @@ export class ExplorerView extends ViewPane { this._register(this.onDidChangeBodyVisibility(async visible => { if (visible) { - // If a refresh was requested and we are now visible, run it - if (this.shouldRefresh) { - this.shouldRefresh = false; - await this.setTreeInput(); - } + // Always refresh explorer when it becomes visible to compensate for missing file events #126817 + await this.setTreeInput(); // Find resource to focus from active editor input if set this.selectActiveFile(true); } })); } - focus(): void { + override focus(): void { this.tree.domFocus(); const focused = this.tree.getFocus(); @@ -444,7 +447,12 @@ export class ExplorerView extends ViewPane { return; } this.telemetryService.publicLog2('workbenchActionExecuted', { id: 'workbench.files.openFile', from: 'explorer' }); - await this.editorService.openEditor({ resource: element.resource, options: { preserveFocus: e.editorOptions.preserveFocus, pinned: e.editorOptions.pinned } }, e.sideBySide ? SIDE_GROUP : ACTIVE_GROUP); + try { + this.delegate.willOpenElement(e.browserEvent); + await this.editorService.openEditor({ resource: element.resource, options: { preserveFocus: e.editorOptions.preserveFocus, pinned: e.editorOptions.pinned } }, e.sideBySide ? SIDE_GROUP : ACTIVE_GROUP); + } finally { + this.delegate.didOpenElement(); + } } })); @@ -492,16 +500,17 @@ export class ExplorerView extends ViewPane { } private setContextKeys(stat: ExplorerItem | null | undefined): void { - const isSingleFolder = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER; - const resource = stat ? stat.resource : isSingleFolder ? this.contextService.getWorkspace().folders[0].uri : null; + const folders = this.contextService.getWorkspace().folders; + const resource = stat ? stat.resource : folders[folders.length - 1].uri; + stat = stat || this.explorerService.findClosest(resource); this.resourceContext.set(resource); - this.folderContext.set((isSingleFolder && !stat) || !!stat && stat.isDirectory); + this.folderContext.set(!!stat && stat.isDirectory); this.readonlyContext.set(!!stat && stat.isReadonly); - this.rootContext.set(!stat || (stat && stat.isRoot)); + this.rootContext.set(!!stat && stat.isRoot); if (resource) { - const overrides = resource ? this.editorService.getEditorOverrides(resource, undefined, undefined) : []; - this.availableEditorIdsContext.set(overrides.map(([, entry]) => entry.id).join(',')); + const overrides = resource ? this.editorResolverService.getEditorIds(resource) : []; + this.availableEditorIdsContext.set(overrides.join(',')); } else { this.availableEditorIdsContext.reset(); } @@ -589,8 +598,7 @@ export class ExplorerView extends ViewPane { */ refresh(recursive: boolean, item?: ExplorerItem, cancelEditing: boolean = true): Promise { if (!this.tree || !this.isBodyVisible() || (item && !this.tree.hasNode(item))) { - // Tree node doesn't exist yet - this.shouldRefresh = true; + // Tree node doesn't exist yet, when it becomes visible we will refresh return Promise.resolve(undefined); } @@ -604,31 +612,7 @@ export class ExplorerView extends ViewPane { }); } - focusNeighbourIfItemFocused(item: ExplorerItem): void { - const focus = this.tree.getFocus(); - if (focus.length !== 1) { - return; - } - const compressedController = this.renderer.getCompressedNavigationController(focus[0]) || this.renderer.getCompressedNavigationController(item); - const indexOfItem = compressedController?.items.indexOf(item) || -1; - const itemsCompressedTogether = compressedController && (compressedController.items.indexOf(focus[0]) >= 0) && (indexOfItem >= 0); - - if (focus[0] === item || itemsCompressedTogether) { - if (itemsCompressedTogether && indexOfItem > 0 && item.parent) { - // In case of compact items just focus the parent if it is part of the compact item. So the focus stays - this.tree.setFocus([item.parent]); - } else { - this.tree.focusNext(); - const newFocus = this.tree.getFocus(); - if (newFocus.length === 1 && newFocus[0] === item) { - // There was no next item to focus, focus the previous one - this.tree.focusPrevious(); - } - } - } - } - - getOptimalWidth(): number { + override getOptimalWidth(): number { const parentNode = this.tree.getHTMLElement(); const childNodes = ([] as HTMLElement[]).slice.call(parentNode.querySelectorAll('.explorer-item .label-name')); // select all file labels @@ -637,7 +621,6 @@ export class ExplorerView extends ViewPane { async setTreeInput(): Promise { if (!this.isBodyVisible()) { - this.shouldRefresh = true; return Promise.resolve(undefined); } @@ -689,7 +672,7 @@ export class ExplorerView extends ViewPane { this.progressService.withProgress({ location: ProgressLocation.Explorer, - delay: this.layoutService.isRestored() ? 800 : 1200 // less ugly initial startup + delay: this.layoutService.isRestored() ? 800 : 1500 // reduce progress visibility when still restoring }, _progress => promise); await promise; @@ -700,9 +683,7 @@ export class ExplorerView extends ViewPane { } public async selectResource(resource: URI | undefined, reveal = this.autoReveal, retry = 0): Promise { - // below codes are changed by github1s typo - // do no retry more than once to prevent infinite loops in cases of inconsistent model - // above codes are changed by github1s + // do no retry more than once to prevent inifinite loops in cases of inconsistent model if (retry === 2) { return; } @@ -844,7 +825,7 @@ export class ExplorerView extends ViewPane { } } - dispose(): void { + override dispose(): void { if (this.dragHandler) { this.dragHandler.dispose(); } @@ -872,10 +853,11 @@ registerAction2(class extends Action2 { title: nls.localize('createNewFile', "New File"), f1: false, icon: Codicon.newFile, + precondition: ExplorerResourceNotReadonlyContext, menu: { id: MenuId.ViewTitle, group: 'navigation', - when: ContextKeyEqualsExpr.create('view', VIEW_ID), + when: ContextKeyExpr.equals('view', VIEW_ID), order: 10 } }); @@ -894,10 +876,11 @@ registerAction2(class extends Action2 { title: nls.localize('createNewFolder', "New Folder"), f1: false, icon: Codicon.newFolder, + precondition: ExplorerResourceNotReadonlyContext, menu: { id: MenuId.ViewTitle, group: 'navigation', - when: ContextKeyEqualsExpr.create('view', VIEW_ID), + when: ContextKeyExpr.equals('view', VIEW_ID), order: 20 } }); @@ -919,7 +902,7 @@ registerAction2(class extends Action2 { menu: { id: MenuId.ViewTitle, group: 'navigation', - when: ContextKeyEqualsExpr.create('view', VIEW_ID), + when: ContextKeyExpr.equals('view', VIEW_ID), order: 30 } }); @@ -943,7 +926,7 @@ registerAction2(class extends Action2 { menu: { id: MenuId.ViewTitle, group: 'navigation', - when: ContextKeyEqualsExpr.create('view', VIEW_ID), + when: ContextKeyExpr.equals('view', VIEW_ID), order: 40 } }); diff --git a/vscode-web-github1s/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/vscode-web-github1s/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts deleted file mode 100644 index cf912d9fb..000000000 --- a/vscode-web-github1s/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ /dev/null @@ -1,406 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { localize } from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; -import { EncodingMode, IFileEditorInput, Verbosity, GroupIdentifier, IMoveResult, isTextEditorPane } from 'vs/workbench/common/editor'; -import { AbstractTextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput'; -import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; -import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; -import { ITextFileService, TextFileEditorModelState, TextFileLoadReason, TextFileOperationError, TextFileOperationResult, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IReference, dispose, DisposableStore } from 'vs/base/common/lifecycle'; -import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { FILE_EDITOR_INPUT_ID, TEXT_FILE_EDITOR_ID, BINARY_FILE_EDITOR_ID } from 'vs/workbench/contrib/files/common/files'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { isEqual } from 'vs/base/common/resources'; -import { Event } from 'vs/base/common/event'; -import { IEditorViewState } from 'vs/editor/common/editorCommon'; -import { Schemas } from 'vs/base/common/network'; - -const enum ForceOpenAs { - None, - Text, - Binary -} - -/** - * A file editor input is the input type for the file editor of file system resources. - */ -export class FileEditorInput extends AbstractTextResourceEditorInput implements IFileEditorInput { - - private preferredName: string | undefined; - private preferredDescription: string | undefined; - private preferredEncoding: string | undefined; - private preferredMode: string | undefined; - - private forceOpenAs: ForceOpenAs = ForceOpenAs.None; - - private model: ITextFileEditorModel | undefined = undefined; - private cachedTextFileModelReference: IReference | undefined = undefined; - - private readonly modelListeners = this._register(new DisposableStore()); - - constructor( - resource: URI, - preferredResource: URI | undefined, - preferredName: string | undefined, - preferredDescription: string | undefined, - preferredEncoding: string | undefined, - preferredMode: string | undefined, - @IInstantiationService private readonly instantiationService: IInstantiationService, - @ITextFileService textFileService: ITextFileService, - @ITextModelService private readonly textModelResolverService: ITextModelService, - @ILabelService labelService: ILabelService, - @IFileService fileService: IFileService, - @IFilesConfigurationService filesConfigurationService: IFilesConfigurationService, - @IEditorService editorService: IEditorService, - @IEditorGroupsService editorGroupService: IEditorGroupsService - ) { - super(resource, preferredResource, editorService, editorGroupService, textFileService, labelService, fileService, filesConfigurationService); - - this.model = this.textFileService.files.get(resource); - - if (preferredName) { - this.setPreferredName(preferredName); - } - - if (preferredDescription) { - this.setPreferredDescription(preferredDescription); - } - - if (preferredEncoding) { - this.setPreferredEncoding(preferredEncoding); - } - - if (preferredMode) { - this.setPreferredMode(preferredMode); - } - - // If a file model already exists, make sure to wire it in - if (this.model) { - this.registerModelListeners(this.model); - } - } - - protected registerListeners(): void { - super.registerListeners(); - - // Attach to model that matches our resource once created - this._register(this.textFileService.files.onDidCreate(model => this.onDidCreateTextFileModel(model))); - } - - private onDidCreateTextFileModel(model: ITextFileEditorModel): void { - - // Once the text file model is created, we keep it inside - // the input to be able to implement some methods properly - if (isEqual(model.resource, this.resource)) { - this.model = model; - - this.registerModelListeners(model); - } - } - - private registerModelListeners(model: ITextFileEditorModel): void { - - // Clear any old - this.modelListeners.clear(); - - // re-emit some events from the model - this.modelListeners.add(model.onDidChangeDirty(() => this._onDidChangeDirty.fire())); - this.modelListeners.add(model.onDidChangeOrphaned(() => this._onDidChangeLabel.fire())); - - // important: treat save errors as potential dirty change because - // a file that is in save conflict or error will report dirty even - // if auto save is turned on. - this.modelListeners.add(model.onDidSaveError(() => this._onDidChangeDirty.fire())); - - // remove model association once it gets disposed - this.modelListeners.add(Event.once(model.onDispose)(() => { - this.modelListeners.clear(); - this.model = undefined; - })); - } - - getTypeId(): string { - return FILE_EDITOR_INPUT_ID; - } - - getName(): string { - return this.preferredName || this.decorateLabel(super.getName()); - } - - setPreferredName(name: string): void { - if (!this.allowLabelOverride()) { - return; // block for specific schemes we own - } - - if (this.preferredName !== name) { - this.preferredName = name; - - this._onDidChangeLabel.fire(); - } - } - - private allowLabelOverride(): boolean { - return this.resource.scheme !== Schemas.file && this.resource.scheme !== Schemas.vscodeRemote && this.resource.scheme !== Schemas.userData; - } - - getPreferredName(): string | undefined { - return this.preferredName; - } - - getDescription(verbosity?: Verbosity): string | undefined { - return this.preferredDescription || super.getDescription(verbosity); - } - - setPreferredDescription(description: string): void { - if (!this.allowLabelOverride()) { - return; // block for specific schemes we own - } - - if (this.preferredDescription !== description) { - this.preferredDescription = description; - - this._onDidChangeLabel.fire(); - } - } - - getPreferredDescription(): string | undefined { - return this.preferredDescription; - } - - getTitle(verbosity: Verbosity): string { - switch (verbosity) { - case Verbosity.SHORT: - return this.decorateLabel(super.getName()); - case Verbosity.MEDIUM: - case Verbosity.LONG: - return this.decorateLabel(super.getTitle(verbosity)); - } - } - - private decorateLabel(label: string): string { - // below codes are changed by github1s - // remove read-only tips - return label; - // above codes are changed by github1s - } - - getEncoding(): string | undefined { - if (this.model) { - return this.model.getEncoding(); - } - - return this.preferredEncoding; - } - - getPreferredEncoding(): string | undefined { - return this.preferredEncoding; - } - - setEncoding(encoding: string, mode: EncodingMode): void { - this.setPreferredEncoding(encoding); - - this.model?.setEncoding(encoding, mode); - } - - setPreferredEncoding(encoding: string): void { - this.preferredEncoding = encoding; - - // encoding is a good hint to open the file as text - this.setForceOpenAsText(); - } - - getPreferredMode(): string | undefined { - return this.preferredMode; - } - - setMode(mode: string): void { - this.setPreferredMode(mode); - - this.model?.setMode(mode); - } - - setPreferredMode(mode: string): void { - this.preferredMode = mode; - - // mode is a good hint to open the file as text - this.setForceOpenAsText(); - } - - setForceOpenAsText(): void { - this.forceOpenAs = ForceOpenAs.Text; - } - - setForceOpenAsBinary(): void { - this.forceOpenAs = ForceOpenAs.Binary; - } - - isDirty(): boolean { - return !!(this.model?.isDirty()); - } - - isReadonly(): boolean { - if (this.model) { - return this.model.isReadonly(); - } - - return super.isReadonly(); - } - - isSaving(): boolean { - if (this.model?.hasState(TextFileEditorModelState.SAVED) || this.model?.hasState(TextFileEditorModelState.CONFLICT) || this.model?.hasState(TextFileEditorModelState.ERROR)) { - return false; // require the model to be dirty and not in conflict or error state - } - - // Note: currently not checking for ModelState.PENDING_SAVE for a reason - // because we currently miss an event for this state change on editors - // and it could result in bad UX where an editor can be closed even though - // it shows up as dirty and has not finished saving yet. - - return super.isSaving(); - } - - getPreferredEditorId(candidates: string[]): string { - return this.forceOpenAs === ForceOpenAs.Binary ? BINARY_FILE_EDITOR_ID : TEXT_FILE_EDITOR_ID; - } - - resolve(): Promise { - - // Resolve as binary - if (this.forceOpenAs === ForceOpenAs.Binary) { - return this.doResolveAsBinary(); - } - - // Resolve as text - return this.doResolveAsText(); - } - - private async doResolveAsText(): Promise { - try { - - // Resolve resource via text file service and only allow - // to open binary files if we are instructed so - await this.textFileService.files.resolve(this.resource, { - mode: this.preferredMode, - encoding: this.preferredEncoding, - reload: { async: true }, // trigger a reload of the model if it exists already but do not wait to show the model - allowBinary: this.forceOpenAs === ForceOpenAs.Text, - reason: TextFileLoadReason.EDITOR - }); - - // This is a bit ugly, because we first resolve the model and then resolve a model reference. the reason being that binary - // or very large files do not resolve to a text file model but should be opened as binary files without text. First calling into - // resolve() ensures we are not creating model references for these kind of resources. - // In addition we have a bit of payload to take into account (encoding, reload) that the text resolver does not handle yet. - if (!this.cachedTextFileModelReference) { - this.cachedTextFileModelReference = await this.textModelResolverService.createModelReference(this.resource) as IReference; - } - - const model = this.cachedTextFileModelReference.object; - - // It is possible that this input was disposed before the model - // finished resolving. As such, we need to make sure to dispose - // the model reference to not leak it. - if (this.isDisposed()) { - this.disposeModelReference(); - } - - return model; - } catch (error) { - - // In case of an error that indicates that the file is binary or too large, just return with the binary editor model - if ( - (error).textFileOperationResult === TextFileOperationResult.FILE_IS_BINARY || - (error).fileOperationResult === FileOperationResult.FILE_TOO_LARGE - ) { - return this.doResolveAsBinary(); - } - - // Bubble any other error up - throw error; - } - } - - private async doResolveAsBinary(): Promise { - return this.instantiationService.createInstance(BinaryEditorModel, this.preferredResource, this.getName()).load(); - } - - isResolved(): boolean { - return !!this.model; - } - - rename(group: GroupIdentifier, target: URI): IMoveResult { - return { - editor: { - resource: target, - encoding: this.getEncoding(), - options: { - viewState: this.getViewStateFor(group) - } - } - }; - } - - private getViewStateFor(group: GroupIdentifier): IEditorViewState | undefined { - for (const editorPane of this.editorService.visibleEditorPanes) { - if (editorPane.group.id === group && isEqual(editorPane.input.resource, this.resource)) { - if (isTextEditorPane(editorPane)) { - return editorPane.getViewState(); - } - } - } - - return undefined; - } - - matches(otherInput: unknown): boolean { - if (otherInput === this) { - return true; - } - - if (otherInput instanceof FileEditorInput) { - return isEqual(otherInput.resource, this.resource); - } - - return false; - } - - dispose(): void { - - // Model - this.model = undefined; - - // Model reference - this.disposeModelReference(); - - super.dispose(); - } - - private disposeModelReference(): void { - dispose(this.cachedTextFileModelReference); - this.cachedTextFileModelReference = undefined; - } -} - -export function decorateFileEditorLabel(label: string, state: { orphaned: boolean, readonly: boolean }): string { - if (state.orphaned && state.readonly) { - return localize('orphanedReadonlyFile', "{0} (deleted, read-only)", label); - } - - if (state.orphaned) { - return localize('orphanedFile', "{0} (deleted)", label); - } - - if (state.readonly) { - return localize('readonlyFile', "{0} (read-only)", label); - } - - return label; -} diff --git a/vscode-web-github1s/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/vscode-web-github1s/src/vs/workbench/contrib/terminal/browser/terminalService.ts deleted file mode 100644 index 4e1c12cee..000000000 --- a/vscode-web-github1s/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ /dev/null @@ -1,1027 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { timeout } from 'vs/base/common/async'; -import { debounce, throttle } from 'vs/base/common/decorators'; -import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { basename } from 'vs/base/common/path'; -import { isMacintosh, isWeb, isWindows, OperatingSystem } from 'vs/base/common/platform'; -import { FindReplaceState } from 'vs/editor/contrib/find/findState'; -import * as nls from 'vs/nls'; -import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; -import { IPickOptions, IQuickInputButton, IQuickInputService, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ILocalTerminalService, IShellLaunchConfig, ITerminalLaunchError, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalShellType, WindowsShellType } from 'vs/platform/terminal/common/terminal'; -import { ThemeIcon } from 'vs/platform/theme/common/themeService'; -import { IViewDescriptorService, IViewsService, ViewContainerLocation } from 'vs/workbench/common/views'; -import { IRemoteTerminalService, ITerminalExternalLinkProvider, ITerminalInstance, ITerminalService, ITerminalTab, TerminalConnectionState } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper'; -import { TerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminalInstance'; -import { TerminalTab } from 'vs/workbench/contrib/terminal/browser/terminalTab'; -import { TerminalViewPane } from 'vs/workbench/contrib/terminal/browser/terminalView'; -import { IAvailableProfilesRequest, IRemoteTerminalAttachTarget, ITerminalProfile, IStartExtensionTerminalRequest, ITerminalConfigHelper, ITerminalNativeWindowsDelegate, ITerminalProcessExtHostProxy, KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE, KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN, KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED, KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE, LinuxDistro, TERMINAL_VIEW_ID, ITerminalProfileObject, ITerminalExecutable, ITerminalProfileSource } from 'vs/workbench/contrib/terminal/common/terminal'; -import { escapeNonWindowsPath } from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { ILifecycleService, ShutdownReason, WillShutdownEvent } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { configureTerminalProfileIcon } from 'vs/workbench/contrib/terminal/browser/terminalIcons'; -import { equals } from 'vs/base/common/objects'; - -interface IExtHostReadyEntry { - promise: Promise; - resolve: () => void; -} - -export class TerminalService implements ITerminalService { - public _serviceBrand: undefined; - - private _isShuttingDown: boolean; - private _terminalFocusContextKey: IContextKey; - private _terminalShellTypeContextKey: IContextKey; - private _terminalAltBufferActiveContextKey: IContextKey; - private _findWidgetVisible: IContextKey; - private _terminalTabs: ITerminalTab[] = []; - private _backgroundedTerminalInstances: ITerminalInstance[] = []; - private get _terminalInstances(): ITerminalInstance[] { - return this._terminalTabs.reduce((p, c) => p.concat(c.terminalInstances), []); - } - private _findState: FindReplaceState; - private _extHostsReady: { [authority: string]: IExtHostReadyEntry | undefined } = {}; - private _activeTabIndex: number; - private _linkProviders: Set = new Set(); - private _linkProviderDisposables: Map = new Map(); - private _processSupportContextKey: IContextKey; - - public get activeTabIndex(): number { return this._activeTabIndex; } - public get terminalInstances(): ITerminalInstance[] { return this._terminalInstances; } - public get terminalTabs(): ITerminalTab[] { return this._terminalTabs; } - public get isProcessSupportRegistered(): boolean { return !!this._processSupportContextKey.get(); } - - private _configHelper: TerminalConfigHelper; - private _terminalContainer: HTMLElement | undefined; - private _nativeWindowsDelegate: ITerminalNativeWindowsDelegate | undefined; - private _remoteTerminalsInitPromise: Promise | undefined; - private _localTerminalsInitPromise: Promise | undefined; - private _connectionState: TerminalConnectionState; - - private _availableProfiles: ITerminalProfile[] | undefined; - - public get configHelper(): ITerminalConfigHelper { return this._configHelper; } - - private readonly _onActiveTabChanged = new Emitter(); - public get onActiveTabChanged(): Event { return this._onActiveTabChanged.event; } - private readonly _onInstanceCreated = new Emitter(); - public get onInstanceCreated(): Event { return this._onInstanceCreated.event; } - private readonly _onInstanceDisposed = new Emitter(); - public get onInstanceDisposed(): Event { return this._onInstanceDisposed.event; } - private readonly _onInstanceProcessIdReady = new Emitter(); - public get onInstanceProcessIdReady(): Event { return this._onInstanceProcessIdReady.event; } - private readonly _onInstanceLinksReady = new Emitter(); - public get onInstanceLinksReady(): Event { return this._onInstanceLinksReady.event; } - private readonly _onInstanceRequestStartExtensionTerminal = new Emitter(); - public get onInstanceRequestStartExtensionTerminal(): Event { return this._onInstanceRequestStartExtensionTerminal.event; } - private readonly _onInstanceDimensionsChanged = new Emitter(); - public get onInstanceDimensionsChanged(): Event { return this._onInstanceDimensionsChanged.event; } - private readonly _onInstanceMaximumDimensionsChanged = new Emitter(); - public get onInstanceMaximumDimensionsChanged(): Event { return this._onInstanceMaximumDimensionsChanged.event; } - private readonly _onInstancesChanged = new Emitter(); - public get onInstancesChanged(): Event { return this._onInstancesChanged.event; } - private readonly _onInstanceTitleChanged = new Emitter(); - public get onInstanceTitleChanged(): Event { return this._onInstanceTitleChanged.event; } - private readonly _onActiveInstanceChanged = new Emitter(); - public get onActiveInstanceChanged(): Event { return this._onActiveInstanceChanged.event; } - private readonly _onTabDisposed = new Emitter(); - public get onTabDisposed(): Event { return this._onTabDisposed.event; } - private readonly _onRequestAvailableProfiles = new Emitter(); - public get onRequestAvailableProfiles(): Event { return this._onRequestAvailableProfiles.event; } - private readonly _onDidRegisterProcessSupport = new Emitter(); - public get onDidRegisterProcessSupport(): Event { return this._onDidRegisterProcessSupport.event; } - private readonly _onDidChangeConnectionState = new Emitter(); - public get onDidChangeConnectionState(): Event { return this._onDidChangeConnectionState.event; } - public get connectionState(): TerminalConnectionState { return this._connectionState; } - private readonly _onProfilesConfigChanged = new Emitter(); - public get onProfilesConfigChanged(): Event { return this._onProfilesConfigChanged.event; } - private readonly _localTerminalService?: ILocalTerminalService; - - constructor( - @IContextKeyService private _contextKeyService: IContextKeyService, - @IWorkbenchLayoutService private _layoutService: IWorkbenchLayoutService, - @ILifecycleService lifecycleService: ILifecycleService, - @IDialogService private _dialogService: IDialogService, - @IInstantiationService private _instantiationService: IInstantiationService, - @IRemoteAgentService private _remoteAgentService: IRemoteAgentService, - @IQuickInputService private _quickInputService: IQuickInputService, - @IConfigurationService private _configurationService: IConfigurationService, - @IViewsService private _viewsService: IViewsService, - @IViewDescriptorService private readonly _viewDescriptorService: IViewDescriptorService, - @IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService, - @IRemoteTerminalService private readonly _remoteTerminalService: IRemoteTerminalService, - @ITelemetryService private readonly _telemetryService: ITelemetryService, - @IExtensionService private readonly _extensionService: IExtensionService, - @optional(ILocalTerminalService) localTerminalService: ILocalTerminalService - ) { - this._localTerminalService = localTerminalService; - - this._activeTabIndex = 0; - this._isShuttingDown = false; - this._findState = new FindReplaceState(); - lifecycleService.onBeforeShutdown(async e => e.veto(this._onBeforeShutdown(e.reason), 'veto.terminal')); - lifecycleService.onWillShutdown(e => this._onWillShutdown(e)); - this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this._contextKeyService); - this._terminalShellTypeContextKey = KEYBINDING_CONTEXT_TERMINAL_SHELL_TYPE.bindTo(this._contextKeyService); - this._terminalAltBufferActiveContextKey = KEYBINDING_CONTEXT_TERMINAL_ALT_BUFFER_ACTIVE.bindTo(this._contextKeyService); - this._findWidgetVisible = KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE.bindTo(this._contextKeyService); - this._configHelper = this._instantiationService.createInstance(TerminalConfigHelper); - this.onTabDisposed(tab => this._removeTab(tab)); - this.onActiveTabChanged(() => { - const instance = this.getActiveInstance(); - this._onActiveInstanceChanged.fire(instance ? instance : undefined); - }); - this.onInstanceLinksReady(instance => this._setInstanceLinkProviders(instance)); - this._handleInstanceContextKeys(); - this._processSupportContextKey = KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED.bindTo(this._contextKeyService); - this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null); - - this._configurationService.onDidChangeConfiguration(async e => { - if (e.affectsConfiguration('terminal.integrated.profiles.windows') || - e.affectsConfiguration('terminal.integrated.profiles.osx') || - e.affectsConfiguration('terminal.integrated.profiles.linux') || - e.affectsConfiguration('terminal.integrated.useWslProfiles')) { - this._updateAvailableProfilesNow(); - } - }); - - const enableTerminalReconnection = this.configHelper.config.enablePersistentSessions; - - const conn = this._remoteAgentService.getConnection(); - const remoteAuthority = conn ? conn.remoteAuthority : 'null'; - this._whenExtHostReady(remoteAuthority).then(() => { - this._updateAvailableProfiles(); - }); - - // Connect to the extension host if it's there, set the connection state to connected when - // it's done. This should happen even when there is no extension host. - this._connectionState = TerminalConnectionState.Connecting; - let initPromise: Promise; - if (!!this._environmentService.remoteAuthority && enableTerminalReconnection) { - initPromise = this._remoteTerminalsInitPromise = this._reconnectToRemoteTerminals(); - } else if (enableTerminalReconnection) { - initPromise = this._localTerminalsInitPromise = this._reconnectToLocalTerminals(); - } else { - initPromise = Promise.resolve(); - } - initPromise.then(() => this._setConnected()); - } - - private _setConnected() { - this._connectionState = TerminalConnectionState.Connected; - this._onDidChangeConnectionState.fire(); - } - - private async _reconnectToRemoteTerminals(): Promise { - // Reattach to all remote terminals - const layoutInfo = await this._remoteTerminalService.getTerminalLayoutInfo(); - const reconnectCounter = this._recreateTerminalTabs(layoutInfo); - /* __GDPR__ - "terminalReconnection" : { - "count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - const data = { - count: reconnectCounter - }; - this._telemetryService.publicLog('terminalReconnection', data); - // now that terminals have been restored, - // attach listeners to update remote when terminals are changed - this.attachProcessLayoutListeners(true); - } - - private async _reconnectToLocalTerminals(): Promise { - if (!this._localTerminalService) { - return; - } - // Reattach to all local terminals - const layoutInfo = await this._localTerminalService.getTerminalLayoutInfo(); - if (layoutInfo && layoutInfo.tabs.length > 0) { - this._recreateTerminalTabs(layoutInfo); - } - // now that terminals have been restored, - // attach listeners to update local state when terminals are changed - this.attachProcessLayoutListeners(false); - } - - private _recreateTerminalTabs(layoutInfo?: ITerminalsLayoutInfo): number { - let reconnectCounter = 0; - let activeTab: ITerminalTab | undefined; - if (layoutInfo) { - layoutInfo.tabs.forEach(tabLayout => { - const terminalLayouts = tabLayout.terminals.filter(t => t.terminal && t.terminal.isOrphan); - if (terminalLayouts.length) { - reconnectCounter += terminalLayouts.length; - let terminalInstance: ITerminalInstance | undefined; - let tab: ITerminalTab | undefined; - terminalLayouts.forEach((terminalLayout) => { - if (!terminalInstance) { - // create tab and terminal - terminalInstance = this.createTerminal({ attachPersistentProcess: terminalLayout.terminal! }); - tab = this._getTabForInstance(terminalInstance); - if (tabLayout.isActive) { - activeTab = tab; - } - } else { - // add split terminals to this tab - this.splitInstance(terminalInstance, { attachPersistentProcess: terminalLayout.terminal! }); - } - }); - const activeInstance = this.terminalInstances.find(t => { - return t.shellLaunchConfig.attachPersistentProcess?.id === tabLayout.activePersistentProcessId; - }); - if (activeInstance) { - this.setActiveInstance(activeInstance); - } - tab?.resizePanes(tabLayout.terminals.map(terminal => terminal.relativeSize)); - } - }); - if (layoutInfo.tabs.length) { - this.setActiveTabByIndex(activeTab ? this.terminalTabs.indexOf(activeTab) : 0); - } - } - return reconnectCounter; - } - - private attachProcessLayoutListeners(isRemote: boolean): void { - this.onActiveTabChanged(() => isRemote ? this._updateRemoteState() : this._updateLocalState()); - this.onActiveInstanceChanged(() => isRemote ? this._updateRemoteState() : this._updateLocalState()); - this.onInstancesChanged(() => isRemote ? this._updateRemoteState() : this._updateLocalState()); - // The state must be updated when the terminal is relaunched, otherwise the persistent - // terminal ID will be stale and the process will be leaked. - this.onInstanceProcessIdReady(() => isRemote ? this._updateRemoteState() : this._updateLocalState()); - } - - public setNativeWindowsDelegate(delegate: ITerminalNativeWindowsDelegate): void { - this._nativeWindowsDelegate = delegate; - } - - public setLinuxDistro(linuxDistro: LinuxDistro): void { - this._configHelper.setLinuxDistro(linuxDistro); - } - - private _handleInstanceContextKeys(): void { - const terminalIsOpenContext = KEYBINDING_CONTEXT_TERMINAL_IS_OPEN.bindTo(this._contextKeyService); - const updateTerminalContextKeys = () => { - terminalIsOpenContext.set(this.terminalInstances.length > 0); - }; - this.onInstancesChanged(() => updateTerminalContextKeys()); - } - - public getActiveOrCreateInstance(): ITerminalInstance { - const activeInstance = this.getActiveInstance(); - return activeInstance ? activeInstance : this.createTerminal(undefined); - } - - public requestStartExtensionTerminal(proxy: ITerminalProcessExtHostProxy, cols: number, rows: number): Promise { - // The initial request came from the extension host, no need to wait for it - return new Promise(callback => { - this._onInstanceRequestStartExtensionTerminal.fire({ proxy, cols, rows, callback }); - }); - } - - public async extHostReady(remoteAuthority: string): Promise { - this._createExtHostReadyEntry(remoteAuthority); - this._extHostsReady[remoteAuthority]!.resolve(); - } - - public getAvailableProfiles(): ITerminalProfile[] { - this._updateAvailableProfiles(); - return this._availableProfiles || []; - } - - private async _getWorkspaceProfilePermissions(profile: ITerminalProfile): Promise { - const platformKey = await this._getPlatformKey(); - const profiles = this._configurationService.inspect<{ [key: string]: ITerminalProfileObject }>(`terminal.integrated.profiles.${platformKey}`); - if (!profiles || !profiles.workspaceValue || !profiles.defaultValue) { - return false; - } - const workspaceProfile = Object.entries(profiles.workspaceValue).find(p => p[0] === profile.profileName); - const defaultProfile = Object.entries(profiles.defaultValue).find(p => p[0] === profile.profileName); - if (workspaceProfile && defaultProfile && workspaceProfile[0] === defaultProfile[0]) { - let result = !this._terminalProfileObjectEqual(workspaceProfile[1], defaultProfile[1]); - return result; - } else if (!workspaceProfile && !defaultProfile) { - // user profile - return false; - } else { - // this key is missing from either default or the workspace config - return true; - } - } - - private _terminalProfileObjectEqual(one?: ITerminalProfileObject, two?: ITerminalProfileObject): boolean { - if (one === null && two === null) { - return true; - } else if ((one as ITerminalExecutable).path && (two as ITerminalExecutable).path) { - const oneExec = (one as ITerminalExecutable); - const twoExec = (two as ITerminalExecutable); - return ((Array.isArray(oneExec.path) && Array.isArray(twoExec.path) && oneExec.path.length === twoExec.path.length && oneExec.path.every((p, index) => p === twoExec.path[index])) || - (oneExec.path === twoExec.path) - ) && ((Array.isArray(oneExec.args) && Array.isArray(twoExec.args) && oneExec.args?.every((a, index) => a === twoExec.args?.[index])) || - (oneExec.args === twoExec.args) - ); - } else if ((one as ITerminalProfileSource).source && (two as ITerminalProfileSource).source) { - const oneSource = (one as ITerminalProfileSource); - const twoSource = (two as ITerminalProfileSource); - return oneSource.source === twoSource.source - && ((Array.isArray(oneSource.args) && Array.isArray(twoSource.args) && oneSource.args?.every((a, index) => a === twoSource.args?.[index])) || - (oneSource.args === twoSource.args) - ); - } - return false; - } - - // when relevant config changes, update without debouncing - private async _updateAvailableProfilesNow(): Promise { - const result = await this._detectProfiles(true); - for (const p of result) { - p.isWorkspaceProfile = await this._getWorkspaceProfilePermissions(p); - } - if (!equals(result, this._availableProfiles)) { - this._availableProfiles = result; - this._onProfilesConfigChanged.fire(); - } - } - - // avoid checking this very often, every ten seconds shoulds suffice - @throttle(10000) - private _updateAvailableProfiles(): Promise { - return this._updateAvailableProfilesNow(); - } - - private async _detectProfiles(quickLaunchOnly: boolean): Promise { - await this._extensionService.whenInstalledExtensionsRegistered(); - // Wait for the remoteAuthority to be ready (and listening for events) before firing - // the event to spawn the ext host process - const conn = this._remoteAgentService.getConnection(); - const remoteAuthority = conn ? conn.remoteAuthority : 'null'; - await this._whenExtHostReady(remoteAuthority); - return new Promise(r => this._onRequestAvailableProfiles.fire({ callback: r, quickLaunchOnly: quickLaunchOnly })); - } - - private async _whenExtHostReady(remoteAuthority: string): Promise { - this._createExtHostReadyEntry(remoteAuthority); - return this._extHostsReady[remoteAuthority]!.promise; - } - - private _createExtHostReadyEntry(remoteAuthority: string): void { - if (this._extHostsReady[remoteAuthority]) { - return; - } - - let resolve!: () => void; - const promise = new Promise(r => resolve = r); - this._extHostsReady[remoteAuthority] = { promise, resolve }; - } - - private _onBeforeShutdown(reason: ShutdownReason): boolean | Promise { - if (this.terminalInstances.length === 0) { - // No terminal instances, don't veto - return false; - } - - const shouldPersistTerminals = this._configHelper.config.enablePersistentSessions && reason === ShutdownReason.RELOAD; - if (this.configHelper.config.confirmOnExit && !shouldPersistTerminals) { - return this._onBeforeShutdownAsync(); - } - - this._isShuttingDown = true; - - return false; - } - - private async _onBeforeShutdownAsync(): Promise { - // veto if configured to show confirmation and the user chose not to exit - const veto = await this._showTerminalCloseConfirmation(); - if (!veto) { - this._isShuttingDown = true; - } - return veto; - } - - private _onWillShutdown(e: WillShutdownEvent): void { - // Don't touch processes if the shutdown was a result of reload as they will be reattached - const shouldPersistTerminals = this._configHelper.config.enablePersistentSessions && e.reason === ShutdownReason.RELOAD; - if (shouldPersistTerminals) { - this.terminalInstances.forEach(instance => instance.detachFromProcess()); - return; - } - - // Force dispose of all terminal instances, don't force immediate disposal of the terminal - // processes on Windows as an additional mitigation for https://github.com/microsoft/vscode/issues/71966 - // which causes the pty host to become unresponsive, disconnecting all terminals across all - // windows - this.terminalInstances.forEach(instance => instance.dispose(!isWindows)); - - // below codes are changed by github1s - // the _localTerminalService may not exists in github1s - this._localTerminalService?.setTerminalLayoutInfo(undefined); - // above codes are changed by github1s - } - - public getTabLabels(): string[] { - return this._terminalTabs.filter(tab => tab.terminalInstances.length > 0).map((tab, index) => { - return `${index + 1}: ${tab.title ? tab.title : ''}`; - }); - } - - public getFindState(): FindReplaceState { - return this._findState; - } - - @debounce(500) - private _updateRemoteState(): void { - if (!!this._environmentService.remoteAuthority) { - const state: ITerminalsLayoutInfoById = { - tabs: this.terminalTabs.map(t => t.getLayoutInfo(t === this.getActiveTab())) - }; - this._remoteTerminalService.setTerminalLayoutInfo(state); - } - } - - @debounce(500) - private _updateLocalState(): void { - const state: ITerminalsLayoutInfoById = { - tabs: this.terminalTabs.map(t => t.getLayoutInfo(t === this.getActiveTab())) - }; - this._localTerminalService!.setTerminalLayoutInfo(state); - } - - private _removeTab(tab: ITerminalTab): void { - // Get the index of the tab and remove it from the list - const index = this._terminalTabs.indexOf(tab); - const activeTab = this.getActiveTab(); - const activeTabIndex = activeTab ? this._terminalTabs.indexOf(activeTab) : -1; - const wasActiveTab = tab === activeTab; - if (index !== -1) { - this._terminalTabs.splice(index, 1); - } - - // Adjust focus if the tab was active - if (wasActiveTab && this._terminalTabs.length > 0) { - // TODO: Only focus the new tab if the removed tab had focus? - // const hasFocusOnExit = tab.activeInstance.hadFocusOnExit; - const newIndex = index < this._terminalTabs.length ? index : this._terminalTabs.length - 1; - this.setActiveTabByIndex(newIndex); - const activeInstance = this.getActiveInstance(); - if (activeInstance) { - activeInstance.focus(true); - } - } else if (activeTabIndex >= this._terminalTabs.length) { - const newIndex = this._terminalTabs.length - 1; - this.setActiveTabByIndex(newIndex); - } - - // Hide the panel if there are no more instances, provided that VS Code is not shutting - // down. When shutting down the panel is locked in place so that it is restored upon next - // launch. - if (this._terminalTabs.length === 0 && !this._isShuttingDown) { - this.hidePanel(); - this._onActiveInstanceChanged.fire(undefined); - } - - // Fire events - this._onInstancesChanged.fire(); - if (wasActiveTab) { - this._onActiveTabChanged.fire(); - } - } - - public refreshActiveTab(): void { - // Fire active instances changed - this._onActiveTabChanged.fire(); - } - - public getActiveTab(): ITerminalTab | null { - if (this._activeTabIndex < 0 || this._activeTabIndex >= this._terminalTabs.length) { - return null; - } - return this._terminalTabs[this._activeTabIndex]; - } - - public getActiveInstance(): ITerminalInstance | null { - const tab = this.getActiveTab(); - if (!tab) { - return null; - } - return tab.activeInstance; - } - - public doWithActiveInstance(callback: (terminal: ITerminalInstance) => T): T | void { - const instance = this.getActiveInstance(); - if (instance) { - return callback(instance); - } - } - - public getInstanceFromId(terminalId: number): ITerminalInstance | undefined { - let bgIndex = -1; - this._backgroundedTerminalInstances.forEach((terminalInstance, i) => { - if (terminalInstance.instanceId === terminalId) { - bgIndex = i; - } - }); - if (bgIndex !== -1) { - return this._backgroundedTerminalInstances[bgIndex]; - } - try { - return this.terminalInstances[this._getIndexFromId(terminalId)]; - } catch { - return undefined; - } - } - - public getInstanceFromIndex(terminalIndex: number): ITerminalInstance { - return this.terminalInstances[terminalIndex]; - } - - public setActiveInstance(terminalInstance: ITerminalInstance): void { - // If this was a hideFromUser terminal created by the API this was triggered by show, - // in which case we need to create the terminal tab - if (terminalInstance.shellLaunchConfig.hideFromUser) { - this._showBackgroundTerminal(terminalInstance); - } - this.setActiveInstanceByIndex(this._getIndexFromId(terminalInstance.instanceId)); - } - - public setActiveTabByIndex(tabIndex: number): void { - if (tabIndex >= this._terminalTabs.length) { - return; - } - - const didTabChange = this._activeTabIndex !== tabIndex; - this._activeTabIndex = tabIndex; - - this._terminalTabs.forEach((t, i) => t.setVisible(i === this._activeTabIndex)); - if (didTabChange) { - this._onActiveTabChanged.fire(); - } - } - - public isAttachedToTerminal(remoteTerm: IRemoteTerminalAttachTarget): boolean { - return this.terminalInstances.some(term => term.processId === remoteTerm.pid); - } - - public async initializeTerminals(): Promise { - if (this._remoteTerminalsInitPromise) { - await this._remoteTerminalsInitPromise; - } else if (this._localTerminalsInitPromise) { - await this._localTerminalsInitPromise; - } - if (this.terminalTabs.length === 0 && this.isProcessSupportRegistered) { - this.createTerminal(); - } - } - - private _getInstanceFromGlobalInstanceIndex(index: number): { tab: ITerminalTab, tabIndex: number, instance: ITerminalInstance, localInstanceIndex: number } | null { - let currentTabIndex = 0; - while (index >= 0 && currentTabIndex < this._terminalTabs.length) { - const tab = this._terminalTabs[currentTabIndex]; - const count = tab.terminalInstances.length; - if (index < count) { - return { - tab, - tabIndex: currentTabIndex, - instance: tab.terminalInstances[index], - localInstanceIndex: index - }; - } - index -= count; - currentTabIndex++; - } - return null; - } - - public setActiveInstanceByIndex(terminalIndex: number): void { - const query = this._getInstanceFromGlobalInstanceIndex(terminalIndex); - if (!query) { - return; - } - - query.tab.setActiveInstanceByIndex(query.localInstanceIndex); - const didTabChange = this._activeTabIndex !== query.tabIndex; - this._activeTabIndex = query.tabIndex; - this._terminalTabs.forEach((t, i) => t.setVisible(i === query.tabIndex)); - - // Only fire the event if there was a change - if (didTabChange) { - this._onActiveTabChanged.fire(); - } - } - - public setActiveTabToNext(): void { - if (this._terminalTabs.length <= 1) { - return; - } - let newIndex = this._activeTabIndex + 1; - if (newIndex >= this._terminalTabs.length) { - newIndex = 0; - } - this.setActiveTabByIndex(newIndex); - } - - public setActiveTabToPrevious(): void { - if (this._terminalTabs.length <= 1) { - return; - } - let newIndex = this._activeTabIndex - 1; - if (newIndex < 0) { - newIndex = this._terminalTabs.length - 1; - } - this.setActiveTabByIndex(newIndex); - } - - public splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfig: IShellLaunchConfig = {}): ITerminalInstance | null { - const tab = this._getTabForInstance(instanceToSplit); - if (!tab) { - return null; - } - - const instance = tab.split(shellLaunchConfig); - - this._initInstanceListeners(instance); - this._onInstancesChanged.fire(); - - this._terminalTabs.forEach((t, i) => t.setVisible(i === this._activeTabIndex)); - return instance; - } - - protected _initInstanceListeners(instance: ITerminalInstance): void { - instance.addDisposable(instance.onDisposed(this._onInstanceDisposed.fire, this._onInstanceDisposed)); - instance.addDisposable(instance.onTitleChanged(this._onInstanceTitleChanged.fire, this._onInstanceTitleChanged)); - instance.addDisposable(instance.onProcessIdReady(this._onInstanceProcessIdReady.fire, this._onInstanceProcessIdReady)); - instance.addDisposable(instance.onLinksReady(this._onInstanceLinksReady.fire, this._onInstanceLinksReady)); - instance.addDisposable(instance.onDimensionsChanged(() => { - this._onInstanceDimensionsChanged.fire(instance); - if (this.configHelper.config.enablePersistentSessions && this.isProcessSupportRegistered) { - !!this._environmentService.remoteAuthority ? this._updateRemoteState() : this._updateLocalState(); - } - })); - instance.addDisposable(instance.onMaximumDimensionsChanged(() => this._onInstanceMaximumDimensionsChanged.fire(instance))); - instance.addDisposable(instance.onFocus(this._onActiveInstanceChanged.fire, this._onActiveInstanceChanged)); - } - - public registerProcessSupport(isSupported: boolean): void { - if (!isSupported) { - return; - } - this._processSupportContextKey.set(isSupported); - this._onDidRegisterProcessSupport.fire(); - } - - public registerLinkProvider(linkProvider: ITerminalExternalLinkProvider): IDisposable { - const disposables: IDisposable[] = []; - this._linkProviders.add(linkProvider); - for (const instance of this.terminalInstances) { - if (instance.areLinksReady) { - disposables.push(instance.registerLinkProvider(linkProvider)); - } - } - this._linkProviderDisposables.set(linkProvider, disposables); - return { - dispose: () => { - const disposables = this._linkProviderDisposables.get(linkProvider) || []; - for (const disposable of disposables) { - disposable.dispose(); - } - this._linkProviders.delete(linkProvider); - } - }; - } - - private _setInstanceLinkProviders(instance: ITerminalInstance): void { - for (const linkProvider of this._linkProviders) { - const disposables = this._linkProviderDisposables.get(linkProvider); - const provider = instance.registerLinkProvider(linkProvider); - disposables?.push(provider); - } - } - - private _getTabForInstance(instance: ITerminalInstance): ITerminalTab | undefined { - return this._terminalTabs.find(tab => tab.terminalInstances.indexOf(instance) !== -1); - } - - public async showPanel(focus?: boolean): Promise { - const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID) as TerminalViewPane; - if (!pane) { - await this._viewsService.openView(TERMINAL_VIEW_ID, focus); - } - if (focus) { - // Do the focus call asynchronously as going through the - // command palette will force editor focus - await timeout(0); - const instance = this.getActiveInstance(); - if (instance) { - await instance.focusWhenReady(true); - } - } - } - - private _getIndexFromId(terminalId: number): number { - let terminalIndex = -1; - this.terminalInstances.forEach((terminalInstance, i) => { - if (terminalInstance.instanceId === terminalId) { - terminalIndex = i; - } - }); - if (terminalIndex === -1) { - throw new Error(`Terminal with ID ${terminalId} does not exist (has it already been disposed?)`); - } - return terminalIndex; - } - - public async manageWorkspaceShellPermissions(): Promise { - const allowItem: IQuickPickItem = { label: nls.localize('workbench.action.terminal.allowWorkspaceShell', "Allow Workspace Shell Configuration") }; - const disallowItem: IQuickPickItem = { label: nls.localize('workbench.action.terminal.disallowWorkspaceShell', "Disallow Workspace Shell Configuration") }; - const value = await this._quickInputService.pick([allowItem, disallowItem], { canPickMany: false }); - if (!value) { - return; - } - this.configHelper.setWorkspaceShellAllowed(value === allowItem); - } - - protected async _showTerminalCloseConfirmation(): Promise { - let message: string; - if (this.terminalInstances.length === 1) { - message = nls.localize('terminalService.terminalCloseConfirmationSingular', "There is an active terminal session, do you want to kill it?"); - } else { - message = nls.localize('terminalService.terminalCloseConfirmationPlural', "There are {0} active terminal sessions, do you want to kill them?", this.terminalInstances.length); - } - const res = await this._dialogService.confirm({ - message, - type: 'warning', - }); - return !res.confirmed; - } - - public preparePathForTerminalAsync(originalPath: string, executable: string, title: string, shellType: TerminalShellType): Promise { - return new Promise(c => { - if (!executable) { - c(originalPath); - return; - } - - const hasSpace = originalPath.indexOf(' ') !== -1; - const hasParens = originalPath.indexOf('(') !== -1 || originalPath.indexOf(')') !== -1; - - const pathBasename = basename(executable, '.exe'); - const isPowerShell = pathBasename === 'pwsh' || - title === 'pwsh' || - pathBasename === 'powershell' || - title === 'powershell'; - - if (isPowerShell && (hasSpace || originalPath.indexOf('\'') !== -1)) { - c(`& '${originalPath.replace(/'/g, '\'\'')}'`); - return; - } - - if (hasParens && isPowerShell) { - c(`& '${originalPath}'`); - return; - } - - if (isWindows) { - // 17063 is the build number where wsl path was introduced. - // Update Windows uriPath to be executed in WSL. - if (shellType !== undefined) { - if (shellType === WindowsShellType.GitBash) { - c(originalPath.replace(/\\/g, '/')); - return; - } - else if (shellType === WindowsShellType.Wsl) { - if (this._nativeWindowsDelegate && this._nativeWindowsDelegate.getWindowsBuildNumber() >= 17063) { - c(this._nativeWindowsDelegate.getWslPath(originalPath)); - } else { - c(originalPath.replace(/\\/g, '/')); - } - return; - } - - if (hasSpace) { - c('"' + originalPath + '"'); - } else { - c(originalPath); - } - } else { - const lowerExecutable = executable.toLowerCase(); - if (this._nativeWindowsDelegate && this._nativeWindowsDelegate.getWindowsBuildNumber() >= 17063 && - (lowerExecutable.indexOf('wsl') !== -1 || (lowerExecutable.indexOf('bash.exe') !== -1 && lowerExecutable.toLowerCase().indexOf('git') === -1))) { - c(this._nativeWindowsDelegate.getWslPath(originalPath)); - return; - } else if (hasSpace) { - c('"' + originalPath + '"'); - } else { - c(originalPath); - } - } - - return; - } - - c(escapeNonWindowsPath(originalPath)); - }); - } - - private async _getPlatformKey(): Promise { - const env = await this._remoteAgentService.getEnvironment(); - if (env) { - return env.os === OperatingSystem.Windows ? 'windows' : (env.os === OperatingSystem.Macintosh ? 'osx' : 'linux'); - } - return isWindows ? 'windows' : (isMacintosh ? 'osx' : 'linux'); - } - - public async selectDefaultProfile(): Promise { - const profiles = await this._detectProfiles(false); - const platformKey = await this._getPlatformKey(); - - const options: IPickOptions = { - placeHolder: nls.localize('terminal.integrated.chooseWindowsShell', "Select your default terminal profile"), - onDidTriggerItemButton: async (context) => { - const configKey = `terminal.integrated.profiles.${platformKey}`; - const configProfiles = this._configurationService.inspect<{ [key: string]: ITerminalProfileObject }>(configKey); - const existingProfiles = configProfiles.userValue ? Object.keys(configProfiles.userValue) : []; - const name = await this._quickInputService.input({ - prompt: nls.localize('enterTerminalProfileName', "Enter terminal profile name"), - value: context.item.profile.profileName, - validateInput: async input => { - if (existingProfiles.includes(input)) { - return nls.localize('terminalProfileAlreadyExists', "A terminal profile already exists with that name"); - } - return undefined; - } - }); - if (!name) { - return; - } - const newConfigValue: { [key: string]: ITerminalProfileObject } = { ...configProfiles.userValue } ?? {}; - newConfigValue[name] = { - path: context.item.profile.path, - args: context.item.profile.args - }; - await this._configurationService.updateValue(configKey, newConfigValue, ConfigurationTarget.USER); - } - }; - - // Build quick pick items - const quickPickItems: (IProfileQuickPickItem | IQuickPickSeparator)[] = []; - const configProfiles = profiles.filter(e => !e.isAutoDetected); - const autoDetectedProfiles = profiles.filter(e => e.isAutoDetected); - if (configProfiles.length > 0) { - quickPickItems.push({ type: 'separator', label: nls.localize('terminalProfiles', "profiles") }); - quickPickItems.push(...configProfiles.map(e => this._createProfileQuickPickItem(e))); - } - if (configProfiles.length > 0) { - quickPickItems.push({ type: 'separator', label: nls.localize('terminalProfiles.detected', "detected") }); - quickPickItems.push(...autoDetectedProfiles.map(e => this._createProfileQuickPickItem(e))); - } - - const value = await this._quickInputService.pick(quickPickItems, options); - if (!value) { - return; - } - await this._configurationService.updateValue(`terminal.integrated.shell.${platformKey}`, value.profile.path, ConfigurationTarget.USER); - await this._configurationService.updateValue(`terminal.integrated.shellArgs.${platformKey}`, value.profile.args, ConfigurationTarget.USER); - } - - private _createProfileQuickPickItem(profile: ITerminalProfile): IProfileQuickPickItem { - const buttons: IQuickInputButton[] = [{ - iconClass: ThemeIcon.asClassName(configureTerminalProfileIcon), - tooltip: nls.localize('createQuickLaunchProfile', "Configure Terminal Profile") - }]; - if (profile.args) { - if (typeof profile.args === 'string') { - return { label: profile.profileName, description: `${profile.path} ${profile.args}`, profile, buttons }; - } - const argsString = profile.args.map(e => { - if (e.includes(' ')) { - return `"${e.replace('/"/g', '\\"')}"`; - } - return e; - }).join(' '); - return { label: profile.profileName, description: `${profile.path} ${argsString}`, profile, buttons }; - } - return { label: profile.profileName, description: profile.path, profile, buttons }; - } - - public createInstance(container: HTMLElement | undefined, shellLaunchConfig: IShellLaunchConfig): ITerminalInstance { - const instance = this._instantiationService.createInstance(TerminalInstance, - this._terminalFocusContextKey, - this._terminalShellTypeContextKey, - this._terminalAltBufferActiveContextKey, - this._configHelper, - container, - shellLaunchConfig - ); - this._onInstanceCreated.fire(instance); - return instance; - } - - public createTerminal(shell: IShellLaunchConfig = {}): ITerminalInstance { - if (!shell.isExtensionCustomPtyTerminal && !this.isProcessSupportRegistered) { - throw new Error('Could not create terminal when process support is not registered'); - } - if (shell.hideFromUser) { - const instance = this.createInstance(undefined, shell); - this._backgroundedTerminalInstances.push(instance); - this._initInstanceListeners(instance); - return instance; - } - - const terminalTab = this._instantiationService.createInstance(TerminalTab, this._terminalContainer, shell); - this._terminalTabs.push(terminalTab); - - const instance = terminalTab.terminalInstances[0]; - - terminalTab.addDisposable(terminalTab.onDisposed(this._onTabDisposed.fire, this._onTabDisposed)); - terminalTab.addDisposable(terminalTab.onInstancesChanged(this._onInstancesChanged.fire, this._onInstancesChanged)); - this._initInstanceListeners(instance); - if (this.terminalInstances.length === 1) { - // It's the first instance so it should be made active automatically - this.setActiveInstanceByIndex(0); - } - this._onInstancesChanged.fire(); - return instance; - } - - protected _showBackgroundTerminal(instance: ITerminalInstance): void { - this._backgroundedTerminalInstances.splice(this._backgroundedTerminalInstances.indexOf(instance), 1); - instance.shellLaunchConfig.hideFromUser = false; - const terminalTab = this._instantiationService.createInstance(TerminalTab, this._terminalContainer, instance); - this._terminalTabs.push(terminalTab); - terminalTab.addDisposable(terminalTab.onDisposed(this._onTabDisposed.fire, this._onTabDisposed)); - terminalTab.addDisposable(terminalTab.onInstancesChanged(this._onInstancesChanged.fire, this._onInstancesChanged)); - if (this.terminalInstances.length === 1) { - // It's the first instance so it should be made active automatically - this.setActiveInstanceByIndex(0); - } - this._onInstancesChanged.fire(); - } - - public async focusFindWidget(): Promise { - await this.showPanel(false); - const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID) as TerminalViewPane; - pane.focusFindWidget(); - this._findWidgetVisible.set(true); - } - - public hideFindWidget(): void { - const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID) as TerminalViewPane; - if (pane) { - pane.hideFindWidget(); - this._findWidgetVisible.reset(); - pane.focus(); - } - } - - public findNext(): void { - const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID) as TerminalViewPane; - if (pane) { - pane.showFindWidget(); - pane.getFindWidget().find(false); - } - } - - public findPrevious(): void { - const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID) as TerminalViewPane; - if (pane) { - pane.showFindWidget(); - pane.getFindWidget().find(true); - } - } - - public async setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): Promise { - this._configHelper.panelContainer = panelContainer; - this._terminalContainer = terminalContainer; - this._terminalTabs.forEach(tab => tab.attachToElement(terminalContainer)); - } - - public hidePanel(): void { - // Hide the panel if the terminal is in the panel and it has no sibling views - const location = this._viewDescriptorService.getViewLocationById(TERMINAL_VIEW_ID); - if (location === ViewContainerLocation.Panel) { - const panel = this._viewDescriptorService.getViewContainerByViewId(TERMINAL_VIEW_ID); - if (panel && this._viewDescriptorService.getViewContainerModel(panel).activeViewDescriptors.length === 1) { - this._layoutService.setPanelHidden(true); - } - } - } -} - -interface IProfileQuickPickItem extends IQuickPickItem { - profile: ITerminalProfile; -} diff --git a/vscode-web-github1s/src/vs/workbench/contrib/url/browser/trustedDomains.ts b/vscode-web-github1s/src/vs/workbench/contrib/url/browser/trustedDomains.ts deleted file mode 100644 index 275fcf903..000000000 --- a/vscode-web-github1s/src/vs/workbench/contrib/url/browser/trustedDomains.ts +++ /dev/null @@ -1,251 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { URI } from 'vs/base/common/uri'; -import { localize } from 'vs/nls'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IAuthenticationService } from 'vs/workbench/services/authentication/browser/authenticationService'; -import { IFileService } from 'vs/platform/files/common/files'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; - -const TRUSTED_DOMAINS_URI = URI.parse('trustedDomains:/Trusted Domains'); - -export const TRUSTED_DOMAINS_STORAGE_KEY = 'http.linkProtectionTrustedDomains'; -export const TRUSTED_DOMAINS_CONTENT_STORAGE_KEY = 'http.linkProtectionTrustedDomainsContent'; - -export const manageTrustedDomainSettingsCommand = { - id: 'workbench.action.manageTrustedDomain', - description: { - description: localize('trustedDomain.manageTrustedDomain', 'Manage Trusted Domains'), - args: [] - }, - handler: async (accessor: ServicesAccessor) => { - const editorService = accessor.get(IEditorService); - editorService.openEditor({ resource: TRUSTED_DOMAINS_URI, mode: 'jsonc', options: { pinned: true } }); - return; - } -}; - -type ConfigureTrustedDomainsQuickPickItem = IQuickPickItem & ({ id: 'manage'; } | { id: 'trust'; toTrust: string }); - -type ConfigureTrustedDomainsChoiceClassification = { - choice: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; -}; - -export async function configureOpenerTrustedDomainsHandler( - trustedDomains: string[], - domainToConfigure: string, - resource: URI, - quickInputService: IQuickInputService, - storageService: IStorageService, - editorService: IEditorService, - telemetryService: ITelemetryService, - notificationService: INotificationService, - clipboardService: IClipboardService, -) { - const parsedDomainToConfigure = URI.parse(domainToConfigure); - // below codes are changed by github1s typo - const toplevelDomainSegments = parsedDomainToConfigure.authority.split('.'); - const domainEnd = toplevelDomainSegments.slice(toplevelDomainSegments.length - 2).join('.'); - // above codes are changed by github1s - const topLevelDomain = '*.' + domainEnd; - const options: ConfigureTrustedDomainsQuickPickItem[] = []; - - options.push({ - type: 'item', - label: localize('trustedDomain.trustDomain', 'Trust {0}', domainToConfigure), - id: 'trust', - toTrust: domainToConfigure, - picked: true - }); - - const isIP = - // below codes are changed by github1s typo - toplevelDomainSegments.length === 4 && - toplevelDomainSegments.every(segment => - // above codes are changed by github1s - Number.isInteger(+segment) || Number.isInteger(+segment.split(':')[0])); - - if (isIP) { - if (parsedDomainToConfigure.authority.includes(':')) { - const base = parsedDomainToConfigure.authority.split(':')[0]; - options.push({ - type: 'item', - label: localize('trustedDomain.trustAllPorts', 'Trust {0} on all ports', base), - toTrust: base + ':*', - id: 'trust' - }); - } - } else { - options.push({ - type: 'item', - label: localize('trustedDomain.trustSubDomain', 'Trust {0} and all its subdomains', domainEnd), - toTrust: topLevelDomain, - id: 'trust' - }); - } - - options.push({ - type: 'item', - label: localize('trustedDomain.trustAllDomains', 'Trust all domains (disables link protection)'), - toTrust: '*', - id: 'trust' - }); - options.push({ - type: 'item', - label: localize('trustedDomain.manageTrustedDomains', 'Manage Trusted Domains'), - id: 'manage' - }); - - const pickedResult = await quickInputService.pick( - options, { activeItem: options[0] } - ); - - if (pickedResult && pickedResult.id) { - telemetryService.publicLog2<{ choice: string }, ConfigureTrustedDomainsChoiceClassification>( - 'trustedDomains.configureTrustedDomainsQuickPickChoice', - { choice: pickedResult.id } - ); - - switch (pickedResult.id) { - case 'manage': - await editorService.openEditor({ - resource: TRUSTED_DOMAINS_URI, - mode: 'jsonc', - options: { pinned: true } - }); - notificationService.prompt(Severity.Info, localize('configuringURL', "Configuring trust for: {0}", resource.toString()), - [{ label: 'Copy', run: () => clipboardService.writeText(resource.toString()) }]); - return trustedDomains; - case 'trust': - const itemToTrust = pickedResult.toTrust; - if (trustedDomains.indexOf(itemToTrust) === -1) { - storageService.remove(TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, StorageScope.GLOBAL); - storageService.store( - TRUSTED_DOMAINS_STORAGE_KEY, - JSON.stringify([...trustedDomains, itemToTrust]), - StorageScope.GLOBAL, - StorageTarget.USER - ); - - return [...trustedDomains, itemToTrust]; - } - } - } - - return []; -} - -// Exported for testing. -export function extractGitHubRemotesFromGitConfig(gitConfig: string): string[] { - const domains = new Set(); - let match: RegExpExecArray | null; - - const RemoteMatcher = /^\s*url\s*=\s*(?:git@|https:\/\/)github\.com(?::|\/)(\S*)\s*$/mg; - while (match = RemoteMatcher.exec(gitConfig)) { - const repo = match[1].replace(/\.git$/, ''); - if (repo) { - domains.add(`https://github.com/${repo}/`); - } - } - return [...domains]; -} - -async function getRemotes(fileService: IFileService, textFileService: ITextFileService, contextService: IWorkspaceContextService): Promise { - const workspaceUris = contextService.getWorkspace().folders.map(folder => folder.uri); - const domains = await Promise.race([ - new Promise(resolve => setTimeout(() => resolve([]), 2000)), - Promise.all(workspaceUris.map(async workspaceUri => { - const path = workspaceUri.path; - const uri = workspaceUri.with({ path: `${path !== '/' ? path : ''}/.git/config` }); - const exists = await fileService.exists(uri); - if (!exists) { - return []; - } - const gitConfig = (await (textFileService.read(uri, { acceptTextOnly: true }).catch(() => ({ value: '' })))).value; - return extractGitHubRemotesFromGitConfig(gitConfig); - }))]); - - const set = domains.reduce((set, list) => list.reduce((set, item) => set.add(item), set), new Set()); - return [...set]; -} - -export interface IStaticTrustedDomains { - readonly defaultTrustedDomains: string[]; - readonly trustedDomains: string[]; -} - -export interface ITrustedDomains extends IStaticTrustedDomains { - readonly userDomains: string[]; - readonly workspaceDomains: string[]; -} - -export async function readTrustedDomains(accessor: ServicesAccessor): Promise { - const { defaultTrustedDomains, trustedDomains } = readStaticTrustedDomains(accessor); - const [workspaceDomains, userDomains] = await Promise.all([readWorkspaceTrustedDomains(accessor), readAuthenticationTrustedDomains(accessor)]); - return { - workspaceDomains, - userDomains, - defaultTrustedDomains, - trustedDomains, - }; -} - -export async function readWorkspaceTrustedDomains(accessor: ServicesAccessor): Promise { - const fileService = accessor.get(IFileService); - const textFileService = accessor.get(ITextFileService); - const workspaceContextService = accessor.get(IWorkspaceContextService); - return getRemotes(fileService, textFileService, workspaceContextService); -} - -export async function readAuthenticationTrustedDomains(accessor: ServicesAccessor): Promise { - const authenticationService = accessor.get(IAuthenticationService); - return authenticationService.isAuthenticationProviderRegistered('github') && ((await authenticationService.getSessions('github')) ?? []).length > 0 - ? [`https://github.com`] - : []; -} - -// below codes are changed by github1s -const github1sDefaultTrustedDomains = [ - '*.github.com', - '*.microsoft.com', - '*.github1s.com', - '*.vercel.com', - '*.sourcegraph.com', - '*.gitpod.io', -]; -// above codes are changed by github1s - -export function readStaticTrustedDomains(accessor: ServicesAccessor): IStaticTrustedDomains { - const storageService = accessor.get(IStorageService); - const productService = accessor.get(IProductService); - - // below codes are changed by github1s - const defaultTrustedDomains: string[] = productService.linkProtectionTrustedDomains - ? [...productService.linkProtectionTrustedDomains, ...github1sDefaultTrustedDomains] - : [...github1sDefaultTrustedDomains]; - // above codes are changed by github1s - - let trustedDomains: string[] = []; - try { - const trustedDomainsSrc = storageService.get(TRUSTED_DOMAINS_STORAGE_KEY, StorageScope.GLOBAL); - if (trustedDomainsSrc) { - trustedDomains = JSON.parse(trustedDomainsSrc); - } - } catch (err) { } - - return { - defaultTrustedDomains, - trustedDomains, - }; -} diff --git a/vscode-web-github1s/src/vs/workbench/contrib/webview/browser/pre/main.js b/vscode-web-github1s/src/vs/workbench/contrib/webview/browser/pre/main.js deleted file mode 100644 index 8da52f898..000000000 --- a/vscode-web-github1s/src/vs/workbench/contrib/webview/browser/pre/main.js +++ /dev/null @@ -1,743 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// @ts-check - -/** - * @typedef {{ - * postMessage: (channel: string, data?: any) => void, - * onMessage: (channel: string, handler: any) => void, - * focusIframeOnCreate?: boolean, - * ready?: Promise, - * onIframeLoaded?: (iframe: HTMLIFrameElement) => void, - * fakeLoad?: boolean, - * rewriteCSP: (existingCSP: string, endpoint?: string) => string, - * onElectron?: boolean, - * useParentPostMessage: boolean, - * }} WebviewHost - */ - -(function () { - 'use strict'; - - const isSafari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && - navigator.userAgent && - navigator.userAgent.indexOf('CriOS') === -1 && - navigator.userAgent.indexOf('FxiOS') === -1; - - /** - * Use polling to track focus of main webview and iframes within the webview - * - * @param {Object} handlers - * @param {() => void} handlers.onFocus - * @param {() => void} handlers.onBlur - */ - const trackFocus = ({ onFocus, onBlur }) => { - const interval = 50; - let isFocused = document.hasFocus(); - setInterval(() => { - const isCurrentlyFocused = document.hasFocus(); - if (isCurrentlyFocused === isFocused) { - return; - } - isFocused = isCurrentlyFocused; - if (isCurrentlyFocused) { - onFocus(); - } else { - onBlur(); - } - }, interval); - }; - - const getActiveFrame = () => { - return /** @type {HTMLIFrameElement} */ (document.getElementById('active-frame')); - }; - - const getPendingFrame = () => { - return /** @type {HTMLIFrameElement} */ (document.getElementById('pending-frame')); - }; - - const vscodePostMessageFuncName = '__vscode_post_message__'; - - const defaultCssRules = ` - html { - scrollbar-color: var(--vscode-scrollbarSlider-background) var(--vscode-editor-background); - } - - body { - background-color: transparent; - color: var(--vscode-editor-foreground); - font-family: var(--vscode-font-family); - font-weight: var(--vscode-font-weight); - font-size: var(--vscode-font-size); - margin: 0; - padding: 0 20px; - } - - img { - max-width: 100%; - max-height: 100%; - } - - a { - color: var(--vscode-textLink-foreground); - } - - a:hover { - color: var(--vscode-textLink-activeForeground); - } - - a:focus, - input:focus, - select:focus, - textarea:focus { - outline: 1px solid -webkit-focus-ring-color; - outline-offset: -1px; - } - - code { - color: var(--vscode-textPreformat-foreground); - } - - blockquote { - background: var(--vscode-textBlockQuote-background); - border-color: var(--vscode-textBlockQuote-border); - } - - kbd { - color: var(--vscode-editor-foreground); - border-radius: 3px; - vertical-align: middle; - padding: 1px 3px; - - background-color: hsla(0,0%,50%,.17); - border: 1px solid rgba(71,71,71,.4); - border-bottom-color: rgba(88,88,88,.4); - box-shadow: inset 0 -1px 0 rgba(88,88,88,.4); - } - .vscode-light kbd { - background-color: hsla(0,0%,87%,.5); - border: 1px solid hsla(0,0%,80%,.7); - border-bottom-color: hsla(0,0%,73%,.7); - box-shadow: inset 0 -1px 0 hsla(0,0%,73%,.7); - } - - ::-webkit-scrollbar { - width: 10px; - height: 10px; - } - - ::-webkit-scrollbar-corner { - background-color: var(--vscode-editor-background); - } - - ::-webkit-scrollbar-thumb { - background-color: var(--vscode-scrollbarSlider-background); - } - ::-webkit-scrollbar-thumb:hover { - background-color: var(--vscode-scrollbarSlider-hoverBackground); - } - ::-webkit-scrollbar-thumb:active { - background-color: var(--vscode-scrollbarSlider-activeBackground); - }`; - - /** - * @param {boolean} allowMultipleAPIAcquire - * @param {boolean} useParentPostMessage - * @param {*} [state] - * @return {string} - */ - function getVsCodeApiScript(allowMultipleAPIAcquire, useParentPostMessage, state) { - const encodedState = state ? encodeURIComponent(state) : undefined; - return ` - globalThis.acquireVsCodeApi = (function() { - const originalPostMessage = window.parent['${useParentPostMessage ? 'postMessage' : vscodePostMessageFuncName}'].bind(window.parent); - const doPostMessage = (channel, data) => { - ${useParentPostMessage - ? `originalPostMessage({ command: channel, data: data }, '*');` - : `originalPostMessage(channel, data);` - } - }; - - let acquired = false; - - let state = ${state ? `JSON.parse(decodeURIComponent("${encodedState}"))` : undefined}; - - return () => { - if (acquired && !${allowMultipleAPIAcquire}) { - throw new Error('An instance of the VS Code API has already been acquired'); - } - acquired = true; - return Object.freeze({ - postMessage: function(msg) { - doPostMessage('onmessage', msg); - }, - setState: function(newState) { - state = newState; - doPostMessage('do-update-state', JSON.stringify(newState)); - return newState; - }, - getState: function() { - return state; - } - }); - }; - })(); - delete window.parent; - delete window.top; - delete window.frameElement; - `; - } - - /** - * @param {WebviewHost} host - */ - function createWebviewManager(host) { - // state - let firstLoad = true; - let loadTimeout; - let pendingMessages = []; - - const initData = { - initialScrollProgress: undefined, - }; - - /** - * @param {HTMLDocument?} document - * @param {HTMLElement?} body - */ - const applyStyles = (document, body) => { - if (!document) { - return; - } - - if (body) { - body.classList.remove('vscode-light', 'vscode-dark', 'vscode-high-contrast'); - body.classList.add(initData.activeTheme); - - body.dataset.vscodeThemeKind = initData.activeTheme; - body.dataset.vscodeThemeName = initData.themeName || ''; - } - - if (initData.styles) { - const documentStyle = document.documentElement.style; - - // Remove stale properties - for (let i = documentStyle.length - 1; i >= 0; i--) { - const property = documentStyle[i]; - - // Don't remove properties that the webview might have added separately - if (property && property.startsWith('--vscode-')) { - documentStyle.removeProperty(property); - } - } - - // Re-add new properties - for (const variable of Object.keys(initData.styles)) { - documentStyle.setProperty(`--${variable}`, initData.styles[variable]); - } - } - }; - - /** - * @param {MouseEvent} event - */ - const handleInnerClick = (event) => { - if (!event || !event.view || !event.view.document) { - return; - } - - let baseElement = event.view.document.getElementsByTagName('base')[0]; - /** @type {any} */ - let node = event.target; - while (node) { - if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) { - if (node.getAttribute('href') === '#') { - event.view.scrollTo(0, 0); - } else if (node.hash && (node.getAttribute('href') === node.hash || (baseElement && node.href.indexOf(baseElement.href) >= 0))) { - let scrollTarget = event.view.document.getElementById(node.hash.substr(1, node.hash.length - 1)); - if (scrollTarget) { - scrollTarget.scrollIntoView(); - } - } else { - host.postMessage('did-click-link', node.href.baseVal || node.href); - } - event.preventDefault(); - break; - } - node = node.parentNode; - } - }; - - /** - * @param {MouseEvent} event - */ - const handleAuxClick = - (event) => { - // Prevent middle clicks opening a broken link in the browser - if (!event.view || !event.view.document) { - return; - } - - if (event.button === 1) { - let node = /** @type {any} */ (event.target); - while (node) { - if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) { - event.preventDefault(); - break; - } - node = node.parentNode; - } - } - }; - - /** - * @param {KeyboardEvent} e - */ - const handleInnerKeydown = (e) => { - // below codes are changed by github1s - // If the keypress would trigger a browser event, such as copy or paste or fuzzy, - // make sure we block the browser from dispatching it. Instead VS Code - // handles these events and will dispatch a copy/paste/fuzzy back to the webview - // if needed - if (isUndoRedo(e) || isFuzzySearch(e)) { - // above codes are changed by github1s - e.preventDefault(); - } else if (isCopyPasteOrCut(e)) { - if (host.onElectron) { - e.preventDefault(); - } else { - return; // let the browser handle this - } - } - - host.postMessage('did-keydown', { - key: e.key, - keyCode: e.keyCode, - code: e.code, - shiftKey: e.shiftKey, - altKey: e.altKey, - ctrlKey: e.ctrlKey, - metaKey: e.metaKey, - repeat: e.repeat - }); - }; - /** - * @param {KeyboardEvent} e - */ - const handleInnerUp = (e) => { - host.postMessage('did-keyup', { - key: e.key, - keyCode: e.keyCode, - code: e.code, - shiftKey: e.shiftKey, - altKey: e.altKey, - ctrlKey: e.ctrlKey, - metaKey: e.metaKey, - repeat: e.repeat - }); - }; - - /** - * @param {KeyboardEvent} e - * @return {boolean} - */ - function isCopyPasteOrCut(e) { - const hasMeta = e.ctrlKey || e.metaKey; - const shiftInsert = e.shiftKey && e.key.toLowerCase() === 'insert'; - return (hasMeta && ['c', 'v', 'x'].includes(e.key.toLowerCase())) || shiftInsert; - } - - /** - * @param {KeyboardEvent} e - * @return {boolean} - */ - function isUndoRedo(e) { - const hasMeta = e.ctrlKey || e.metaKey; - return hasMeta && ['z', 'y'].includes(e.key.toLowerCase()); - } - - // below codes are changed by github1s - /** - * @param {KeyboardEvent} e - * @return {boolean} - * modify-by-github1s, preventDefault when press ctrl/cmd+p - */ - function isFuzzySearch(e) { - const hasMeta = e.ctrlKey || e.metaKey; - return hasMeta && ['p'].includes(e.key); - } - // above codes are changed by github1s - - let isHandlingScroll = false; - - const handleWheel = (event) => { - if (isHandlingScroll) { - return; - } - - host.postMessage('did-scroll-wheel', { - deltaMode: event.deltaMode, - deltaX: event.deltaX, - deltaY: event.deltaY, - deltaZ: event.deltaZ, - detail: event.detail, - type: event.type - }); - }; - - const handleInnerScroll = (event) => { - if (!event.target || !event.target.body) { - return; - } - if (isHandlingScroll) { - return; - } - - const progress = event.currentTarget.scrollY / event.target.body.clientHeight; - if (isNaN(progress)) { - return; - } - - isHandlingScroll = true; - window.requestAnimationFrame(() => { - try { - host.postMessage('did-scroll', progress); - } catch (e) { - // noop - } - isHandlingScroll = false; - }); - }; - - /** - * @return {string} - */ - function toContentHtml(data) { - const options = data.options; - const text = data.contents; - const newDocument = new DOMParser().parseFromString(text, 'text/html'); - - newDocument.querySelectorAll('a').forEach(a => { - if (!a.title) { - a.title = a.getAttribute('href'); - } - }); - - // apply default script - if (options.allowScripts) { - const defaultScript = newDocument.createElement('script'); - defaultScript.id = '_vscodeApiScript'; - defaultScript.textContent = getVsCodeApiScript(options.allowMultipleAPIAcquire, host.useParentPostMessage, data.state); - newDocument.head.prepend(defaultScript); - } - - // apply default styles - const defaultStyles = newDocument.createElement('style'); - defaultStyles.id = '_defaultStyles'; - defaultStyles.textContent = defaultCssRules; - newDocument.head.prepend(defaultStyles); - - applyStyles(newDocument, newDocument.body); - - // Check for CSP - const csp = newDocument.querySelector('meta[http-equiv="Content-Security-Policy"]'); - if (!csp) { - host.postMessage('no-csp-found'); - } else { - try { - csp.setAttribute('content', host.rewriteCSP(csp.getAttribute('content'), data.endpoint)); - } catch (e) { - console.error(`Could not rewrite csp: ${e}`); - } - } - - // set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off - // and DOCTYPE is needed in the iframe to ensure that the user agent stylesheet is correctly overridden - return '\n' + newDocument.documentElement.outerHTML; - } - - document.addEventListener('DOMContentLoaded', () => { - const idMatch = document.location.search.match(/\bid=([\w-]+)/); - const ID = idMatch ? idMatch[1] : undefined; - if (!document.body) { - return; - } - - host.onMessage('styles', (_event, data) => { - initData.styles = data.styles; - initData.activeTheme = data.activeTheme; - initData.themeName = data.themeName; - - const target = getActiveFrame(); - if (!target) { - return; - } - - if (target.contentDocument) { - applyStyles(target.contentDocument, target.contentDocument.body); - } - }); - - // propagate focus - host.onMessage('focus', () => { - const activeFrame = getActiveFrame(); - if (!activeFrame || !activeFrame.contentWindow) { - // Focus the top level webview instead - window.focus(); - return; - } - - if (document.activeElement === activeFrame) { - // We are already focused on the iframe (or one of its children) so no need - // to refocus. - return; - } - - activeFrame.contentWindow.focus(); - }); - - // update iframe-contents - let updateId = 0; - host.onMessage('content', async (_event, data) => { - const currentUpdateId = ++updateId; - await host.ready; - if (currentUpdateId !== updateId) { - return; - } - - const options = data.options; - const newDocument = toContentHtml(data); - - const frame = getActiveFrame(); - const wasFirstLoad = firstLoad; - // keep current scrollY around and use later - let setInitialScrollPosition; - if (firstLoad) { - firstLoad = false; - setInitialScrollPosition = (body, window) => { - if (!isNaN(initData.initialScrollProgress)) { - if (window.scrollY === 0) { - window.scroll(0, body.clientHeight * initData.initialScrollProgress); - } - } - }; - } else { - const scrollY = frame && frame.contentDocument && frame.contentDocument.body ? frame.contentWindow.scrollY : 0; - setInitialScrollPosition = (body, window) => { - if (window.scrollY === 0) { - window.scroll(0, scrollY); - } - }; - } - - // Clean up old pending frames and set current one as new one - const previousPendingFrame = getPendingFrame(); - if (previousPendingFrame) { - previousPendingFrame.setAttribute('id', ''); - document.body.removeChild(previousPendingFrame); - } - if (!wasFirstLoad) { - pendingMessages = []; - } - - const newFrame = document.createElement('iframe'); - newFrame.setAttribute('id', 'pending-frame'); - newFrame.setAttribute('frameborder', '0'); - newFrame.setAttribute('sandbox', options.allowScripts ? 'allow-scripts allow-forms allow-same-origin allow-pointer-lock allow-downloads' : 'allow-same-origin allow-pointer-lock'); - newFrame.setAttribute('allow', options.allowScripts ? 'clipboard-read; clipboard-write;' : ''); - if (host.fakeLoad) { - // We should just be able to use srcdoc, but I wasn't - // seeing the service worker applying properly. - // Fake load an empty on the correct origin and then write real html - // into it to get around this. - newFrame.src = `./fake.html?id=${ID}`; - } else { - newFrame.src = `about:blank?webviewFrame`; - } - newFrame.style.cssText = 'display: block; margin: 0; overflow: hidden; position: absolute; width: 100%; height: 100%; visibility: hidden'; - document.body.appendChild(newFrame); - - if (!host.fakeLoad) { - // write new content onto iframe - newFrame.contentDocument.open(); - } - - /** - * @param {Document} contentDocument - */ - function onFrameLoaded(contentDocument) { - // Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=978325 - setTimeout(() => { - if (host.fakeLoad) { - contentDocument.open(); - contentDocument.write(newDocument); - contentDocument.close(); - hookupOnLoadHandlers(newFrame); - } - if (contentDocument) { - applyStyles(contentDocument, contentDocument.body); - } - }, 0); - } - - if (host.fakeLoad && !options.allowScripts && isSafari) { - // On Safari for iframes with scripts disabled, the `DOMContentLoaded` never seems to be fired. - // Use polling instead. - const interval = setInterval(() => { - // If the frame is no longer mounted, loading has stopped - if (!newFrame.parentElement) { - clearInterval(interval); - return; - } - - if (newFrame.contentDocument.readyState !== 'loading') { - clearInterval(interval); - onFrameLoaded(newFrame.contentDocument); - } - }, 10); - } else { - newFrame.contentWindow.addEventListener('DOMContentLoaded', e => { - const contentDocument = e.target ? (/** @type {HTMLDocument} */ (e.target)) : undefined; - onFrameLoaded(contentDocument); - }); - } - - /** - * @param {Document} contentDocument - * @param {Window} contentWindow - */ - const onLoad = (contentDocument, contentWindow) => { - if (contentDocument && contentDocument.body) { - // Workaround for https://github.com/microsoft/vscode/issues/12865 - // check new scrollY and reset if necessary - setInitialScrollPosition(contentDocument.body, contentWindow); - } - - const newFrame = getPendingFrame(); - if (newFrame && newFrame.contentDocument && newFrame.contentDocument === contentDocument) { - const oldActiveFrame = getActiveFrame(); - if (oldActiveFrame) { - document.body.removeChild(oldActiveFrame); - } - // Styles may have changed since we created the element. Make sure we re-style - applyStyles(newFrame.contentDocument, newFrame.contentDocument.body); - newFrame.setAttribute('id', 'active-frame'); - newFrame.style.visibility = 'visible'; - if (host.focusIframeOnCreate) { - newFrame.contentWindow.focus(); - } - - contentWindow.addEventListener('scroll', handleInnerScroll); - contentWindow.addEventListener('wheel', handleWheel); - - if (document.hasFocus()) { - contentWindow.focus(); - } - - pendingMessages.forEach((data) => { - contentWindow.postMessage(data, '*'); - }); - pendingMessages = []; - } - - host.postMessage('did-load'); - }; - - /** - * @param {HTMLIFrameElement} newFrame - */ - function hookupOnLoadHandlers(newFrame) { - clearTimeout(loadTimeout); - loadTimeout = undefined; - loadTimeout = setTimeout(() => { - clearTimeout(loadTimeout); - loadTimeout = undefined; - onLoad(newFrame.contentDocument, newFrame.contentWindow); - }, 200); - - newFrame.contentWindow.addEventListener('load', function (e) { - const contentDocument = /** @type {Document} */ (e.target); - - if (loadTimeout) { - clearTimeout(loadTimeout); - loadTimeout = undefined; - onLoad(contentDocument, this); - } - }); - - // Bubble out various events - newFrame.contentWindow.addEventListener('click', handleInnerClick); - newFrame.contentWindow.addEventListener('auxclick', handleAuxClick); - newFrame.contentWindow.addEventListener('keydown', handleInnerKeydown); - newFrame.contentWindow.addEventListener('keyup', handleInnerUp); - newFrame.contentWindow.addEventListener('contextmenu', e => e.preventDefault()); - - if (host.onIframeLoaded) { - host.onIframeLoaded(newFrame); - } - } - - if (!host.fakeLoad) { - hookupOnLoadHandlers(newFrame); - } - - if (!host.fakeLoad) { - newFrame.contentDocument.write(newDocument); - newFrame.contentDocument.close(); - } - - host.postMessage('did-set-content', undefined); - }); - - // Forward message to the embedded iframe - host.onMessage('message', (_event, data) => { - const pending = getPendingFrame(); - if (!pending) { - const target = getActiveFrame(); - if (target) { - target.contentWindow.postMessage(data, '*'); - return; - } - } - pendingMessages.push(data); - }); - - host.onMessage('initial-scroll-position', (_event, progress) => { - initData.initialScrollProgress = progress; - }); - - host.onMessage('execCommand', (_event, data) => { - const target = getActiveFrame(); - if (!target) { - return; - } - target.contentDocument.execCommand(data); - }); - - trackFocus({ - onFocus: () => host.postMessage('did-focus'), - onBlur: () => host.postMessage('did-blur') - }); - - (/** @type {any} */ (window))[vscodePostMessageFuncName] = (command, data) => { - switch (command) { - case 'onmessage': - case 'do-update-state': - host.postMessage(command, data); - break; - } - }; - - // signal ready - host.postMessage('webview-ready', {}); - }); - } - - if (typeof module !== 'undefined') { - module.exports = createWebviewManager; - } else { - (/** @type {any} */ (window)).createWebviewManager = createWebviewManager; - } -}()); diff --git a/vscode-web-github1s/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts b/vscode-web-github1s/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts new file mode 100644 index 000000000..5a1532f98 --- /dev/null +++ b/vscode-web-github1s/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts @@ -0,0 +1,1619 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import 'vs/css!./gettingStarted'; +import { localize } from 'vs/nls'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IEditorSerializer, IEditorOpenContext } from 'vs/workbench/common/editor'; +import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; +import { assertIsDefined } from 'vs/base/common/types'; +import { $, addDisposableListener, append, clearNode, Dimension, reset } from 'vs/base/browser/dom'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { IProductService } from 'vs/platform/product/common/productService'; +import { hiddenEntriesConfigurationKey, IResolvedWalkthrough, IResolvedWalkthroughStep, IWalkthroughsService } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedService'; +import { IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService'; +import { welcomePageBackground, welcomePageProgressBackground, welcomePageProgressForeground, welcomePageTileBackground, welcomePageTileHoverBackground, welcomePageTileShadow } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedColors'; +import { activeContrastBorder, buttonBackground, buttonForeground, buttonHoverBackground, contrastBorder, descriptionForeground, focusBorder, foreground, textLinkActiveForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { firstSessionDateStorageKey, ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; +import { gettingStartedCheckedCodicon, gettingStartedUncheckedCodicon } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedIcons'; +import { IOpenerService, matchesScheme } from 'vs/platform/opener/common/opener'; +import { URI } from 'vs/base/common/uri'; +import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; +import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { CancellationToken } from 'vs/base/common/cancellation'; +import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ContextKeyExpr, ContextKeyExpression, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { IRecentFolder, IRecentlyOpened, IRecentWorkspace, isRecentFolder, isRecentWorkspace, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { ILabelService } from 'vs/platform/label/common/label'; +import { IWindowOpenable } from 'vs/platform/windows/common/windows'; +import { splitName } from 'vs/base/common/labels'; +import { IHostService } from 'vs/workbench/services/host/browser/host'; +import { isMacintosh, locale } from 'vs/base/common/platform'; +import { Throttler } from 'vs/base/common/async'; +import { GettingStartedInput } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedInput'; +import { GroupDirection, GroupsOrder, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; +import { ILink, LinkedText } from 'vs/base/common/linkedText'; +import { Button } from 'vs/base/browser/ui/button/button'; +import { attachButtonStyler } from 'vs/platform/theme/common/styler'; +import { Link } from 'vs/platform/opener/browser/link'; +import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer'; +import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview'; +import { DEFAULT_MARKDOWN_STYLES, renderMarkdownDocument } from 'vs/workbench/contrib/markdown/common/markdownDocumentRenderer'; +import { IModeService } from 'vs/editor/common/services/modeService'; +import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { generateUuid } from 'vs/base/common/uuid'; +import { TokenizationRegistry } from 'vs/editor/common/modes'; +import { generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization'; +import { ResourceMap } from 'vs/base/common/map'; +import { IFileService } from 'vs/platform/files/common/files'; +import { joinPath } from 'vs/base/common/resources'; +import { INotificationService } from 'vs/platform/notification/common/notification'; +import { asWebviewUri } from 'vs/workbench/api/common/shared/webview'; +import { Schemas } from 'vs/base/common/network'; +import { IEditorOptions } from 'vs/platform/editor/common/editor'; +import { coalesce, equals, flatten } from 'vs/base/common/arrays'; +import { ThemeSettings } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND } from 'vs/workbench/common/theme'; +import { MarkdownRenderer } from 'vs/editor/browser/core/markdownRenderer'; +import { startEntries } from 'vs/workbench/contrib/welcome/gettingStarted/common/gettingStartedContent'; +// below codes are changed by github1s +import { GettingStartedIndexList } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedList'; +// above codes are changed by github1s +import product from 'vs/platform/product/common/product'; +import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { KeyCode } from 'vs/base/common/keyCodes'; +// below codes are changed by github1s +// eslint-disable-next-line +import { GitHub1sWelcomePage } from 'vs/github1s/welcomePage'; +// above codes are changed by github1s + +const SLIDE_TRANSITION_TIME_MS = 250; +const configurationKey = 'workbench.startupEditor'; + +export const allWalkthroughsHiddenContext = new RawContextKey('allWalkthroughsHidden', false); +export const inWelcomeContext = new RawContextKey('inWelcome', false); + +export interface IWelcomePageStartEntry { + id: string + title: string + description: string + command: string + order: number + icon: { type: 'icon', icon: ThemeIcon } + when: ContextKeyExpression +} + +const parsedStartEntries: IWelcomePageStartEntry[] = startEntries.map((e, i) => ({ + command: e.content.command, + description: e.description, + icon: { type: 'icon', icon: e.icon }, + id: e.id, + order: i, + title: e.title, + when: ContextKeyExpr.deserialize(e.when) ?? ContextKeyExpr.true() +})); + +type GettingStartedActionClassification = { + command: { classification: 'PublicNonPersonalData', purpose: 'FeatureInsight' }; + argument: { classification: 'PublicNonPersonalData', purpose: 'FeatureInsight' }; +}; + +type GettingStartedActionEvent = { + command: string; + argument: string | undefined; +}; + +type RecentEntry = (IRecentFolder | IRecentWorkspace) & { id: string }; + +const REDUCED_MOTION_KEY = 'workbench.welcomePage.preferReducedMotion'; +export class GettingStartedPage extends EditorPane { + + public static readonly ID = 'gettingStartedPage'; + + private editorInput!: GettingStartedInput; + private inProgressScroll = Promise.resolve(); + + private dispatchListeners: DisposableStore = new DisposableStore(); + private stepDisposables: DisposableStore = new DisposableStore(); + private detailsPageDisposables: DisposableStore = new DisposableStore(); + + private gettingStartedCategories: IResolvedWalkthrough[]; + private currentWalkthrough: IResolvedWalkthrough | undefined; + + private categoriesPageScrollbar: DomScrollableElement | undefined; + private detailsPageScrollbar: DomScrollableElement | undefined; + + private detailsScrollbar: DomScrollableElement | undefined; + + private buildSlideThrottle: Throttler = new Throttler(); + + private container: HTMLElement; + + private contextService: IContextKeyService; + + private recentlyOpened: Promise; + private hasScrolledToFirstCategory = false; + private recentlyOpenedList?: GettingStartedIndexList; + private startList?: GettingStartedIndexList; + private gettingStartedList?: GettingStartedIndexList; + + private stepsSlide!: HTMLElement; + private categoriesSlide!: HTMLElement; + private stepsContent!: HTMLElement; + private stepMediaComponent!: HTMLElement; + // below codes are changed by github1s + private gitHub1sWelcomePage!: GitHub1sWelcomePage; + // above codes are changed by github1s + + private layoutMarkdown: (() => void) | undefined; + + private webviewID = generateUuid(); + + constructor( + @ICommandService private readonly commandService: ICommandService, + @IProductService private readonly productService: IProductService, + @IKeybindingService private readonly keybindingService: IKeybindingService, + @IWalkthroughsService private readonly gettingStartedService: IWalkthroughsService, + @IConfigurationService private readonly configurationService: IConfigurationService, + @ITelemetryService telemetryService: ITelemetryService, + @IModeService private readonly modeService: IModeService, + @IFileService private readonly fileService: IFileService, + @IOpenerService private readonly openerService: IOpenerService, + @IThemeService themeService: IThemeService, + @IStorageService private storageService: IStorageService, + @IExtensionService private readonly extensionService: IExtensionService, + @IInstantiationService private readonly instantiationService: IInstantiationService, + @INotificationService private readonly notificationService: INotificationService, + @IEditorGroupsService private readonly groupsService: IEditorGroupsService, + @IContextKeyService contextService: IContextKeyService, + @IQuickInputService private quickInputService: IQuickInputService, + @IWorkspacesService workspacesService: IWorkspacesService, + @ILabelService private readonly labelService: ILabelService, + @IHostService private readonly hostService: IHostService, + @IWebviewService private readonly webviewService: IWebviewService, + @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, + ) { + + super(GettingStartedPage.ID, telemetryService, themeService, storageService); + + // below codes are changed by github1s + this.gitHub1sWelcomePage = instantiationService.createInstance(GitHub1sWelcomePage); + // above codes are changed by github1s + this.container = $('.gettingStartedContainer', + { + role: 'document', + tabindex: 0, + 'aria-label': localize('welcomeAriaLabel', "Overview of how to get up to speed with your editor.") + }); + this.stepMediaComponent = $('.getting-started-media'); + this.stepMediaComponent.id = generateUuid(); + + this.contextService = this._register(contextService.createScoped(this.container)); + inWelcomeContext.bindTo(this.contextService).set(true); + + this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs(); + this._register(this.dispatchListeners); + this.buildSlideThrottle = new Throttler(); + + const rerender = () => { + this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs(); + if (this.currentWalkthrough) { + const existingSteps = this.currentWalkthrough.steps.map(step => step.id); + const newCategory = this.gettingStartedCategories.find(category => this.currentWalkthrough?.id === category.id); + if (newCategory) { + const newSteps = newCategory.steps.map(step => step.id); + if (!equals(newSteps, existingSteps)) { + this.buildSlideThrottle.queue(() => this.buildCategoriesSlide()); + } + } + } else { + this.buildSlideThrottle.queue(() => this.buildCategoriesSlide()); + } + }; + + this._register(this.gettingStartedService.onDidAddWalkthrough(rerender)); + this._register(this.gettingStartedService.onDidRemoveWalkthrough(rerender)); + + this._register(this.gettingStartedService.onDidChangeWalkthrough(category => { + const ourCategory = this.gettingStartedCategories.find(c => c.id === category.id); + if (!ourCategory) { return; } + + ourCategory.title = category.title; + ourCategory.description = category.description; + + this.container.querySelectorAll(`[x-category-title-for="${category.id}"]`).forEach(step => (step as HTMLDivElement).innerText = ourCategory.title); + this.container.querySelectorAll(`[x-category-description-for="${category.id}"]`).forEach(step => (step as HTMLDivElement).innerText = ourCategory.description); + })); + + this._register(this.gettingStartedService.onDidProgressStep(step => { + const category = this.gettingStartedCategories.find(category => category.id === step.category); + if (!category) { throw Error('Could not find category with ID: ' + step.category); } + const ourStep = category.steps.find(_step => _step.id === step.id); + if (!ourStep) { + throw Error('Could not find step with ID: ' + step.id); + } + + const stats = this.getWalkthroughCompletionStats(category); + if (!ourStep.done && stats.stepsComplete === stats.stepsTotal - 1) { + this.hideCategory(category.id); + } + + this._register(this.configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(REDUCED_MOTION_KEY)) { + this.container.classList.toggle('animatable', this.shouldAnimate()); + } + })); + + ourStep.done = step.done; + + if (category.id === this.currentWalkthrough?.id) { + const badgeelements = assertIsDefined(document.querySelectorAll(`[data-done-step-id="${step.id}"]`)); + badgeelements.forEach(badgeelement => { + if (step.done) { + badgeelement.parentElement?.setAttribute('aria-checked', 'true'); + badgeelement.classList.remove(...ThemeIcon.asClassNameArray(gettingStartedUncheckedCodicon)); + badgeelement.classList.add('complete', ...ThemeIcon.asClassNameArray(gettingStartedCheckedCodicon)); + } + else { + badgeelement.parentElement?.setAttribute('aria-checked', 'false'); + badgeelement.classList.remove('complete', ...ThemeIcon.asClassNameArray(gettingStartedCheckedCodicon)); + badgeelement.classList.add(...ThemeIcon.asClassNameArray(gettingStartedUncheckedCodicon)); + } + }); + } + this.updateCategoryProgress(); + })); + + this.recentlyOpened = workspacesService.getRecentlyOpened(); + } + + private shouldAnimate() { + return !this.configurationService.getValue(REDUCED_MOTION_KEY); + } + + private getWalkthroughCompletionStats(walkthrough: IResolvedWalkthrough): { stepsComplete: number, stepsTotal: number } { + const activeSteps = walkthrough.steps.filter(s => this.contextService.contextMatchesRules(s.when)); + return { + stepsComplete: activeSteps.filter(s => s.done).length, + stepsTotal: activeSteps.length, + }; + } + + override async setInput(newInput: GettingStartedInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken) { + this.container.classList.remove('animatable'); + this.editorInput = newInput; + await super.setInput(newInput, options, context, token); + await this.buildCategoriesSlide(); + if (this.shouldAnimate()) { + setTimeout(() => this.container.classList.add('animatable'), 0); + } + } + + async makeCategoryVisibleWhenAvailable(categoryID: string, stepId?: string) { + await this.gettingStartedService.installedExtensionsRegistered; + + this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs(); + const ourCategory = this.gettingStartedCategories.find(c => c.id === categoryID); + if (!ourCategory) { + throw Error('Could not find category with ID: ' + categoryID); + } + + this.scrollToCategory(categoryID, stepId); + } + + private registerDispatchListeners() { + this.dispatchListeners.clear(); + + this.container.querySelectorAll('[x-dispatch]').forEach(element => { + const [command, argument] = (element.getAttribute('x-dispatch') ?? '').split(':'); + if (command) { + this.dispatchListeners.add(addDisposableListener(element, 'click', (e) => { + e.stopPropagation(); + this.runDispatchCommand(command, argument); + })); + } + }); + } + + private async runDispatchCommand(command: string, argument: string) { + this.commandService.executeCommand('workbench.action.keepEditor'); + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command, argument }); + switch (command) { + case 'scrollPrev': { + this.scrollPrev(); + break; + } + case 'skip': { + this.runSkip(); + break; + } + case 'showMoreRecents': { + this.commandService.executeCommand('workbench.action.openRecent'); + break; + } + case 'seeAllWalkthroughs': { + await this.openWalkthroughSelector(); + break; + } + case 'openFolder': { + this.commandService.executeCommand(isMacintosh ? 'workbench.action.files.openFileFolder' : 'workbench.action.files.openFolder'); + break; + } + case 'selectCategory': { + const selectedCategory = this.gettingStartedCategories.find(category => category.id === argument); + if (!selectedCategory) { throw Error('Could not find category with ID ' + argument); } + + this.gettingStartedService.markWalkthroughOpened(argument); + this.gettingStartedList?.setEntries(this.gettingStartedService.getWalkthroughs()); + this.scrollToCategory(argument); + break; + } + case 'selectStartEntry': { + const selected = startEntries.find(e => e.id === argument); + if (selected) { + this.commandService.executeCommand(selected.content.command); + } else { + throw Error('could not find start entry with id: ' + argument); + } + break; + } + case 'hideCategory': { + this.hideCategory(argument); + break; + } + // Use selectTask over selectStep to keep telemetry consistant:https://github.com/microsoft/vscode/issues/122256 + case 'selectTask': { + this.selectStep(argument); + break; + } + case 'toggleStepCompletion': { + this.toggleStepCompletion(argument); + break; + } + case 'allDone': { + this.markAllStepsComplete(); + break; + } + case 'nextSection': { + const next = this.currentWalkthrough?.next; + if (next) { + this.scrollToCategory(next); + } else { + console.error('Error scrolling to next section of', this.currentWalkthrough); + } + break; + } + default: { + console.error('Dispatch to', command, argument, 'not defined'); + break; + } + } + } + + private hideCategory(categoryId: string) { + const selectedCategory = this.gettingStartedCategories.find(category => category.id === categoryId); + if (!selectedCategory) { throw Error('Could not find category with ID ' + categoryId); } + this.setHiddenCategories([...this.getHiddenCategories().add(categoryId)]); + this.gettingStartedList?.rerender(); + } + + private markAllStepsComplete() { + if (this.currentWalkthrough) { + this.currentWalkthrough?.steps.forEach(step => { + if (!step.done) { + this.gettingStartedService.progressStep(step.id); + } + }); + this.hideCategory(this.currentWalkthrough?.id); + this.scrollPrev(); + } else { + throw Error('No walkthrough opened'); + } + } + + private toggleStepCompletion(argument: string) { + const stepToggle = assertIsDefined(this.currentWalkthrough?.steps.find(step => step.id === argument)); + if (stepToggle.done) { + this.gettingStartedService.deprogressStep(argument); + } else { + this.gettingStartedService.progressStep(argument); + } + } + + private async openWalkthroughSelector() { + const selection = await this.quickInputService.pick(this.gettingStartedCategories.map(x => ({ + id: x.id, + label: x.title, + detail: x.description, + description: x.source, + })), { canPickMany: false, matchOnDescription: true, matchOnDetail: true, title: localize('pickWalkthroughs', "Open Walkthrough...") }); + if (selection) { + this.runDispatchCommand('selectCategory', selection.id); + } + } + + private svgCache = new ResourceMap>(); + private readAndCacheSVGFile(path: URI): Promise { + if (!this.svgCache.has(path)) { + this.svgCache.set(path, (async () => { + try { + const bytes = await this.fileService.readFile(path); + return bytes.value.toString(); + } catch (e) { + this.notificationService.error('Error reading svg document at `' + path + '`: ' + e); + return ''; + } + })()); + } + return assertIsDefined(this.svgCache.get(path)); + } + + private mdCache = new ResourceMap>(); + private async readAndCacheStepMarkdown(path: URI): Promise { + if (!this.mdCache.has(path)) { + this.mdCache.set(path, (async () => { + try { + const moduleId = JSON.parse(path.query).moduleId; + if (moduleId) { + return new Promise(resolve => { + require([moduleId], content => { + const markdown = content.default(); + resolve(renderMarkdownDocument(markdown, this.extensionService, this.modeService)); + }); + }); + } + } catch { } + try { + const localizedPath = path.with({ path: path.path.replace(/\.md$/, `.nls.${locale}.md`) }); + + const generalizedLocale = locale?.replace(/-.*$/, ''); + const generalizedLocalizedPath = path.with({ path: path.path.replace(/\.md$/, `.nls.${generalizedLocale}.md`) }); + + const fileExists = (file: URI) => this.fileService.resolve(file).then(() => true).catch(() => false); + + const [localizedFileExists, generalizedLocalizedFileExists] = await Promise.all([ + fileExists(localizedPath), + fileExists(generalizedLocalizedPath), + ]); + + const bytes = await this.fileService.readFile( + localizedFileExists + ? localizedPath + : generalizedLocalizedFileExists + ? generalizedLocalizedPath + : path); + + const markdown = bytes.value.toString(); + return renderMarkdownDocument(markdown, this.extensionService, this.modeService); + } catch (e) { + this.notificationService.error('Error reading markdown document at `' + path + '`: ' + e); + return ''; + } + })()); + } + return assertIsDefined(this.mdCache.get(path)); + } + + private getHiddenCategories(): Set { + return new Set(JSON.parse(this.storageService.get(hiddenEntriesConfigurationKey, StorageScope.GLOBAL, '[]'))); + } + + private setHiddenCategories(hidden: string[]) { + this.storageService.store( + hiddenEntriesConfigurationKey, + JSON.stringify(hidden), + StorageScope.GLOBAL, + StorageTarget.USER); + } + + private async buildMediaComponent(stepId: string) { + if (!this.currentWalkthrough) { + throw Error('no walkthrough selected'); + } + const stepToExpand = assertIsDefined(this.currentWalkthrough.steps.find(step => step.id === stepId)); + + this.stepDisposables.clear(); + clearNode(this.stepMediaComponent); + + if (stepToExpand.media.type === 'image') { + + this.stepsContent.classList.add('image'); + this.stepsContent.classList.remove('markdown'); + + const media = stepToExpand.media; + const mediaElement = $('img'); + this.stepMediaComponent.appendChild(mediaElement); + mediaElement.setAttribute('alt', media.altText); + this.updateMediaSourceForColorMode(mediaElement, media.path); + + this.stepDisposables.add(addDisposableListener(this.stepMediaComponent, 'click', () => { + const hrefs = flatten(stepToExpand.description.map(lt => lt.nodes.filter((node): node is ILink => typeof node !== 'string').map(node => node.href))); + if (hrefs.length === 1) { + const href = hrefs[0]; + if (href.startsWith('http')) { + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'runStepAction', argument: href }); + this.openerService.open(href); + } + } + })); + + this.stepDisposables.add(this.themeService.onDidColorThemeChange(() => this.updateMediaSourceForColorMode(mediaElement, media.path))); + + } + else if (stepToExpand.media.type === 'svg') { + this.stepsContent.classList.add('image'); + this.stepsContent.classList.remove('markdown'); + + const media = stepToExpand.media; + const webview = this.stepDisposables.add(this.webviewService.createWebviewElement(this.webviewID, {}, {}, undefined)); + webview.mountTo(this.stepMediaComponent); + + webview.html = await this.renderSVG(media.path); + + let isDisposed = false; + this.stepDisposables.add(toDisposable(() => { isDisposed = true; })); + + this.stepDisposables.add(this.themeService.onDidColorThemeChange(async () => { + // Render again since color vars change + const body = await this.renderSVG(media.path); + if (!isDisposed) { // Make sure we weren't disposed of in the meantime + webview.html = body; + } + })); + + this.stepDisposables.add(addDisposableListener(this.stepMediaComponent, 'click', () => { + const hrefs = flatten(stepToExpand.description.map(lt => lt.nodes.filter((node): node is ILink => typeof node !== 'string').map(node => node.href))); + if (hrefs.length === 1) { + const href = hrefs[0]; + if (href.startsWith('http')) { + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'runStepAction', argument: href }); + this.openerService.open(href); + } + } + })); + + this.stepDisposables.add(webview.onDidClickLink(link => { + if (matchesScheme(link, Schemas.https) || matchesScheme(link, Schemas.http) || (matchesScheme(link, Schemas.command))) { + this.openerService.open(link, { allowCommands: true }); + } + })); + + } + else if (stepToExpand.media.type === 'markdown') { + + this.stepsContent.classList.remove('image'); + this.stepsContent.classList.add('markdown'); + + const media = stepToExpand.media; + + const webview = this.stepDisposables.add(this.webviewService.createWebviewElement(this.webviewID, {}, { localResourceRoots: [media.root], allowScripts: true }, undefined)); + webview.mountTo(this.stepMediaComponent); + + const rawHTML = await this.renderMarkdown(media.path, media.base); + webview.html = rawHTML; + + const serializedContextKeyExprs = rawHTML.match(/checked-on=\"([^'][^"]*)\"/g)?.map(attr => attr.slice('checked-on="'.length, -1) + .replace(/'/g, '\'') + .replace(/&/g, '&')); + + const postTrueKeysMessage = () => { + const enabledContextKeys = serializedContextKeyExprs?.filter(expr => this.contextService.contextMatchesRules(ContextKeyExpr.deserialize(expr))); + if (enabledContextKeys) { + webview.postMessage({ + enabledContextKeys + }); + } + }; + + let isDisposed = false; + this.stepDisposables.add(toDisposable(() => { isDisposed = true; })); + + this.stepDisposables.add(webview.onDidClickLink(link => { + if (matchesScheme(link, Schemas.https) || matchesScheme(link, Schemas.http) || (matchesScheme(link, Schemas.command))) { + this.openerService.open(link, { allowCommands: true }); + } + })); + + this.stepDisposables.add(this.themeService.onDidColorThemeChange(async () => { + // Render again since syntax highlighting of code blocks may have changed + const body = await this.renderMarkdown(media.path, media.base); + if (!isDisposed) { // Make sure we weren't disposed of in the meantime + webview.html = body; + postTrueKeysMessage(); + } + })); + + if (serializedContextKeyExprs) { + const contextKeyExprs = coalesce(serializedContextKeyExprs.map(expr => ContextKeyExpr.deserialize(expr))); + const watchingKeys = new Set(flatten(contextKeyExprs.map(expr => expr.keys()))); + + this.stepDisposables.add(this.contextService.onDidChangeContext(e => { + if (e.affectsSome(watchingKeys)) { postTrueKeysMessage(); } + })); + + this.layoutMarkdown = () => { webview.postMessage({ layout: true }); }; + this.stepDisposables.add({ dispose: () => this.layoutMarkdown = undefined }); + this.layoutMarkdown(); + + postTrueKeysMessage(); + + webview.onMessage(e => { + const message: string = e.message as string; + if (message.startsWith('command:')) { + this.openerService.open(message, { allowCommands: true }); + } else if (message.startsWith('setTheme:')) { + this.configurationService.updateValue(ThemeSettings.COLOR_THEME, message.slice('setTheme:'.length), ConfigurationTarget.USER); + } else { + console.error('Unexpected message', message); + } + }); + } + + } + } + + async selectStepLoose(id: string) { + const toSelect = this.editorInput.selectedCategory + '#' + id; + this.selectStep(toSelect); + } + + private async selectStep(id: string | undefined, delayFocus = true, forceRebuild = false) { + if (id && this.editorInput.selectedStep === id && !forceRebuild) { return; } + + if (id) { + let stepElement = this.container.querySelector(`[data-step-id="${id}"]`); + if (!stepElement) { + // Selected an element that is not in-context, just fallback to whatever. + stepElement = assertIsDefined(this.container.querySelector(`[data-step-id]`)); + id = assertIsDefined(stepElement.getAttribute('data-step-id')); + } + stepElement.parentElement?.querySelectorAll('.expanded').forEach(node => { + if (node.getAttribute('data-step-id') !== id) { + node.classList.remove('expanded'); + node.setAttribute('aria-expanded', 'false'); + } + }); + setTimeout(() => (stepElement as HTMLElement).focus(), delayFocus ? SLIDE_TRANSITION_TIME_MS : 0); + + this.editorInput.selectedStep = id; + + stepElement.classList.add('expanded'); + stepElement.setAttribute('aria-expanded', 'true'); + this.buildMediaComponent(id); + this.gettingStartedService.progressByEvent('stepSelected:' + id); + } else { + this.editorInput.selectedStep = undefined; + } + + this.detailsPageScrollbar?.scanDomNode(); + this.detailsScrollbar?.scanDomNode(); + } + + private updateMediaSourceForColorMode(element: HTMLImageElement, sources: { hc: URI, dark: URI, light: URI }) { + const themeType = this.themeService.getColorTheme().type; + const src = sources[themeType].toString(true).replace(/ /g, '%20'); + element.srcset = src.toLowerCase().endsWith('.svg') ? src : (src + ' 1.5x'); + } + + private async renderSVG(path: URI): Promise { + const content = await this.readAndCacheSVGFile(path); + const nonce = generateUuid(); + const colorMap = TokenizationRegistry.getColorMap(); + + const css = colorMap ? generateTokensCSSForColorMap(colorMap) : ''; + return ` + + + + + + + + ${content} + + `; + } + + private async renderMarkdown(path: URI, base: URI): Promise { + const content = await this.readAndCacheStepMarkdown(path); + const nonce = generateUuid(); + const colorMap = TokenizationRegistry.getColorMap(); + + const uriTranformedContent = content.replace(/src="([^"]*)"/g, (_, src: string) => { + if (src.startsWith('https://')) { return `src="${src}"`; } + + const path = joinPath(base, src); + const transformed = asWebviewUri(path).toString(); + return `src="${transformed}"`; + }); + + const css = colorMap ? generateTokensCSSForColorMap(colorMap) : ''; + return ` + + + + + + + + ${uriTranformedContent} + + + `; + } + + createEditor(parent: HTMLElement) { + if (this.detailsPageScrollbar) { this.detailsPageScrollbar.dispose(); } + if (this.categoriesPageScrollbar) { this.categoriesPageScrollbar.dispose(); } + + this.categoriesSlide = $('.gettingStartedSlideCategories.gettingStartedSlide'); + + const prevButton = $('button.prev-button.button-link', { 'x-dispatch': 'scrollPrev' }, $('span.scroll-button.codicon.codicon-chevron-left'), $('span.moreText', {}, localize('welcome', "Welcome"))); + this.stepsSlide = $('.gettingStartedSlideDetails.gettingStartedSlide', {}, prevButton); + + this.stepsContent = $('.gettingStartedDetailsContent', {}); + + this.detailsPageScrollbar = this._register(new DomScrollableElement(this.stepsContent, { className: 'full-height-scrollable' })); + this.categoriesPageScrollbar = this._register(new DomScrollableElement(this.categoriesSlide, { className: 'full-height-scrollable categoriesScrollbar' })); + + this.stepsSlide.appendChild(this.detailsPageScrollbar.getDomNode()); + + const gettingStartedPage = $('.gettingStarted', {}, this.categoriesPageScrollbar.getDomNode(), this.stepsSlide); + this.container.appendChild(gettingStartedPage); + + this.categoriesPageScrollbar.scanDomNode(); + this.detailsPageScrollbar.scanDomNode(); + + + parent.appendChild(this.container); + } + + // below codes are changed by github1s + private async buildCategoriesSlide() { + reset(this.container, this.gitHub1sWelcomePage.render()); + } + + public async buildCategoriesSlide2() { + // above codes are changed by github1s + const showOnStartupCheckbox = $('input.checkbox', { id: 'showOnStartup', type: 'checkbox' }) as HTMLInputElement; + + showOnStartupCheckbox.checked = this.configurationService.getValue(configurationKey) === 'welcomePage'; + this._register(addDisposableListener(showOnStartupCheckbox, 'click', () => { + if (showOnStartupCheckbox.checked) { + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'showOnStartupChecked', argument: undefined }); + this.configurationService.updateValue(configurationKey, 'welcomePage'); + } else { + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'showOnStartupUnchecked', argument: undefined }); + this.configurationService.updateValue(configurationKey, 'none'); + } + })); + + const header = $('.header', {}, + $('h1.product-name.caption', {}, this.productService.nameLong), + $('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved")) + ); + + + const leftColumn = $('.categories-column.categories-column-left', {},); + const rightColumn = $('.categories-column.categories-column-right', {},); + + const startList = this.buildStartList(); + const recentList = this.buildRecentlyOpenedList(); + const gettingStartedList = this.buildGettingStartedWalkthroughsList(); + + const footer = $('.footer', $('p.showOnStartup', {}, showOnStartupCheckbox, $('label.caption', { for: 'showOnStartup' }, localize('welcomePage.showOnStartup', "Show welcome page on startup")))); + + const layoutLists = () => { + if (gettingStartedList.itemCount) { + this.container.classList.remove('noWalkthroughs'); + reset(leftColumn, startList.getDomElement(), recentList.getDomElement()); + reset(rightColumn, gettingStartedList.getDomElement()); + recentList.setLimit(5); + } + else { + this.container.classList.add('noWalkthroughs'); + reset(leftColumn, startList.getDomElement()); + reset(rightColumn, recentList.getDomElement()); + recentList.setLimit(10); + } + setTimeout(() => this.categoriesPageScrollbar?.scanDomNode(), 50); + }; + + gettingStartedList.onDidChange(layoutLists); + layoutLists(); + + reset(this.categoriesSlide, $('.gettingStartedCategoriesContainer', {}, header, leftColumn, rightColumn, footer,)); + this.categoriesPageScrollbar?.scanDomNode(); + + this.updateCategoryProgress(); + this.registerDispatchListeners(); + + if (this.editorInput.selectedCategory) { + this.currentWalkthrough = this.gettingStartedCategories.find(category => category.id === this.editorInput.selectedCategory); + + if (!this.currentWalkthrough) { + this.container.classList.add('loading'); + await this.gettingStartedService.installedExtensionsRegistered; + this.container.classList.remove('loading'); + this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs(); + } + + this.currentWalkthrough = this.gettingStartedCategories.find(category => category.id === this.editorInput.selectedCategory); + if (!this.currentWalkthrough) { + console.error('Could not restore to category ' + this.editorInput.selectedCategory + ' as it was not found'); + this.editorInput.selectedCategory = undefined; + this.editorInput.selectedStep = undefined; + } else { + this.buildCategorySlide(this.editorInput.selectedCategory, this.editorInput.selectedStep); + this.setSlide('details'); + return; + } + } + + const someStepsComplete = this.gettingStartedCategories.some(category => category.steps.find(s => s.done)); + if (!someStepsComplete && !this.hasScrolledToFirstCategory) { + + const firstSessionDateString = this.storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL) || new Date().toUTCString(); + const daysSinceFirstSession = ((+new Date()) - (+new Date(firstSessionDateString))) / 1000 / 60 / 60 / 24; + const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index'; + + if (fistContentBehaviour === 'openToFirstCategory') { + const first = this.gettingStartedCategories[0]; + this.hasScrolledToFirstCategory = true; + if (first) { + this.currentWalkthrough = first; + this.editorInput.selectedCategory = this.currentWalkthrough?.id; + this.buildCategorySlide(this.editorInput.selectedCategory, undefined); + this.setSlide('details'); + return; + } + } + } + + this.setSlide('categories'); + } + + private buildRecentlyOpenedList(): GettingStartedIndexList { + const renderRecent = (recent: RecentEntry) => { + let fullPath: string; + let windowOpenable: IWindowOpenable; + if (isRecentFolder(recent)) { + windowOpenable = { folderUri: recent.folderUri }; + fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.folderUri, { verbose: true }); + } else { + fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.workspace, { verbose: true }); + windowOpenable = { workspaceUri: recent.workspace.configPath }; + } + + const { name, parentPath } = splitName(fullPath); + + const li = $('li'); + const link = $('button.button-link'); + + link.innerText = name; + link.title = fullPath; + link.setAttribute('aria-label', localize('welcomePage.openFolderWithPath', "Open folder {0} with path {1}", name, parentPath)); + link.addEventListener('click', e => { + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'openRecent', argument: undefined }); + this.hostService.openWindow([windowOpenable], { forceNewWindow: e.ctrlKey || e.metaKey, remoteAuthority: recent.remoteAuthority }); + e.preventDefault(); + e.stopPropagation(); + }); + li.appendChild(link); + + const span = $('span'); + span.classList.add('path'); + span.classList.add('detail'); + span.innerText = parentPath; + span.title = fullPath; + li.appendChild(span); + + return li; + }; + + if (this.recentlyOpenedList) { this.recentlyOpenedList.dispose(); } + + const recentlyOpenedList = this.recentlyOpenedList = new GettingStartedIndexList( + { + title: localize('recent', "Recent"), + klass: 'recently-opened', + limit: 5, + empty: $('.empty-recent', {}, 'You have no recent folders,', $('button.button-link', { 'x-dispatch': 'openFolder' }, 'open a folder'), 'to start.'), + more: $('.more', {}, + $('button.button-link', + { + 'x-dispatch': 'showMoreRecents', + title: localize('show more recents', "Show All Recent Folders {0}", this.getKeybindingLabel('workbench.action.openRecent')) + }, 'More...')), + renderElement: renderRecent, + contextService: this.contextService + }); + + recentlyOpenedList.onDidChange(() => this.registerDispatchListeners()); + + this.recentlyOpened.then(({ workspaces }) => { + // Filter out the current workspace + const workspacesWithID = workspaces + .filter(recent => !this.workspaceContextService.isCurrentWorkspace(isRecentWorkspace(recent) ? recent.workspace : recent.folderUri)) + .map(recent => ({ ...recent, id: isRecentWorkspace(recent) ? recent.workspace.id : recent.folderUri.toString() })); + + const updateEntries = () => { recentlyOpenedList.setEntries(workspacesWithID); }; + + updateEntries(); + + recentlyOpenedList.register(this.labelService.onDidChangeFormatters(() => updateEntries())); + }).catch(onUnexpectedError); + + return recentlyOpenedList; + } + + private buildStartList(): GettingStartedIndexList { + const renderStartEntry = (entry: IWelcomePageStartEntry): HTMLElement => + $('li', + {}, $('button.button-link', + { + 'x-dispatch': 'selectStartEntry:' + entry.id, + title: entry.description + ' ' + this.getKeybindingLabel(entry.command), + }, + this.iconWidgetFor(entry), + $('span', {}, entry.title))); + + if (this.startList) { this.startList.dispose(); } + + const startList = this.startList = new GettingStartedIndexList( + { + title: localize('start', "Start"), + klass: 'start-container', + limit: 10, + renderElement: renderStartEntry, + rankElement: e => -e.order, + contextService: this.contextService + }); + + startList.setEntries(parsedStartEntries); + startList.onDidChange(() => this.registerDispatchListeners()); + return startList; + } + + private buildGettingStartedWalkthroughsList(): GettingStartedIndexList { + + const renderGetttingStaredWalkthrough = (category: IResolvedWalkthrough): HTMLElement => { + + const renderNewBadge = (category.newItems || category.newEntry) && !category.isFeatured; + const newBadge = $('.new-badge', {}); + if (category.newEntry) { + reset(newBadge, $('.new-category', {}, localize('new', "New"))); + } else if (category.newItems) { + reset(newBadge, $('.new-items', {}, localize('newItems', "New Items"))); + } + + const featuredBadge = $('.featured-badge', {}); + const descriptionContent = $('.description-content', {},); + + if (category.isFeatured) { + reset(featuredBadge, $('.featured', {}, $('span.featured-icon.codicon.codicon-star-empty'))); + reset(descriptionContent, category.description); + } + + return $('button.getting-started-category' + (category.isFeatured ? '.featured' : ''), + { + 'x-dispatch': 'selectCategory:' + category.id, + 'role': 'listitem', + 'title': category.description + }, + featuredBadge, + $('.main-content', {}, + this.iconWidgetFor(category), + $('h3.category-title.max-lines-3', { 'x-category-title-for': category.id }, category.title,), + renderNewBadge ? newBadge : $('.no-badge'), + $('a.codicon.codicon-close.hide-category-button', { + 'x-dispatch': 'hideCategory:' + category.id, + 'title': localize('close', "Hide"), + }), + ), + descriptionContent, + $('.category-progress', { 'x-data-category-id': category.id, }, + $('.progress-bar-outer', { 'role': 'progressbar' }, + $('.progress-bar-inner')))); + }; + + if (this.gettingStartedList) { this.gettingStartedList.dispose(); } + + const rankWalkthrough = (e: IResolvedWalkthrough) => { + let rank: number | null = e.order; + + if (e.isFeatured) { rank += 7; } + if (e.newEntry) { rank += 3; } + if (e.newItems) { rank += 2; } + if (e.recencyBonus) { rank += 4 * e.recencyBonus; } + + if (this.getHiddenCategories().has(e.id)) { rank = null; } + return rank; + }; + + const gettingStartedList = this.gettingStartedList = new GettingStartedIndexList( + { + title: localize('walkthroughs', "Walkthroughs"), + klass: 'getting-started', + limit: 5, + empty: undefined, more: undefined, + footer: $('span.button-link.see-all-walkthroughs', { 'x-dispatch': 'seeAllWalkthroughs' }, localize('showAll', "More...")), + renderElement: renderGetttingStaredWalkthrough, + rankElement: rankWalkthrough, + contextService: this.contextService, + }); + + gettingStartedList.onDidChange(() => { + const hidden = this.getHiddenCategories(); + const someWalkthroughsHidden = hidden.size || gettingStartedList.itemCount < this.gettingStartedCategories.filter(c => this.contextService.contextMatchesRules(c.when)).length; + this.container.classList.toggle('someWalkthroughsHidden', !!someWalkthroughsHidden); + this.registerDispatchListeners(); + allWalkthroughsHiddenContext.bindTo(this.contextService).set(gettingStartedList.itemCount === 0); + this.updateCategoryProgress(); + }); + + gettingStartedList.setEntries(this.gettingStartedCategories); + allWalkthroughsHiddenContext.bindTo(this.contextService).set(gettingStartedList.itemCount === 0); + + + return gettingStartedList; + } + + layout(size: Dimension) { + this.detailsScrollbar?.scanDomNode(); + + this.categoriesPageScrollbar?.scanDomNode(); + this.detailsPageScrollbar?.scanDomNode(); + + this.startList?.layout(size); + this.gettingStartedList?.layout(size); + this.recentlyOpenedList?.layout(size); + + this.layoutMarkdown?.(); + + this.container.classList[size.height <= 600 ? 'add' : 'remove']('height-constrained'); + this.container.classList[size.width <= 400 ? 'add' : 'remove']('width-constrained'); + this.container.classList[size.width <= 800 ? 'add' : 'remove']('width-semi-constrained'); + } + + private updateCategoryProgress() { + document.querySelectorAll('.category-progress').forEach(element => { + const categoryID = element.getAttribute('x-data-category-id'); + const category = this.gettingStartedCategories.find(category => category.id === categoryID); + if (!category) { throw Error('Could not find category with ID ' + categoryID); } + + const stats = this.getWalkthroughCompletionStats(category); + + const bar = assertIsDefined(element.querySelector('.progress-bar-inner')) as HTMLDivElement; + bar.setAttribute('aria-valuemin', '0'); + bar.setAttribute('aria-valuenow', '' + stats.stepsComplete); + bar.setAttribute('aria-valuemax', '' + stats.stepsTotal); + const progress = (stats.stepsComplete / stats.stepsTotal) * 100; + bar.style.width = `${progress}%`; + + + (element.parentElement as HTMLElement).classList[stats.stepsComplete === 0 ? 'add' : 'remove']('no-progress'); + + if (stats.stepsTotal === stats.stepsComplete) { + bar.title = localize('gettingStarted.allStepsComplete', "All {0} steps complete!", stats.stepsComplete); + } + else { + bar.title = localize('gettingStarted.someStepsComplete', "{0} of {1} steps complete", stats.stepsTotal, stats.stepsComplete); + } + }); + } + + private async scrollToCategory(categoryID: string, stepId?: string) { + this.inProgressScroll = this.inProgressScroll.then(async () => { + reset(this.stepsContent); + this.editorInput.selectedCategory = categoryID; + this.editorInput.selectedStep = stepId; + this.currentWalkthrough = this.gettingStartedCategories.find(category => category.id === categoryID); + this.buildCategorySlide(categoryID); + this.setSlide('details'); + }); + } + + private iconWidgetFor(category: IResolvedWalkthrough | { icon: { type: 'icon', icon: ThemeIcon } }) { + const widget = category.icon.type === 'icon' ? $(ThemeIcon.asCSSSelector(category.icon.icon)) : $('img.category-icon', { src: category.icon.path }); + widget.classList.add('icon-widget'); + return widget; + } + + private buildStepMarkdownDescription(container: HTMLElement, text: LinkedText[]) { + while (container.firstChild) { container.removeChild(container.firstChild); } + + for (const linkedText of text) { + if (linkedText.nodes.length === 1 && typeof linkedText.nodes[0] !== 'string') { + const node = linkedText.nodes[0]; + const buttonContainer = append(container, $('.button-container')); + const button = new Button(buttonContainer, { title: node.title, supportIcons: true }); + + const isCommand = node.href.startsWith('command:'); + const toSide = node.href.startsWith('command:toSide:'); + const command = node.href.replace(/command:(toSide:)?/, 'command:'); + + button.label = node.label; + button.onDidClick(async e => { + e.stopPropagation(); + e.preventDefault(); + + this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'runStepAction', argument: node.href }); + + const fullSize = this.groupsService.contentDimension; + + if (toSide && fullSize.width > 700) { + if (this.groupsService.count === 1) { + this.groupsService.addGroup(this.groupsService.groups[0], GroupDirection.LEFT, { activate: true }); + + let gettingStartedSize: number; + if (fullSize.width > 1600) { + gettingStartedSize = 800; + } else if (fullSize.width > 800) { + gettingStartedSize = 400; + } else { + gettingStartedSize = 350; + } + + const gettingStartedGroup = this.groupsService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).find(group => (group.activeEditor instanceof GettingStartedInput)); + this.groupsService.setSize(assertIsDefined(gettingStartedGroup), { width: gettingStartedSize, height: fullSize.height }); + } + + const nonGettingStartedGroup = this.groupsService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).find(group => !(group.activeEditor instanceof GettingStartedInput)); + if (nonGettingStartedGroup) { + this.groupsService.activateGroup(nonGettingStartedGroup); + nonGettingStartedGroup.focus(); + } + } + this.openerService.open(command, { allowCommands: true }); + + if (!isCommand && (node.href.startsWith('https://') || node.href.startsWith('http://'))) { + this.gettingStartedService.progressByEvent('onLink:' + node.href); + } + + }, null, this.detailsPageDisposables); + + if (isCommand) { + const keybindingLabel = this.getKeybindingLabel(command); + if (keybindingLabel) { + container.appendChild($('span.shortcut-message', {}, 'Tip: Use keyboard shortcut ', $('span.keybinding', {}, keybindingLabel))); + } + } + + this.detailsPageDisposables.add(button); + this.detailsPageDisposables.add(attachButtonStyler(button, this.themeService)); + } else { + const p = append(container, $('p')); + for (const node of linkedText.nodes) { + if (typeof node === 'string') { + append(p, renderFormattedText(node, { inline: true, renderCodeSegments: true })); + } else { + const link = this.instantiationService.createInstance(Link, node, {}); + + append(p, link.el); + this.detailsPageDisposables.add(link); + } + } + } + } + return container; + } + + override clearInput() { + this.stepDisposables.clear(); + super.clearInput(); + } + + private buildCategorySlide(categoryID: string, selectedStep?: string) { + if (this.detailsScrollbar) { this.detailsScrollbar.dispose(); } + + this.extensionService.whenInstalledExtensionsRegistered().then(() => { + // Remove internal extension id specifier from exposed id's + this.extensionService.activateByEvent(`onWalkthrough:${categoryID.replace(/[^#]+#/, '')}`); + }); + + this.detailsPageDisposables.clear(); + + const category = this.gettingStartedCategories.find(category => category.id === categoryID); + if (!category) { throw Error('could not find category with ID ' + categoryID); } + + const categoryDescriptorComponent = + $('.getting-started-category', + {}, + this.iconWidgetFor(category), + $('.category-description-container', {}, + $('h2.category-title.max-lines-3', { 'x-category-title-for': category.id }, category.title), + $('.category-description.description.max-lines-3', { 'x-category-description-for': category.id }, category.description))); + + const stepListContainer = $('.step-list-container'); + + this.detailsPageDisposables.add(addDisposableListener(stepListContainer, 'keydown', (e) => { + const event = new StandardKeyboardEvent(e); + const currentStepIndex = () => + category.steps.findIndex(e => e.id === this.editorInput.selectedStep); + + if (event.keyCode === KeyCode.UpArrow) { + const toExpand = category.steps.filter((step, index) => index < currentStepIndex() && this.contextService.contextMatchesRules(step.when)); + if (toExpand.length) { + this.selectStep(toExpand[toExpand.length - 1].id, false, false); + } + } + if (event.keyCode === KeyCode.DownArrow) { + const toExpand = category.steps.find((step, index) => index > currentStepIndex() && this.contextService.contextMatchesRules(step.when)); + if (toExpand) { + this.selectStep(toExpand.id, false, false); + } + } + })); + + let renderedSteps: IResolvedWalkthroughStep[] | undefined = undefined; + + const contextKeysToWatch = new Set(category.steps.flatMap(step => step.when.keys())); + + const buildStepList = () => { + const toRender = category.steps + .filter(step => this.contextService.contextMatchesRules(step.when)); + + if (equals(renderedSteps, toRender, (a, b) => a.id === b.id)) { + return; + } + + renderedSteps = toRender; + + reset(stepListContainer, ...renderedSteps + .map(step => { + const codicon = $('.codicon' + (step.done ? '.complete' + ThemeIcon.asCSSSelector(gettingStartedCheckedCodicon) : ThemeIcon.asCSSSelector(gettingStartedUncheckedCodicon)), + { + 'data-done-step-id': step.id, + 'x-dispatch': 'toggleStepCompletion:' + step.id, + }); + + const container = $('.step-description-container', { 'x-step-description-for': step.id }); + this.buildStepMarkdownDescription(container, step.description); + + const stepDescription = $('.step-container', {}, + $('h3.step-title.max-lines-3', { 'x-step-title-for': step.id }, step.title), + container, + ); + + if (step.media.type === 'image') { + stepDescription.appendChild( + $('.image-description', { 'aria-label': localize('imageShowing', "Image showing {0}", step.media.altText) }), + ); + } + + return $('button.getting-started-step', + { + 'x-dispatch': 'selectTask:' + step.id, + 'data-step-id': step.id, + 'aria-expanded': 'false', + 'aria-checked': '' + step.done, + 'role': 'listitem', + }, + codicon, + stepDescription); + })); + }; + + buildStepList(); + + this.detailsPageDisposables.add(this.contextService.onDidChangeContext(e => { + if (e.affectsSome(contextKeysToWatch)) { + buildStepList(); + this.registerDispatchListeners(); + this.selectStep(this.editorInput.selectedStep, false, true); + } + })); + + const showNextCategory = this.gettingStartedCategories.find(_category => _category.id === category.next); + + const stepsContainer = $( + '.getting-started-detail-container', { 'role': 'list' }, + stepListContainer, + $('.done-next-container', {}, + $('button.button-link.all-done', { 'x-dispatch': 'allDone' }, $('span.codicon.codicon-check-all'), localize('allDone', "Mark Done")), + ...(showNextCategory + ? [$('button.button-link.next', { 'x-dispatch': 'nextSection' }, localize('nextOne', "Next Section"), $('span.codicon.codicon-arrow-small-right'))] + : []), + ) + ); + this.detailsScrollbar = this._register(new DomScrollableElement(stepsContainer, { className: 'steps-container' })); + const stepListComponent = this.detailsScrollbar.getDomNode(); + + const categoryFooter = $('.getting-started-footer'); + if (this.editorInput.showTelemetryNotice && this.configurationService.getValue('telemetry.enableTelemetry') && product.enableTelemetry) { + const mdRenderer = this._register(this.instantiationService.createInstance(MarkdownRenderer, {})); + + const privacyStatementCopy = localize('privacy statement', "privacy statement"); + const privacyStatementButton = `[${privacyStatementCopy}](command:workbench.action.openPrivacyStatementUrl)`; + + const optOutCopy = localize('optOut', "opt out"); + const optOutButton = `[${optOutCopy}](command:settings.filterByTelemetry)`; + + const text = localize({ key: 'footer', comment: ['fist substitution is "vs code", second is "privacy statement", third is "opt out".'] }, + "{0} collects usage data. Read our {1} and learn how to {2}.", product.nameShort, privacyStatementButton, optOutButton); + + categoryFooter.append(mdRenderer.render({ value: text, isTrusted: true }).element); + } + + reset(this.stepsContent, categoryDescriptorComponent, stepListComponent, this.stepMediaComponent, categoryFooter); + + const toExpand = category.steps.find(step => this.contextService.contextMatchesRules(step.when) && !step.done) ?? category.steps[0]; + this.selectStep(selectedStep ?? toExpand.id, !selectedStep, true); + + this.detailsScrollbar.scanDomNode(); + this.detailsPageScrollbar?.scanDomNode(); + + this.registerDispatchListeners(); + } + + private getKeybindingLabel(command: string) { + command = command.replace(/^command:/, ''); + const label = this.keybindingService.lookupKeybinding(command)?.getLabel(); + if (!label) { return ''; } + else { + return `(${label})`; + } + } + + private async scrollPrev() { + this.inProgressScroll = this.inProgressScroll.then(async () => { + this.currentWalkthrough = undefined; + this.editorInput.selectedCategory = undefined; + this.editorInput.selectedStep = undefined; + this.editorInput.showTelemetryNotice = false; + + this.selectStep(undefined); + this.setSlide('categories'); + this.container.focus(); + }); + } + + private runSkip() { + this.commandService.executeCommand('workbench.action.closeActiveEditor'); + } + + escape() { + if (this.editorInput.selectedCategory) { + this.scrollPrev(); + } else { + this.runSkip(); + } + } + + private setSlide(toEnable: 'details' | 'categories') { + const slideManager = assertIsDefined(this.container.querySelector('.gettingStarted')); + if (toEnable === 'categories') { + slideManager.classList.remove('showDetails'); + slideManager.classList.add('showCategories'); + this.container.querySelector('.gettingStartedSlideDetails')!.querySelectorAll('button').forEach(button => button.disabled = true); + this.container.querySelector('.gettingStartedSlideCategories')!.querySelectorAll('button').forEach(button => button.disabled = false); + this.container.querySelector('.gettingStartedSlideCategories')!.querySelectorAll('input').forEach(button => button.disabled = false); + } else { + slideManager.classList.add('showDetails'); + slideManager.classList.remove('showCategories'); + this.container.querySelector('.gettingStartedSlideDetails')!.querySelectorAll('button').forEach(button => button.disabled = false); + this.container.querySelector('.gettingStartedSlideCategories')!.querySelectorAll('button').forEach(button => button.disabled = true); + this.container.querySelector('.gettingStartedSlideCategories')!.querySelectorAll('input').forEach(button => button.disabled = true); + } + } + + override focus() { + this.container.focus(); + } +} + +export class GettingStartedInputSerializer implements IEditorSerializer { + public canSerialize(editorInput: GettingStartedInput): boolean { + return true; + } + + public serialize(editorInput: GettingStartedInput): string { + return JSON.stringify({ selectedCategory: editorInput.selectedCategory, selectedStep: editorInput.selectedStep }); + } + + public deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): GettingStartedInput { + try { + const { selectedCategory, selectedStep } = JSON.parse(serializedEditorInput); + return new GettingStartedInput({ selectedCategory, selectedStep }); + } catch { } + return new GettingStartedInput({}); + } +} + +registerThemingParticipant((theme, collector) => { + + const backgroundColor = theme.getColor(welcomePageBackground); + if (backgroundColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer { background-color: ${backgroundColor}; }`); + } + + const foregroundColor = theme.getColor(foreground); + if (foregroundColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer { color: ${foregroundColor}; }`); + } + + const descriptionColor = theme.getColor(descriptionForeground); + if (descriptionColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .description { color: ${descriptionColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .category-progress .message { color: ${descriptionColor}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .gettingStartedDetailsContent > .getting-started-footer { color: ${descriptionColor}; }`); + } + + const iconColor = theme.getColor(textLinkForeground); + if (iconColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .getting-started-category .codicon:not(.codicon-close) { color: ${iconColor} }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .getting-started-step .codicon.complete { color: ${iconColor} } `); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .getting-started-step.expanded .codicon { color: ${iconColor} } `); + } + + const buttonColor = theme.getColor(welcomePageTileBackground); + if (buttonColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button { background: ${buttonColor}; }`); + } + + const shadowColor = theme.getColor(welcomePageTileShadow); + if (shadowColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .getting-started-category { filter: drop-shadow(2px 2px 2px ${buttonColor}); }`); + } + + const buttonHoverColor = theme.getColor(welcomePageTileHoverBackground); + if (buttonHoverColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button:hover { background: ${buttonHoverColor}; }`); + } + if (buttonColor && buttonHoverColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.expanded:hover { background: ${buttonColor}; }`); + } + + const emphasisButtonForeground = theme.getColor(buttonForeground); + if (emphasisButtonForeground) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.emphasis { color: ${emphasisButtonForeground}; }`); + } + + const emphasisButtonBackground = theme.getColor(buttonBackground); + if (emphasisButtonBackground) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.emphasis { background: ${emphasisButtonBackground}; }`); + } + + const pendingStepColor = theme.getColor(descriptionForeground); + if (pendingStepColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .getting-started-step .codicon { color: ${pendingStepColor} } `); + } + + const emphasisButtonHoverBackground = theme.getColor(buttonHoverBackground); + if (emphasisButtonHoverBackground) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.emphasis:hover { background: ${emphasisButtonHoverBackground}; }`); + } + + const link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.hide-category-button) { color: ${link}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .button-link { color: ${link}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .button-link .codicon { color: ${link}; }`); + } + const activeLink = theme.getColor(textLinkActiveForeground); + if (activeLink) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.hide-category-button):hover { color: ${activeLink}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.hide-category-button):active { color: ${activeLink}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.button-link:hover { color: ${activeLink}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.button-link:hover .codicon { color: ${activeLink}; }`); + } + const focusColor = theme.getColor(focusBorder); + if (focusColor) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.codicon-close):focus { outline-color: ${focusColor}; }`); + } + const border = theme.getColor(contrastBorder); + if (border) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button { border: 1px solid ${border}; }`); + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.button-link { border: inherit; }`); + } + const activeBorder = theme.getColor(activeContrastBorder); + if (activeBorder) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button:hover { outline-color: ${activeBorder}; }`); + } + + const progressBackground = theme.getColor(welcomePageProgressBackground); + if (progressBackground) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .progress-bar-outer { background-color: ${progressBackground}; }`); + } + const progressForeground = theme.getColor(welcomePageProgressForeground); + if (progressForeground) { + collector.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .progress-bar-inner { background-color: ${progressForeground}; }`); + } + + const newBadgeForeground = theme.getColor(ACTIVITY_BAR_BADGE_FOREGROUND); + if (newBadgeForeground) { + collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .new-badge { color: ${newBadgeForeground}; }`); + collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .featured .featured-icon { color: ${newBadgeForeground}; }`); + } + + const newBadgeBackground = theme.getColor(ACTIVITY_BAR_BADGE_BACKGROUND); + if (newBadgeBackground) { + collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .new-badge { background-color: ${newBadgeBackground}; }`); + collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .featured { border-top-color: ${newBadgeBackground}; }`); + } +}); diff --git a/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts b/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts deleted file mode 100644 index 4d2cb2ba7..000000000 --- a/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { escape } from 'vs/base/common/strings'; -import { localize } from 'vs/nls'; - -// below codes are changed by github1s -export default () => ` -
-
-
-

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

-

- One second to read GitHub code with VS Code -

-
-
-
-
-

Rate limit Info:

-
    -
  • ------------------------------
  • -
  • X-RateLimit-Limit:
  • -
  • X-RateLimit-Remaining:
  • -
  • X-RateLimit-Reset:
  • -
  • ------------------------------
  • -
  • Current rate limit window will reset after s
  • -
  • GitHub Rate limiting Documentation
  • -
-
-
-

${escape(localize('welcomePage.help', "Help"))}

- -
-

-
-
-
-

Authentication

-
-
-
-
-
-
-
-

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

-
-
-
-
-
-
-
-
-
-`; -// above codes are changed by github1s diff --git a/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts b/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts new file mode 100644 index 000000000..f2beb2c3a --- /dev/null +++ b/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { localize } from 'vs/nls'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { WelcomePageContribution, } from 'vs/workbench/contrib/welcome/page/browser/welcomePage'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; +import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; +import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; + +Registry.as(ConfigurationExtensions.Configuration) + .registerConfiguration({ + ...workbenchConfigurationNodeBase, + 'properties': { + 'workbench.startupEditor': { + 'scope': ConfigurationScope.RESOURCE, + 'type': 'string', + 'enum': ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench'], + 'enumDescriptions': [ + localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.none' }, "Start without an editor."), + localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePage' }, "Open the Welcome page, with content to aid in getting started with VS Code and extensions."), + localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.readme' }, "Open the README when opening a folder that contains one, fallback to 'welcomePage' otherwise. Note: This is only observed as a global configuration, it will be ignored if set in a workspace or folder configuration."), + localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.newUntitledFile' }, "Open a new untitled file (only applies when opening an empty window)."), + localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePageInEmptyWorkbench' }, "Open the Welcome page when opening an empty workbench."), + ], + // below codes are changed by github1s + 'default': 'readme', + // above codes are changed by github1s + 'description': localize('workbench.startupEditor', "Controls which editor is shown at startup, if none are restored from the previous session.") + }, + } + }); + +Registry.as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(WelcomePageContribution, LifecyclePhase.Restored); diff --git a/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts b/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts deleted file mode 100644 index 1d5d2624a..000000000 --- a/vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts +++ /dev/null @@ -1,899 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import 'vs/css!./welcomePage'; -import 'vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page'; -import { URI } from 'vs/base/common/uri'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import * as arrays from 'vs/base/common/arrays'; -import { WalkThroughInput } from 'vs/workbench/contrib/welcome/walkThrough/browser/walkThroughInput'; -import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { onUnexpectedError, isPromiseCanceledError } from 'vs/base/common/errors'; -import { IWindowOpenable } from 'vs/platform/windows/common/windows'; -import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { localize } from 'vs/nls'; -import { Action, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { FileAccess, Schemas } from 'vs/base/common/network'; -import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; -import { getInstalledExtensions, IExtensionStatus, onExtensionChanged, isKeymapExtension } from 'vs/workbench/contrib/extensions/common/extensionsUtils'; -import { IExtensionManagementService, IExtensionGalleryService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { IWorkbenchExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; -import { ILifecycleService, StartupKind } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { splitName } from 'vs/base/common/labels'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { focusBorder, textLinkForeground, textLinkActiveForeground, foreground, descriptionForeground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { getExtraColor } from 'vs/workbench/contrib/welcome/walkThrough/common/walkThroughUtils'; -import { IExtensionsViewPaneContainer, IExtensionsWorkbenchService, VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions'; -import { IEditorInputFactory, EditorInput } from 'vs/workbench/common/editor'; -import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { TimeoutTimer } from 'vs/base/common/async'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ILabelService } from 'vs/platform/label/common/label'; -import { IFileService } from 'vs/platform/files/common/files'; -import { joinPath } from 'vs/base/common/resources'; -import { IRecentlyOpened, isRecentWorkspace, IRecentWorkspace, IRecentFolder, isRecentFolder, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { IProductService } from 'vs/platform/product/common/productService'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { GettingStartedInput, gettingStartedInputTypeId } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedInput'; -import { welcomeButtonBackground, welcomeButtonHoverBackground, welcomePageBackground } from 'vs/workbench/contrib/welcome/page/browser/welcomePageColors'; -import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigurationNode, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; -import { ILogService } from 'vs/platform/log/common/log'; -import { IGettingStartedService } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedService'; - - -export const DEFAULT_STARTUP_EDITOR_CONFIG: IConfigurationNode = { - ...workbenchConfigurationNodeBase, - 'properties': { - 'workbench.startupEditor': { - 'scope': ConfigurationScope.RESOURCE, - 'type': 'string', - 'enum': ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench', 'gettingStarted'], - 'enumDescriptions': [...[ - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.none' }, "Start without an editor."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePage' }, "Open the Welcome page."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.readme' }, "Open the README when opening a folder that contains one, fallback to 'welcomePage' otherwise."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.newUntitledFile' }, "Open a new untitled file (only applies when opening an empty window)."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePageInEmptyWorkbench' }, "Open the Welcome page when opening an empty workbench."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.gettingStarted' }, "Open the Getting Started page.")] - ], - 'default': 'welcomePage', - 'description': localize('workbench.startupEditor', "Controls which editor is shown at startup, if none are restored from the previous session.") - }, - } -}; - -export const EXPERIMENTAL_GETTING_STARTED_STARTUP_EDITOR_CONFIG: IConfigurationNode = { - ...workbenchConfigurationNodeBase, - 'properties': { - 'workbench.startupEditor': { - 'scope': ConfigurationScope.RESOURCE, - 'type': 'string', - 'enum': ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench', 'gettingStarted'], - 'enumDescriptions': [...[ - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.none' }, "Start without an editor."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePage' }, "Open the Welcome page."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.readme' }, "Open the README when opening a folder that contains one, fallback to 'welcomePage' otherwise."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.newUntitledFile' }, "Open a new untitled file (only applies when opening an empty window)."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePageInEmptyWorkbench' }, "Open the Welcome page when opening an empty workbench."), - localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.gettingStarted' }, "Open the Getting Started page.")] - ], - 'default': 'gettingStarted', - 'description': localize('workbench.startupEditor', "Controls which editor is shown at startup, if none are restored from the previous session.") - }, - } -}; - -const configurationKey = 'workbench.startupEditor'; -const oldConfigurationKey = 'workbench.welcome.enabled'; -const telemetryFrom = 'welcomePage'; - -export class WelcomePageContribution implements IWorkbenchContribution { - private experimentManagementComplete: Promise; - private tasExperimentService: ITASExperimentService | undefined; - - constructor( - @IInstantiationService private readonly instantiationService: IInstantiationService, - @IConfigurationService private readonly configurationService: IConfigurationService, - @IEditorService private readonly editorService: IEditorService, - @IBackupFileService private readonly backupFileService: IBackupFileService, - @IFileService private readonly fileService: IFileService, - @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, - @ILifecycleService private readonly lifecycleService: ILifecycleService, - @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, - @ICommandService private readonly commandService: ICommandService, - @ITelemetryService private readonly telemetryService: ITelemetryService, - @ILogService private readonly logService: ILogService, - @IGettingStartedService _gettingStartedService: IGettingStartedService, // initializes event listeners - @optional(ITASExperimentService) tasExperimentService: ITASExperimentService, - ) { - this.tasExperimentService = tasExperimentService; - - // Run immediately to minimize time spent waiting for exp service. - this.experimentManagementComplete = this.manageDefaultValuesForGettingStartedExperiment().catch(onUnexpectedError); - this.run().then(undefined, onUnexpectedError); - } - - private async manageDefaultValuesForGettingStartedExperiment() { - const config = this.configurationService.inspect(configurationKey); - - if (this.lifecycleService.startupKind === StartupKind.ReloadedWindow || config.value !== config.defaultValue) { - return; - } - - if (this.configurationService.getValue('workbench.gettingStartedTreatmentOverride')) { - await new Promise(resolve => setTimeout(resolve, 1000)); - Registry.as(ConfigurationExtensions.Configuration).deregisterConfigurations([DEFAULT_STARTUP_EDITOR_CONFIG]); - Registry.as(ConfigurationExtensions.Configuration).registerConfiguration(EXPERIMENTAL_GETTING_STARTED_STARTUP_EDITOR_CONFIG); - } - - let someValueReturned = false; - type GettingStartedTreatmentData = { value: string; }; - type GettingStartedTreatmentClassification = { value: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth' }; }; - - const tasUseGettingStartedAsDefault = this.tasExperimentService?.getTreatment('StartupGettingStarted') - .then(result => { - this.logService.trace('StartupGettingStarted:', result); - this.telemetryService.publicLog2('gettingStartedTreatmentValue', { value: '' + !!result }); - someValueReturned = true; - return result; - }) - .catch(error => { - this.logService.error('Recieved error when consulting experiment service for getting started experiment', error); - this.telemetryService.publicLog2('gettingStartedTreatmentValue', { value: 'err' }); - someValueReturned = true; - return false; - }); - - const fallback = new Promise(c => setTimeout(() => c(false), 2000)).then( - () => { - if (!someValueReturned) { this.logService.trace('Unable to read getting started treatment data in time, falling back to welcome'); } - someValueReturned = true; - } - ); - - const useGettingStartedAsDefault = !!await Promise.race([tasUseGettingStartedAsDefault, fallback]); - if (useGettingStartedAsDefault) { - Registry.as(ConfigurationExtensions.Configuration).deregisterConfigurations([DEFAULT_STARTUP_EDITOR_CONFIG]); - Registry.as(ConfigurationExtensions.Configuration).registerConfiguration(EXPERIMENTAL_GETTING_STARTED_STARTUP_EDITOR_CONFIG); - } - } - - private async run() { - const enabled = isWelcomePageEnabled(this.configurationService, this.contextService); - if (enabled && this.lifecycleService.startupKind !== StartupKind.ReloadedWindow) { - const hasBackups = await this.backupFileService.hasBackups(); - if (hasBackups) { return; } - - // Open the welcome even if we opened a set of default editors - if (!this.editorService.activeEditor || this.layoutService.openedDefaultEditors) { - const startupEditorSetting = this.configurationService.inspect(configurationKey); - - // 'readme' should not be set in workspace settings to prevent tracking, - // but it can be set as a default (as in codespaces) or a user setting - // below codes are changed by github1s - // we should try to open readme first - const openWithReadme = true || startupEditorSetting.value === 'readme' && - (startupEditorSetting.userValue === 'readme' || startupEditorSetting.defaultValue === 'readme'); - // above codes are changed by github1s - - if (openWithReadme) { - await this.openReadme(); - } else { - await this.openWelcome(); - } - } - } - } - - private async openReadme() { - const readmes = arrays.coalesce( - await Promise.all(this.contextService.getWorkspace().folders.map( - async folder => { - const folderUri = folder.uri; - const folderStat = await this.fileService.resolve(folderUri).catch(onUnexpectedError); - const files = folderStat?.children ? folderStat.children.map(child => child.name).sort() : []; - const file = files.find(file => file.toLowerCase() === 'readme.md') || files.find(file => file.toLowerCase().startsWith('readme')); - if (file) { return joinPath(folderUri, file); } - else { return undefined; } - }))); - - if (!this.editorService.activeEditor) { - if (readmes.length) { - const isMarkDown = (readme: URI) => readme.path.toLowerCase().endsWith('.md'); - await Promise.all([ - this.commandService.executeCommand('markdown.showPreview', null, readmes.filter(isMarkDown), { locked: true }), - this.editorService.openEditors(readmes.filter(readme => !isMarkDown(readme)).map(readme => ({ resource: readme }))), - ]); - } else { - await this.openWelcome(); - } - } - } - - private async openWelcome() { - await this.experimentManagementComplete; - - const startupEditorSetting = this.configurationService.getValue(configurationKey); - const startupEditorTypeID = startupEditorSetting === 'gettingStarted' ? gettingStartedInputTypeId : welcomeInputTypeId; - const editor = this.editorService.activeEditor; - - // Ensure that the welcome editor won't get opened more than once - if (editor?.getTypeId() === startupEditorTypeID || this.editorService.editors.some(e => e.getTypeId() === startupEditorTypeID)) { - return; - } - const options: IEditorOptions = editor ? { pinned: false, index: 0 } : { pinned: false }; - if (startupEditorTypeID === gettingStartedInputTypeId) { - this.editorService.openEditor(this.instantiationService.createInstance(GettingStartedInput, {}), options); - } else { - this.instantiationService.createInstance(WelcomePage).openEditor(options); - } - } -} - -function isWelcomePageEnabled(configurationService: IConfigurationService, contextService: IWorkspaceContextService) { - const startupEditor = configurationService.inspect(configurationKey); - if (!startupEditor.userValue && !startupEditor.workspaceValue) { - const welcomeEnabled = configurationService.inspect(oldConfigurationKey); - if (welcomeEnabled.value !== undefined && welcomeEnabled.value !== null) { - return welcomeEnabled.value; - } - } - if (startupEditor.value === 'readme' && startupEditor.userValue !== 'readme') { - console.error('Warning: `workbench.startupEditor: readme` setting ignored due to being set somewhere other than user settings'); - } - return startupEditor.value === 'welcomePage' || startupEditor.value === 'gettingStarted' || startupEditor.userValue === 'readme' || startupEditor.value === 'welcomePageInEmptyWorkbench' && contextService.getWorkbenchState() === WorkbenchState.EMPTY; -} - -export class WelcomePageAction extends Action { - - public static readonly ID = 'workbench.action.showWelcomePage'; - public static readonly LABEL = localize('welcomePage', "Welcome"); - - constructor( - id: string, - label: string, - @IInstantiationService private readonly instantiationService: IInstantiationService - ) { - super(id, label); - } - - public run(): Promise { - return this.instantiationService.createInstance(WelcomePage) - .openEditor() - .then(() => undefined); - } -} - -interface ExtensionSuggestion { - name: string; - title?: string; - id: string; - isKeymap?: boolean; - isCommand?: boolean; -} - -const extensionPacks: ExtensionSuggestion[] = [ - { name: localize('welcomePage.javaScript', "JavaScript"), id: 'dbaeumer.vscode-eslint' }, - { name: localize('welcomePage.python', "Python"), id: 'ms-python.python' }, - { name: localize('welcomePage.java', "Java"), id: 'vscjava.vscode-java-pack' }, - { name: localize('welcomePage.php', "PHP"), id: 'felixfbecker.php-pack' }, - { name: localize('welcomePage.azure', "Azure"), title: localize('welcomePage.showAzureExtensions', "Show Azure extensions"), id: 'workbench.extensions.action.showAzureExtensions', isCommand: true }, - { name: localize('welcomePage.docker', "Docker"), id: 'ms-azuretools.vscode-docker' }, -]; - -const keymapExtensions: ExtensionSuggestion[] = [ - { name: localize('welcomePage.vim', "Vim"), id: 'vscodevim.vim', isKeymap: true }, - { name: localize('welcomePage.sublime', "Sublime"), id: 'ms-vscode.sublime-keybindings', isKeymap: true }, - { name: localize('welcomePage.atom', "Atom"), id: 'ms-vscode.atom-keybindings', isKeymap: true }, -]; - -interface Strings { - installEvent: string; - installedEvent: string; - detailsEvent: string; - - alreadyInstalled: string; - reloadAfterInstall: string; - installing: string; - extensionNotFound: string; -} - -/* __GDPR__ - "installExtension" : { - "${include}": [ - "${WelcomePageInstall-1}" - ] - } -*/ -/* __GDPR__ - "installedExtension" : { - "${include}": [ - "${WelcomePageInstalled-1}", - "${WelcomePageInstalled-2}", - "${WelcomePageInstalled-3}", - "${WelcomePageInstalled-4}", - "${WelcomePageInstalled-6}" - ] - } -*/ -/* __GDPR__ - "detailsExtension" : { - "${include}": [ - "${WelcomePageDetails-1}" - ] - } -*/ -const extensionPackStrings: Strings = { - installEvent: 'installExtension', - installedEvent: 'installedExtension', - detailsEvent: 'detailsExtension', - - alreadyInstalled: localize('welcomePage.extensionPackAlreadyInstalled', "Support for {0} is already installed."), - reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingExtensionPack', "The window will reload after installing additional support for {0}."), - installing: localize('welcomePage.installingExtensionPack', "Installing additional support for {0}..."), - extensionNotFound: localize('welcomePage.extensionPackNotFound', "Support for {0} with id {1} could not be found."), -}; - -CommandsRegistry.registerCommand('workbench.extensions.action.showAzureExtensions', accessor => { - const viewletService = accessor.get(IViewletService); - return viewletService.openViewlet(VIEWLET_ID, true) - .then(viewlet => viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer) - .then(viewlet => { - viewlet.search('@sort:installs azure '); - viewlet.focus(); - }); -}); - -/* __GDPR__ - "installKeymap" : { - "${include}": [ - "${WelcomePageInstall-1}" - ] - } -*/ -/* __GDPR__ - "installedKeymap" : { - "${include}": [ - "${WelcomePageInstalled-1}", - "${WelcomePageInstalled-2}", - "${WelcomePageInstalled-3}", - "${WelcomePageInstalled-4}", - "${WelcomePageInstalled-6}" - ] - } -*/ -/* __GDPR__ - "detailsKeymap" : { - "${include}": [ - "${WelcomePageDetails-1}" - ] - } -*/ -const keymapStrings: Strings = { - installEvent: 'installKeymap', - installedEvent: 'installedKeymap', - detailsEvent: 'detailsKeymap', - - alreadyInstalled: localize('welcomePage.keymapAlreadyInstalled', "The {0} keyboard shortcuts are already installed."), - reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingKeymap', "The window will reload after installing the {0} keyboard shortcuts."), - installing: localize('welcomePage.installingKeymap', "Installing the {0} keyboard shortcuts..."), - extensionNotFound: localize('welcomePage.keymapNotFound', "The {0} keyboard shortcuts with id {1} could not be found."), -}; - -const welcomeInputTypeId = 'workbench.editors.welcomePageInput'; - -class WelcomePage extends Disposable { - - readonly editorInput: WalkThroughInput; - - constructor( - @IEditorService private readonly editorService: IEditorService, - @IInstantiationService private readonly instantiationService: IInstantiationService, - @IWorkspacesService private readonly workspacesService: IWorkspacesService, - @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, - @IConfigurationService private readonly configurationService: IConfigurationService, - @ILabelService private readonly labelService: ILabelService, - @INotificationService private readonly notificationService: INotificationService, - @IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService, - @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, - @IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService, - @IExtensionRecommendationsService private readonly tipsService: IExtensionRecommendationsService, - @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, - @ILifecycleService lifecycleService: ILifecycleService, - @ITelemetryService private readonly telemetryService: ITelemetryService, - @IHostService private readonly hostService: IHostService, - @IProductService private readonly productService: IProductService, - // below codes are changed by github1s - @ICommandService private readonly commandService: ICommandService, - // above codes are changed by github1s - ) { - super(); - this._register(lifecycleService.onShutdown(() => this.dispose())); - - // below codes are changed by github1s - const gitHubTokenStatus = this.getGitHubTokenStatus(); - // above codes are changed by github1s - const recentlyOpened = this.workspacesService.getRecentlyOpened(); - const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions); - const resource = FileAccess.asBrowserUri('./vs_code_welcome_page', require) - .with({ - scheme: Schemas.walkThrough, - query: JSON.stringify({ moduleId: 'vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page' }) - }); - this.editorInput = this.instantiationService.createInstance(WalkThroughInput, { - typeId: welcomeInputTypeId, - name: localize('welcome.title', "Welcome"), - resource, - telemetryFrom, - // below codes are changed by github1s - onReady: (container: HTMLElement) => this.onReady(container, recentlyOpened, installedExtensions, gitHubTokenStatus) - // above codes are changed by github1s - }); - } - - public openEditor(options: IEditorOptions = { pinned: false }) { - return this.editorService.openEditor(this.editorInput, options); - } - - // below codes are changed by github1s - private onReady(container: HTMLElement, recentlyOpened: Promise, installedExtensions: Promise, gitHubTokenStatus: Promise): void { - // above codes are changed by github1s - const enabled = this.configurationService.getValue(configurationKey) === 'welcomePage'; - const showOnStartup = container.querySelector('#showOnStartup'); - if (enabled) { - showOnStartup.setAttribute('checked', 'checked'); - } - showOnStartup.addEventListener('click', e => { - this.configurationService.updateValue(configurationKey, showOnStartup.checked ? 'welcomePage' : 'newUntitledFile'); - }); - - const prodName = container.querySelector('.welcomePage .title .caption') as HTMLElement; - if (prodName) { - prodName.textContent = this.productService.nameLong; - } - - // below codes are changed by github1s - gitHubTokenStatus.then(tokenStatus => this.doUpdateGitHubTokenStatus(container, tokenStatus)); - this.registerGitHub1sListeners(container); - // above codes are changed by github1s - recentlyOpened.then(({ workspaces }) => { - // Filter out the current workspace - workspaces = workspaces.filter(recent => !this.contextService.isCurrentWorkspace(isRecentWorkspace(recent) ? recent.workspace : recent.folderUri)); - if (!workspaces.length) { - const recent = container.querySelector('.welcomePage') as HTMLElement; - recent.classList.add('emptyRecent'); - return; - } - const ul = container.querySelector('.recent ul'); - if (!ul) { - return; - } - const moreRecent = ul.querySelector('.moreRecent')!; - const workspacesToShow = workspaces.slice(0, 5); - const updateEntries = () => { - const listEntries = this.createListEntries(workspacesToShow); - while (ul.firstChild) { - ul.removeChild(ul.firstChild); - } - ul.append(...listEntries, moreRecent); - }; - updateEntries(); - this._register(this.labelService.onDidChangeFormatters(updateEntries)); - }).then(undefined, onUnexpectedError); - - this.addExtensionList(container, '.extensionPackList', extensionPacks, extensionPackStrings); - this.addExtensionList(container, '.keymapList', keymapExtensions, keymapStrings); - - this.updateInstalledExtensions(container, installedExtensions); - this._register(this.instantiationService.invokeFunction(onExtensionChanged)(ids => { - for (const id of ids) { - if (container.querySelector(`.installExtension[data-extension="${id.id}"], .enabledExtension[data-extension="${id.id}"]`)) { - const installedExtensions = this.instantiationService.invokeFunction(getInstalledExtensions); - this.updateInstalledExtensions(container, installedExtensions); - break; - } - } - })); - } - - // below codes are changed by github1s - registerGitHub1sListeners(container: HTMLElement) { - container.querySelector('.refresh-button')?.addEventListener('click', () => this.refreshGitHubTokenStatus(container)); - container.querySelector('.create-new-token')?.addEventListener('click', () => window?.open('https://github.com/settings/tokens/new?scopes=repo&description=GitHub1s')); - container.querySelector('.update-oauth-token')?.addEventListener('click', () => this.commandService.executeCommand('github1s.authorizing-github-with-overlay').then(() => this.refreshGitHubTokenStatus(container))); - container.querySelector('.clear-oauth-token')?.addEventListener('click', () => this.commandService.executeCommand('github1s.clear-token').then(() => this.refreshGitHubTokenStatus(container))); - } - - updateElementText(element: HTMLElement, text: string | number, type?: 'SUCCESS' | 'WARNING' | 'ERROR') { - if (!element) { - return; - } - element.innerText = `${text}`; - element.classList.remove('text-warning', 'text-error', 'text-success'); - if (type === 'SUCCESS') { - element.classList.add('text-success'); - } else if (type === 'WARNING') { - element.classList.add('text-warning'); - } else if (type === 'ERROR') { - element.classList.add('text-error'); - } - } - - getGitHubTokenStatus() { - return this.commandService.executeCommand('github1s.validate-token', '', true); - } - - refreshGitHubTokenStatus(container: HTMLElement) { - const statusElement = container.querySelector('.rate-limit-status'); - this.updateElementText(statusElement, ''); - this.getGitHubTokenStatus().then(tokenStatus => { - this.doUpdateGitHubTokenStatus(container, tokenStatus); - }); - } - - doUpdateGitHubTokenStatus(container: HTMLElement, tokenStatus?: any) { - const statusElement = container.querySelector('.rate-limit-status'); - const limitElement = container.querySelector('.x-rate-limit-limit'); - const remainingElement = container.querySelector('.x-rate-limit-remaining'); - const resetElement = container.querySelector('.x-rate-limit-reset'); - const timerElement = container.querySelector('.rate-limit-reset-seconds'); - - if (!tokenStatus) { - this.updateElementText(statusElement, 'Unknown', 'WARNING'); - this.updateElementText(limitElement, 'Unknown', 'WARNING'); - this.updateElementText(remainingElement, 'Unknown', 'WARNING'); - this.updateElementText(resetElement, 'Unknown'); - this.updateElementText(timerElement, 'Unknown', 'WARNING'); - return; - } - - const textType = (value: number) => { - if (value <= 0) { - return 'ERROR'; - } - if (value > 99) { - return 'SUCCESS'; - } - return 'WARNING'; - }; - this.updateElementText(limitElement, tokenStatus.limit, textType(+tokenStatus.limit)); - this.updateElementText(remainingElement, tokenStatus.remaining, textType(+tokenStatus.remaining)); - this.updateElementText(resetElement, tokenStatus.reset); - this.updateElementText(timerElement, Math.max(tokenStatus.reset - Math.ceil(Date.now() / 1000), 0)); - - if (!tokenStatus.token) { - this.updateElementText(statusElement, 'Unauthorized', 'WARNING'); - return; - } - if (tokenStatus.valid) { - this.updateElementText(statusElement, 'Authorized', 'SUCCESS'); - return; - } - this.updateElementText(statusElement, 'Invalid Token', 'ERROR'); - } - // above codes are changed by github1s - - private createListEntries(recents: (IRecentWorkspace | IRecentFolder)[]) { - return recents.map(recent => { - let fullPath: string; - let windowOpenable: IWindowOpenable; - if (isRecentFolder(recent)) { - windowOpenable = { folderUri: recent.folderUri }; - fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.folderUri, { verbose: true }); - } else { - fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.workspace, { verbose: true }); - windowOpenable = { workspaceUri: recent.workspace.configPath }; - } - - const { name, parentPath } = splitName(fullPath); - - const li = document.createElement('li'); - const a = document.createElement('a'); - - a.innerText = name; - a.title = fullPath; - a.setAttribute('aria-label', localize('welcomePage.openFolderWithPath', "Open folder {0} with path {1}", name, parentPath)); - a.href = 'javascript:void(0)'; - a.addEventListener('click', e => { - this.telemetryService.publicLog2('workbenchActionExecuted', { - id: 'openRecentFolder', - from: telemetryFrom - }); - this.hostService.openWindow([windowOpenable], { forceNewWindow: e.ctrlKey || e.metaKey, remoteAuthority: recent.remoteAuthority }); - e.preventDefault(); - e.stopPropagation(); - }); - li.appendChild(a); - - const span = document.createElement('span'); - span.classList.add('path'); - span.classList.add('detail'); - span.innerText = parentPath; - span.title = fullPath; - li.appendChild(span); - - return li; - }); - } - - private addExtensionList(container: HTMLElement, listSelector: string, suggestions: ExtensionSuggestion[], strings: Strings) { - const list = container.querySelector(listSelector); - if (list) { - suggestions.forEach((extension, i) => { - if (i) { - list.appendChild(document.createTextNode(localize('welcomePage.extensionListSeparator', ", "))); - } - - const a = document.createElement('a'); - a.innerText = extension.name; - a.title = extension.title || (extension.isKeymap ? localize('welcomePage.installKeymap', "Install {0} keymap", extension.name) : localize('welcomePage.installExtensionPack', "Install additional support for {0}", extension.name)); - if (extension.isCommand) { - a.href = `command:${extension.id}`; - list.appendChild(a); - } else { - a.classList.add('installExtension'); - a.setAttribute('data-extension', extension.id); - a.href = 'javascript:void(0)'; - a.addEventListener('click', e => { - this.installExtension(extension, strings); - e.preventDefault(); - e.stopPropagation(); - }); - list.appendChild(a); - - const span = document.createElement('span'); - span.innerText = extension.name; - span.title = extension.isKeymap ? localize('welcomePage.installedKeymap', "{0} keymap is already installed", extension.name) : localize('welcomePage.installedExtensionPack', "{0} support is already installed", extension.name); - span.classList.add('enabledExtension'); - span.setAttribute('data-extension', extension.id); - list.appendChild(span); - } - }); - } - } - - private installExtension(extensionSuggestion: ExtensionSuggestion, strings: Strings): void { - /* __GDPR__FRAGMENT__ - "WelcomePageInstall-1" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.installEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - }); - this.instantiationService.invokeFunction(getInstalledExtensions).then(extensions => { - const installedExtension = extensions.find(extension => areSameExtensions(extension.identifier, { id: extensionSuggestion.id })); - if (installedExtension && installedExtension.globallyEnabled) { - /* __GDPR__FRAGMENT__ - "WelcomePageInstalled-1" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "outcome": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.installedEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - outcome: 'already_enabled', - }); - this.notificationService.info(strings.alreadyInstalled.replace('{0}', extensionSuggestion.name)); - return; - } - const foundAndInstalled = installedExtension ? Promise.resolve(installedExtension.local) : this.extensionGalleryService.query({ names: [extensionSuggestion.id], source: telemetryFrom }, CancellationToken.None) - .then((result): null | Promise => { - const [extension] = result.firstPage; - if (!extension) { - return null; - } - return this.extensionManagementService.installFromGallery(extension) - .then(() => this.extensionManagementService.getInstalled()) - .then(installed => { - const local = installed.filter(i => areSameExtensions(extension.identifier, i.identifier))[0]; - // TODO: Do this as part of the install to avoid multiple events. - return this.extensionEnablementService.setEnablement([local], EnablementState.DisabledGlobally).then(() => local); - }); - }); - - this.notificationService.prompt( - Severity.Info, - strings.reloadAfterInstall.replace('{0}', extensionSuggestion.name), - [{ - label: localize('ok', "OK"), - run: () => { - const messageDelay = new TimeoutTimer(); - messageDelay.cancelAndSet(() => { - this.notificationService.info(strings.installing.replace('{0}', extensionSuggestion.name)); - }, 300); - const extensionsToDisable = extensions.filter(extension => isKeymapExtension(this.tipsService, extension) && extension.globallyEnabled).map(extension => extension.local); - extensionsToDisable.length ? this.extensionEnablementService.setEnablement(extensionsToDisable, EnablementState.DisabledGlobally) : Promise.resolve() - .then(() => { - return foundAndInstalled.then(foundExtension => { - messageDelay.cancel(); - if (foundExtension) { - return this.extensionEnablementService.setEnablement([foundExtension], EnablementState.EnabledGlobally) - .then(() => { - /* __GDPR__FRAGMENT__ - "WelcomePageInstalled-2" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "outcome": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.installedEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - outcome: installedExtension ? 'enabled' : 'installed', - }); - return this.hostService.reload(); - }); - } else { - /* __GDPR__FRAGMENT__ - "WelcomePageInstalled-3" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "outcome": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.installedEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - outcome: 'not_found', - }); - this.notificationService.error(strings.extensionNotFound.replace('{0}', extensionSuggestion.name).replace('{1}', extensionSuggestion.id)); - return undefined; - } - }); - }).then(undefined, err => { - /* __GDPR__FRAGMENT__ - "WelcomePageInstalled-4" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "outcome": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.installedEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - outcome: isPromiseCanceledError(err) ? 'canceled' : 'error', - }); - this.notificationService.error(err); - }); - } - }, { - label: localize('details', "Details"), - run: () => { - /* __GDPR__FRAGMENT__ - "WelcomePageDetails-1" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.detailsEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - }); - this.extensionsWorkbenchService.queryGallery({ names: [extensionSuggestion.id] }, CancellationToken.None) - .then(result => this.extensionsWorkbenchService.open(result.firstPage[0])) - .then(undefined, onUnexpectedError); - } - }] - ); - }).then(undefined, err => { - /* __GDPR__FRAGMENT__ - "WelcomePageInstalled-6" : { - "from" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "outcome": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog(strings.installedEvent, { - from: telemetryFrom, - extensionId: extensionSuggestion.id, - outcome: isPromiseCanceledError(err) ? 'canceled' : 'error', - }); - this.notificationService.error(err); - }); - } - - private updateInstalledExtensions(container: HTMLElement, installedExtensions: Promise) { - installedExtensions.then(extensions => { - const elements = container.querySelectorAll('.installExtension, .enabledExtension'); - for (let i = 0; i < elements.length; i++) { - elements[i].classList.remove('installed'); - } - extensions.filter(ext => ext.globallyEnabled) - .map(ext => ext.identifier.id) - .forEach(id => { - const install = container.querySelectorAll(`.installExtension[data-extension="${id}"]`); - for (let i = 0; i < install.length; i++) { - install[i].classList.add('installed'); - } - const enabled = container.querySelectorAll(`.enabledExtension[data-extension="${id}"]`); - for (let i = 0; i < enabled.length; i++) { - enabled[i].classList.add('installed'); - } - }); - }).then(undefined, onUnexpectedError); - } -} - -export class WelcomeInputFactory implements IEditorInputFactory { - - static readonly ID = welcomeInputTypeId; - - public canSerialize(editorInput: EditorInput): boolean { - return true; - } - - public serialize(editorInput: EditorInput): string { - return '{}'; - } - - public deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): WalkThroughInput { - return instantiationService.createInstance(WelcomePage) - .editorInput; - } -} - -// theming - -registerThemingParticipant((theme, collector) => { - const backgroundColor = theme.getColor(welcomePageBackground); - if (backgroundColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePageContainer { background-color: ${backgroundColor}; }`); - } - const foregroundColor = theme.getColor(foreground); - if (foregroundColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .caption { color: ${foregroundColor}; }`); - } - const descriptionColor = theme.getColor(descriptionForeground); - if (descriptionColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .detail { color: ${descriptionColor}; }`); - } - const buttonColor = getExtraColor(theme, welcomeButtonBackground, { dark: 'rgba(0, 0, 0, .2)', extra_dark: 'rgba(200, 235, 255, .042)', light: 'rgba(0,0,0,.04)', hc: 'black' }); - if (buttonColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button { background: ${buttonColor}; }`); - } - const buttonHoverColor = getExtraColor(theme, welcomeButtonHoverBackground, { dark: 'rgba(200, 235, 255, .072)', extra_dark: 'rgba(200, 235, 255, .072)', light: 'rgba(0,0,0,.10)', hc: null }); - if (buttonHoverColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button:hover { background: ${buttonHoverColor}; }`); - } - const link = theme.getColor(textLinkForeground); - if (link) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage a { color: ${link}; }`); - } - const activeLink = theme.getColor(textLinkActiveForeground); - if (activeLink) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage a:hover, - .monaco-workbench .part.editor > .content .welcomePage a:active { color: ${activeLink}; }`); - } - const focusColor = theme.getColor(focusBorder); - if (focusColor) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage a:focus { outline-color: ${focusColor}; }`); - } - const border = theme.getColor(contrastBorder); - if (border) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button { border-color: ${border}; }`); - } - const activeBorder = theme.getColor(activeContrastBorder); - if (activeBorder) { - collector.addRule(`.monaco-workbench .part.editor > .content .welcomePage .commands .item button:hover { outline-color: ${activeBorder}; }`); - } -}); diff --git a/vscode-web-github1s/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts b/vscode-web-github1s/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts deleted file mode 100644 index 4e05f9355..000000000 --- a/vscode-web-github1s/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts +++ /dev/null @@ -1,76 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -(function () { - - const MonacoEnvironment = (self).MonacoEnvironment; - const monacoBaseUrl = MonacoEnvironment && MonacoEnvironment.baseUrl ? MonacoEnvironment.baseUrl : '../../../../../'; - - const trustedTypesPolicy = ( - typeof self.trustedTypes?.createPolicy === 'function' - ? self.trustedTypes?.createPolicy('amdLoader', { - createScriptURL: value => value, - createScript: (_, ...args: string[]) => { - // workaround a chrome issue not allowing to create new functions - // see https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor - const fnArgs = args.slice(0, -1).join(','); - const fnBody = args.pop()!.toString(); - const body = `(function anonymous(${fnArgs}) {\n${fnBody}\n})`; - return body; - } - }) - : undefined - ); - - function loadAMDLoader() { - return new Promise((resolve, reject) => { - if (typeof (self).define === 'function' && (self).define.amd) { - return resolve(); - } - const loaderSrc: string | TrustedScriptURL = monacoBaseUrl + 'vs/loader.js'; - - const isCrossOrigin = (/^((http:)|(https:)|(file:))/.test(loaderSrc) && loaderSrc.substring(0, self.origin.length) !== self.origin); - if (!isCrossOrigin) { - // use `fetch` if possible because `importScripts` - // is synchronous and can lead to deadlocks on Safari - fetch(loaderSrc).then((response) => { - if (response.status !== 200) { - throw new Error(response.statusText); - } - return response.text(); - }).then((text) => { - text = `${text}\n//# sourceURL=${loaderSrc}`; - const func = ( - trustedTypesPolicy - // below codes are changed by github1s - // fix error in webworker for old browsers - ? self.eval(trustedTypesPolicy.createScript('', text).toString()) - // above codes are changed by github1s - : new Function(text) - ); - func.call(self); - resolve(); - }).then(undefined, reject); - return; - } - - if (trustedTypesPolicy) { - importScripts(trustedTypesPolicy.createScriptURL(loaderSrc) as unknown as string); - } else { - importScripts(loaderSrc as string); - } - resolve(); - }); - } - - loadAMDLoader().then(() => { - require.config({ - baseUrl: monacoBaseUrl, - catchError: true, - trustedTypesPolicy - }); - require(['vs/workbench/services/extensions/worker/extensionHostWorker'], () => { }, err => console.error(err)); - }).then(undefined, (err) => console.error(err)); -})(); diff --git a/vscode-web-github1s/src/vs/workbench/services/themes/browser/workbenchThemeService.ts b/vscode-web-github1s/src/vs/workbench/services/themes/browser/workbenchThemeService.ts index 531e55ebf..e3e301863 100644 --- a/vscode-web-github1s/src/vs/workbench/services/themes/browser/workbenchThemeService.ts +++ b/vscode-web-github1s/src/vs/workbench/services/themes/browser/workbenchThemeService.ts @@ -34,7 +34,6 @@ import { ProductIconThemeData, DEFAULT_PRODUCT_ICON_THEME_ID } from 'vs/workbenc import { registerProductIconThemeSchemas } from 'vs/workbench/services/themes/common/productIconThemeSchema'; import { ILogService } from 'vs/platform/log/common/log'; // below codes are changed by github1s -// change the default workbench theme to dark // import { isWeb } from 'vs/base/common/platform'; // above codes are changed by github1s import { ColorScheme } from 'vs/platform/theme/common/theme'; @@ -277,8 +276,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.currentColorTheme.setCustomTokenColors(this.settings.tokenColorCustomizations); hasColorChanges = true; } - if (e.affectsConfiguration(ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS) || e.affectsConfiguration(ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL)) { - this.currentColorTheme.setCustomSemanticTokenColors(this.settings.semanticTokenColorCustomizations, this.settings.experimentalSemanticTokenColorCustomizations); + if (e.affectsConfiguration(ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS)) { + this.currentColorTheme.setCustomSemanticTokenColors(this.settings.semanticTokenColorCustomizations); hasColorChanges = true; } if (hasColorChanges) { @@ -386,10 +385,10 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { } private getPreferredColorScheme(): ColorScheme | undefined { - if (this.configurationService.getValue(ThemeSettings.DETECT_HC) && this.hostColorService.highContrast) { + if (this.configurationService.getValue(ThemeSettings.DETECT_HC) && this.hostColorService.highContrast) { return ColorScheme.HIGH_CONTRAST; } - if (this.configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) { + if (this.configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) { return this.hostColorService.dark ? ColorScheme.DARK : ColorScheme.LIGHT; } return undefined; @@ -397,8 +396,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { private async applyPreferredColorTheme(type: ColorScheme): Promise { const settingId = type === ColorScheme.DARK ? ThemeSettings.PREFERRED_DARK_THEME : type === ColorScheme.LIGHT ? ThemeSettings.PREFERRED_LIGHT_THEME : ThemeSettings.PREFERRED_HC_THEME; - const themeSettingId = this.configurationService.getValue(settingId); - if (themeSettingId) { + const themeSettingId = this.configurationService.getValue(settingId); + if (themeSettingId && typeof themeSettingId === 'string') { const theme = this.colorThemeRegistry.findThemeBySettingsId(themeSettingId, undefined); if (theme) { const configurationTarget = this.settings.findAutoConfigurationTarget(settingId); @@ -426,6 +425,9 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { return Promise.resolve(null); } if (themeId === this.currentColorTheme.id && this.currentColorTheme.isLoaded) { + if (settingsTarget !== 'preview') { + this.currentColorTheme.toStorage(this.storageService); + } return this.settings.setColorTheme(this.currentColorTheme, settingsTarget); } @@ -509,7 +511,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.onColorThemeChange.fire(this.currentColorTheme); // remember theme data for a quick restore - if (newTheme.isLoaded) { + if (newTheme.isLoaded && settingsTarget !== 'preview') { newTheme.toStorage(this.storageService); } @@ -564,23 +566,23 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { public async setFileIconTheme(iconTheme: string | undefined, settingsTarget: ThemeSettingTarget): Promise { return this.fileIconThemeSequencer.queue(async () => { iconTheme = iconTheme || ''; - if (iconTheme === this.currentFileIconTheme.id && this.currentFileIconTheme.isLoaded) { - await this.settings.setFileIconTheme(this.currentFileIconTheme, settingsTarget); - return this.currentFileIconTheme; - } + if (iconTheme !== this.currentFileIconTheme.id || !this.currentFileIconTheme.isLoaded) { - const newThemeData = this.fileIconThemeRegistry.findThemeById(iconTheme) || FileIconThemeData.noIconTheme; - await newThemeData.ensureLoaded(this.fileService); + const newThemeData = this.fileIconThemeRegistry.findThemeById(iconTheme) || FileIconThemeData.noIconTheme; + await newThemeData.ensureLoaded(this.fileService); + + this.applyAndSetFileIconTheme(newThemeData); // updates this.currentFileIconTheme + } - this.applyAndSetFileIconTheme(newThemeData); + const themeData = this.currentFileIconTheme; // remember theme data for a quick restore - if (newThemeData.isLoaded && (!newThemeData.location || !getRemoteAuthority(newThemeData.location))) { - newThemeData.toStorage(this.storageService); + if (themeData.isLoaded && settingsTarget !== 'preview' && (!themeData.location || !getRemoteAuthority(themeData.location))) { + themeData.toStorage(this.storageService); } await this.settings.setFileIconTheme(this.currentFileIconTheme, settingsTarget); - return newThemeData; + return themeData; }); } @@ -640,23 +642,21 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { public async setProductIconTheme(iconTheme: string | undefined, settingsTarget: ThemeSettingTarget): Promise { return this.productIconThemeSequencer.queue(async () => { iconTheme = iconTheme || ''; - if (iconTheme === this.currentProductIconTheme.id && this.currentProductIconTheme.isLoaded) { - await this.settings.setProductIconTheme(this.currentProductIconTheme, settingsTarget); - return this.currentProductIconTheme; - } - - const newThemeData = this.productIconThemeRegistry.findThemeById(iconTheme) || ProductIconThemeData.defaultTheme; - await newThemeData.ensureLoaded(this.fileService, this.logService); + if (iconTheme !== this.currentProductIconTheme.id || !this.currentProductIconTheme.isLoaded) { + const newThemeData = this.productIconThemeRegistry.findThemeById(iconTheme) || ProductIconThemeData.defaultTheme; + await newThemeData.ensureLoaded(this.fileService, this.logService); - this.applyAndSetProductIconTheme(newThemeData); + this.applyAndSetProductIconTheme(newThemeData); // updates this.currentProductIconTheme + } + const themeData = this.currentProductIconTheme; // remember theme data for a quick restore - if (newThemeData.isLoaded && (!newThemeData.location || !getRemoteAuthority(newThemeData.location))) { - newThemeData.toStorage(this.storageService); + if (themeData.isLoaded && settingsTarget !== 'preview' && (!themeData.location || !getRemoteAuthority(themeData.location))) { + themeData.toStorage(this.storageService); } await this.settings.setProductIconTheme(this.currentProductIconTheme, settingsTarget); - return newThemeData; + return themeData; }); } @@ -698,19 +698,17 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { class ThemeFileWatcher { - private inExtensionDevelopment: boolean; private watchedLocation: URI | undefined; private watcherDisposable: IDisposable | undefined; private fileChangeListener: IDisposable | undefined; - constructor(private fileService: IFileService, environmentService: IWorkbenchEnvironmentService, private onUpdate: () => void) { - this.inExtensionDevelopment = !!environmentService.extensionDevelopmentLocationURI; + constructor(private fileService: IFileService, private environmentService: IWorkbenchEnvironmentService, private onUpdate: () => void) { } update(theme: { location?: URI, watch?: boolean; }) { if (!resources.isEqual(theme.location, this.watchedLocation)) { this.dispose(); - if (theme.location && (theme.watch || this.inExtensionDevelopment)) { + if (theme.location && (theme.watch || this.environmentService.isExtensionDevelopment)) { this.watchedLocation = theme.location; this.watcherDisposable = this.fileService.watch(theme.location); this.fileService.onDidFilesChange(e => { diff --git a/vscode-web-github1s/src/vs/workbench/services/themes/common/themeConfiguration.ts b/vscode-web-github1s/src/vs/workbench/services/themes/common/themeConfiguration.ts index b309d5041..3eb332e78 100644 --- a/vscode-web-github1s/src/vs/workbench/services/themes/common/themeConfiguration.ts +++ b/vscode-web-github1s/src/vs/workbench/services/themes/common/themeConfiguration.ts @@ -12,10 +12,9 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { textmateColorsSchemaId, textmateColorGroupSchemaId } from 'vs/workbench/services/themes/common/colorThemeSchema'; import { workbenchColorsSchemaId } from 'vs/platform/theme/common/colorRegistry'; import { tokenStylingSchemaId } from 'vs/platform/theme/common/tokenClassificationRegistry'; -import { ThemeSettings, IWorkbenchColorTheme, IWorkbenchFileIconTheme, IColorCustomizations, ITokenColorCustomizations, IWorkbenchProductIconTheme, ISemanticTokenColorCustomizations, IExperimentalSemanticTokenColorCustomizations, ThemeSettingTarget } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { ThemeSettings, IWorkbenchColorTheme, IWorkbenchFileIconTheme, IColorCustomizations, ITokenColorCustomizations, IWorkbenchProductIconTheme, ISemanticTokenColorCustomizations, ThemeSettingTarget } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; // below codes are changed by github1s -// set dark theme by default import { isMacintosh, isWindows } from 'vs/base/common/platform'; // above codes are changed by github1s @@ -76,7 +75,7 @@ const preferredHCThemeSettingSchema: IConfigurationPropertySchema = { }; const detectColorSchemeSettingSchema: IConfigurationPropertySchema = { type: 'boolean', - description: nls.localize('detectColorScheme', 'If set, automatically switch to the preferred color theme based on the OS appearance.'), + markdownDescription: nls.localize('detectColorScheme', 'If set, automatically switch to the preferred color theme based on the OS appearance. If the OS appearance is dark, the theme specified at `#{0}#` is used, for light `#{1}#`.', ThemeSettings.PREFERRED_DARK_THEME, ThemeSettings.PREFERRED_LIGHT_THEME), default: false }; @@ -112,7 +111,7 @@ const productIconThemeSettingSchema: IConfigurationPropertySchema = { const detectHCSchemeSettingSchema: IConfigurationPropertySchema = { type: 'boolean', default: true, - description: nls.localize('autoDetectHighContrast', "If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme."), + markdownDescription: nls.localize('autoDetectHighContrast', "If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by `#{0}#`", ThemeSettings.PREFERRED_HC_THEME), scope: ConfigurationScope.APPLICATION }; @@ -150,7 +149,10 @@ function tokenGroupSettings(description: string): IJSONSchema { }; } +const themeSpecificSettingKey = '^\\[[^\\]]*(\\]\\s*\\[[^\\]]*)*\\]$'; + const tokenColorSchema: IJSONSchema = { + type: 'object', properties: { comments: tokenGroupSettings(nls.localize('editorColors.comments', "Sets the colors and styles for comments")), strings: tokenGroupSettings(nls.localize('editorColors.strings', "Sets the colors and styles for strings literals.")), @@ -169,13 +171,14 @@ const tokenColorSchema: IJSONSchema = { markdownDeprecationMessage: nls.localize('editorColors.semanticHighlighting.deprecationMessageMarkdown', 'Use `enabled` in `#editor.semanticTokenColorCustomizations#` setting instead.'), type: 'boolean' } - } + }, + additionalProperties: false }; const tokenColorCustomizationSchema: IConfigurationPropertySchema = { description: nls.localize('editorColors', "Overrides editor syntax colors and font style from the currently selected color theme."), default: {}, - allOf: [tokenColorSchema] + allOf: [{ ...tokenColorSchema, patternProperties: { '^\\[': {} } }] }; const semanticTokenColorSchema: IJSONSchema = { @@ -201,20 +204,13 @@ const semanticTokenColorCustomizationSchema: IConfigurationPropertySchema = { allOf: [{ ...semanticTokenColorSchema, patternProperties: { '^\\[': {} } }] }; -const experimentalTokenStylingCustomizationSchema: IConfigurationPropertySchema = { - deprecationMessage: nls.localize('editorColors.experimentalTokenStyling.deprecationMessage', 'Use `editor.semanticTokenColorCustomizations` instead.'), - markdownDeprecationMessage: nls.localize('editorColors.experimentalTokenStyling.deprecationMessageMarkdown', 'Use `#editor.semanticTokenColorCustomizations#` instead.'), - default: {}, - allOf: [{ $ref: tokenStylingSchemaId }], -}; const tokenColorCustomizationConfiguration: IConfigurationNode = { id: 'editor', order: 7.2, type: 'object', properties: { [ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS]: tokenColorCustomizationSchema, - [ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS]: semanticTokenColorCustomizationSchema, - [ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL]: experimentalTokenStylingCustomizationSchema + [ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS]: semanticTokenColorCustomizationSchema } }; @@ -229,7 +225,6 @@ export function updateColorThemeConfigurationSchemas(themes: IWorkbenchColorThem const themeSpecificWorkbenchColors: IJSONSchema = { properties: {} }; const themeSpecificTokenColors: IJSONSchema = { properties: {} }; const themeSpecificSemanticTokenColors: IJSONSchema = { properties: {} }; - const experimentalThemeSpecificSemanticTokenColors: IJSONSchema = { properties: {} }; const workbenchColors = { $ref: workbenchColorsSchemaId, additionalProperties: false }; const tokenColors = { properties: tokenColorSchema.properties, additionalProperties: false }; @@ -239,13 +234,14 @@ export function updateColorThemeConfigurationSchemas(themes: IWorkbenchColorThem themeSpecificWorkbenchColors.properties![themeId] = workbenchColors; themeSpecificTokenColors.properties![themeId] = tokenColors; themeSpecificSemanticTokenColors.properties![themeId] = semanticTokenColorSchema; - experimentalThemeSpecificSemanticTokenColors.properties![themeId] = { $ref: tokenStylingSchemaId, additionalProperties: false }; } + themeSpecificWorkbenchColors.patternProperties = { [themeSpecificSettingKey]: workbenchColors }; + themeSpecificTokenColors.patternProperties = { [themeSpecificSettingKey]: tokenColors }; + themeSpecificSemanticTokenColors.patternProperties = { [themeSpecificSettingKey]: semanticTokenColorSchema }; colorCustomizationsSchema.allOf![1] = themeSpecificWorkbenchColors; tokenColorCustomizationSchema.allOf![1] = themeSpecificTokenColors; semanticTokenColorCustomizationSchema.allOf![1] = themeSpecificSemanticTokenColors; - experimentalTokenStylingCustomizationSchema.allOf![1] = experimentalThemeSpecificSemanticTokenColors; configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration, tokenColorCustomizationConfiguration); } @@ -295,10 +291,6 @@ export class ThemeConfiguration { return this.configurationService.getValue(ThemeSettings.SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS); } - public get experimentalSemanticTokenColorCustomizations(): IExperimentalSemanticTokenColorCustomizations | undefined { - return this.configurationService.getValue(ThemeSettings.TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL); - } - public async setColorTheme(theme: IWorkbenchColorTheme, settingsTarget: ThemeSettingTarget): Promise { await this.writeConfiguration(ThemeSettings.COLOR_THEME, theme.settingsId, settingsTarget); return theme; @@ -332,7 +324,7 @@ export class ThemeConfiguration { } private async writeConfiguration(key: string, value: any, settingsTarget: ThemeSettingTarget): Promise { - if (settingsTarget === undefined) { + if (settingsTarget === undefined || settingsTarget === 'preview') { return; } diff --git a/vscode-web-github1s/yarn.lock b/vscode-web-github1s/yarn.lock index 544f34013..baad22c57 100644 --- a/vscode-web-github1s/yarn.lock +++ b/vscode-web-github1s/yarn.lock @@ -338,9 +338,9 @@ path-key@^2.0.1: integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-type@^3.0.0: version "3.0.0" diff --git a/yarn.lock b/yarn.lock index bae94c9ba..b050b909d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,10 +39,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@github1s/vscode-web@0.1.10": - version "0.1.10" - resolved "https://registry.yarnpkg.com/@github1s/vscode-web/-/vscode-web-0.1.10.tgz#65237bd929aa4426cbf10b28239444170b53cd03" - integrity sha512-q8xTuE1MlKyUsBtQG6+mpQKVF4cohKCbqvHoqiIDalCP+XFdeBTWvTMnHnn+x/36a+Ae+1dzMqQGxo1/kq9qOA== +"@github1s/vscode-web@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@github1s/vscode-web/-/vscode-web-0.2.1.tgz#513aa78f8f933e1c92e9d66203115cdacbb572ab" + integrity sha512-+TPlM0CNagT2mHCAaMXR/hVWB9pHxSZnEy+LsEMV4ZYWaVzfiCjqSc8SvDsabrLUWMSPfAeXRzo2Y1fodr5/kA== dependencies: iconv-lite-umd "0.6.8" jschardet "2.2.1" @@ -1582,9 +1582,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-to-regexp@2.2.1: version "2.2.1"