From 26332bfd71f10c5731e62366ed2a2145ca4c0e5f Mon Sep 17 00:00:00 2001 From: Christian Corrales Date: Fri, 21 Oct 2022 03:38:16 -0300 Subject: [PATCH 1/3] chore: upgrade eslint and prettier dependencies (#454) --- package.json | 14 +-- yarn.lock | 269 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 172 insertions(+), 111 deletions(-) diff --git a/package.json b/package.json index c527e8b01..a79037156 100644 --- a/package.json +++ b/package.json @@ -8,22 +8,22 @@ }, "devDependencies": { "@github1s/vscode-web": "0.5.0", - "@typescript-eslint/eslint-plugin": "^5.28.0", - "@typescript-eslint/parser": "^5.28.0", + "@typescript-eslint/eslint-plugin": "^5.40.1", + "@typescript-eslint/parser": "^5.40.1", "chokidar": "^3.5.3", "copy-webpack-plugin": "^11.0.0", - "eslint": "^8.17.0", + "eslint": "^8.25.0", "eslint-config-prettier": "^8.5.0", - "eslint-plugin-jsdoc": "^39.3.2", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-jsdoc": "^39.3.14", + "eslint-plugin-prettier": "^4.2.1", "fs-extra": "^10.1.0", "generate-file-webpack-plugin": "^1.0.1", "html-webpack-plugin": "^5.5.0", "http-proxy": "^1.18.1", "husky": "^8.0.1", - "lint-staged": "^13.0.1", + "lint-staged": "^13.0.3", "npm-run-all": "^4.1.5", - "prettier": "^2.7.0", + "prettier": "^2.7.1", "serve-handler": "^6.1.3", "start-server-and-test": "^1.14.0", "typescript": "^4.7.3", diff --git a/yarn.lock b/yarn.lock index a92eff744..1ca74096a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,23 +7,23 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== -"@es-joy/jsdoccomment@~0.31.0": - version "0.31.0" - resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.31.0.tgz#dbc342cc38eb6878c12727985e693eaef34302bc" - integrity sha512-tc1/iuQcnaiSIUVad72PBierDFpsxdUHtEF/OrfqvM1CBAsIoMP51j52jTMb3dXriwhieTo289InzZj72jL3EQ== +"@es-joy/jsdoccomment@~0.33.0": + version "0.33.0" + resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.33.0.tgz#59416d08442d0fdbb316fc1cb491e750db80b9ad" + integrity sha512-bkxMGTlHPE4vfarXt1L1fOm81O18jTRFNgh3Fm4iPKctfWxcpJw4cpth5BhLkGZy4HFzGn/KfD/zGks/J+ZIIw== dependencies: comment-parser "1.3.1" esquery "^1.4.0" jsdoc-type-pratt-parser "~3.1.0" -"@eslint/eslintrc@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" - integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== +"@eslint/eslintrc@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" + integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.2" + espree "^9.4.0" globals "^13.15.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -59,15 +59,20 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@humanwhocodes/config-array@^0.9.2": - version "0.9.5" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" - integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== +"@humanwhocodes/config-array@^0.10.5": + version "0.10.7" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" + integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" @@ -276,6 +281,11 @@ resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== +"@types/semver@^7.3.12": + version "7.3.12" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.12.tgz#920447fdd78d76b19de0438b7f60df3c4a80bf1c" + integrity sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A== + "@types/serve-index@^1.9.1": version "1.9.1" resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278" @@ -305,84 +315,86 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.28.0.tgz#6204ac33bdd05ab27c7f77960f1023951115d403" - integrity sha512-DXVU6Cg29H2M6EybqSg2A+x8DgO9TCUBRp4QEXQHJceLS7ogVDP0g3Lkg/SZCqcvkAP/RruuQqK0gdlkgmhSUA== +"@typescript-eslint/eslint-plugin@^5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.40.1.tgz#3203a6ff396b1194083faaa6e5110c401201d7d5" + integrity sha512-FsWboKkWdytGiXT5O1/R9j37YgcjO8MKHSUmWnIEjVaz0krHkplPnYi7mwdb+5+cs0toFNQb0HIrN7zONdIEWg== dependencies: - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/type-utils" "5.28.0" - "@typescript-eslint/utils" "5.28.0" + "@typescript-eslint/scope-manager" "5.40.1" + "@typescript-eslint/type-utils" "5.40.1" + "@typescript-eslint/utils" "5.40.1" debug "^4.3.4" - functional-red-black-tree "^1.0.1" ignore "^5.2.0" regexpp "^3.2.0" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.28.0.tgz#639b101cad2bfb7ae16e69710ac95c42bd4eae33" - integrity sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA== +"@typescript-eslint/parser@^5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.40.1.tgz#e7f8295dd8154d0d37d661ddd8e2f0ecfdee28dd" + integrity sha512-IK6x55va5w4YvXd4b3VrXQPldV9vQTxi5ov+g4pMANsXPTXOcfjx08CRR1Dfrcc51syPtXHF5bgLlMHYFrvQtg== dependencies: - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/typescript-estree" "5.28.0" + "@typescript-eslint/scope-manager" "5.40.1" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/typescript-estree" "5.40.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz#ef9a5c68fecde72fd2ff8a84b9c120324826c1b9" - integrity sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w== +"@typescript-eslint/scope-manager@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.40.1.tgz#a7a5197dfd234622a2421ea590ee0ccc02e18dfe" + integrity sha512-jkn4xsJiUQucI16OLCXrLRXDZ3afKhOIqXs4R3O+M00hdQLKR58WuyXPZZjhKLFCEP2g+TXdBRtLQ33UfAdRUg== dependencies: - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/visitor-keys" "5.28.0" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/visitor-keys" "5.40.1" -"@typescript-eslint/type-utils@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.28.0.tgz#53ccc78fdcf0205ef544d843b84104c0e9c7ca8e" - integrity sha512-SyKjKh4CXPglueyC6ceAFytjYWMoPHMswPQae236zqe1YbhvCVQyIawesYywGiu98L9DwrxsBN69vGIVxJ4mQQ== +"@typescript-eslint/type-utils@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.40.1.tgz#091e4ce3bebbdb68f4980bae9dee2e4e1725f601" + integrity sha512-DLAs+AHQOe6n5LRraXiv27IYPhleF0ldEmx6yBqBgBLaNRKTkffhV1RPsjoJBhVup2zHxfaRtan8/YRBgYhU9Q== dependencies: - "@typescript-eslint/utils" "5.28.0" + "@typescript-eslint/typescript-estree" "5.40.1" + "@typescript-eslint/utils" "5.40.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.28.0.tgz#cffd9bcdce28db6daaa146e48a0be4387a6f4e9d" - integrity sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA== +"@typescript-eslint/types@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.40.1.tgz#de37f4f64de731ee454bb2085d71030aa832f749" + integrity sha512-Icg9kiuVJSwdzSQvtdGspOlWNjVDnF3qVIKXdJ103o36yRprdl3Ge5cABQx+csx960nuMF21v8qvO31v9t3OHw== -"@typescript-eslint/typescript-estree@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz#3487d158d091ca2772b285e67412ff6d9797d863" - integrity sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA== +"@typescript-eslint/typescript-estree@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.40.1.tgz#9a7d25492f02c69882ce5e0cd1857b0c55645d72" + integrity sha512-5QTP/nW5+60jBcEPfXy/EZL01qrl9GZtbgDZtDPlfW5zj/zjNrdI2B5zMUHmOsfvOr2cWqwVdWjobCiHcedmQA== dependencies: - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/visitor-keys" "5.28.0" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/visitor-keys" "5.40.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.28.0.tgz#b27a136eac300a48160b36d2aad0da44a1341b99" - integrity sha512-E60N5L0fjv7iPJV3UGc4EC+A3Lcj4jle9zzR0gW7vXhflO7/J29kwiTGITA2RlrmPokKiZbBy2DgaclCaEUs6g== +"@typescript-eslint/utils@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.40.1.tgz#3204fb73a559d3b7bab7dc9d3c44487c2734a9ca" + integrity sha512-a2TAVScoX9fjryNrW6BZRnreDUszxqm9eQ9Esv8n5nXApMW0zeANUYlwh/DED04SC/ifuBvXgZpIK5xeJHQ3aw== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.28.0" - "@typescript-eslint/types" "5.28.0" - "@typescript-eslint/typescript-estree" "5.28.0" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.40.1" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/typescript-estree" "5.40.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" + semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.28.0": - version "5.28.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f" - integrity sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA== +"@typescript-eslint/visitor-keys@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.40.1.tgz#f3d2bf5af192f4432b84cec6fdcb387193518754" + integrity sha512-A2DGmeZ+FMja0geX5rww+DpvILpwo1OsiQs0M+joPWJYsiEFBLsH0y1oFymPNul6Z5okSmHpP4ivkc2N0Cgfkw== dependencies: - "@typescript-eslint/types" "5.28.0" + "@typescript-eslint/types" "5.40.1" eslint-visitor-keys "^3.3.0" "@vscode/iconv-lite-umd@0.7.0": @@ -561,11 +573,16 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: +acorn@^8.4.1, acorn@^8.5.0: version "8.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -1343,23 +1360,23 @@ eslint-config-prettier@^8.5.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== -eslint-plugin-jsdoc@^39.3.2: - version "39.3.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.3.2.tgz#b9c3becdbd860a75b8bd07bd04a0eaaad7c79403" - integrity sha512-RSGN94RYzIJS/WfW3l6cXzRLfJWxvJgNQZ4w0WCaxJWDJMigtwTsILEAfKqmmPkT2rwMH/s3C7G5ChDE6cwPJg== +eslint-plugin-jsdoc@^39.3.14: + version "39.3.14" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.3.14.tgz#2591bf48907a7527a6e689fd721634364d08fe4e" + integrity sha512-kle7ot5xvzXwWzg7ElzTPM/y1IWUo0kfa5X+ZwOC/7Jw81OJaqIaNEk+2ZH+HcKkbwRUQ3RTdK9qsm4p5vbXAQ== dependencies: - "@es-joy/jsdoccomment" "~0.31.0" + "@es-joy/jsdoccomment" "~0.33.0" comment-parser "1.3.1" debug "^4.3.4" escape-string-regexp "^4.0.0" esquery "^1.4.0" - semver "^7.3.7" + semver "^7.3.8" spdx-expression-parse "^3.0.1" -eslint-plugin-prettier@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" - integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== +eslint-plugin-prettier@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -1396,13 +1413,14 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.17.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.17.0.tgz#1cfc4b6b6912f77d24b874ca1506b0fe09328c21" - integrity sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw== +eslint@^8.25.0: + version "8.25.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b" + integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A== dependencies: - "@eslint/eslintrc" "^1.3.0" - "@humanwhocodes/config-array" "^0.9.2" + "@eslint/eslintrc" "^1.3.3" + "@humanwhocodes/config-array" "^0.10.5" + "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1412,18 +1430,21 @@ eslint@^8.17.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.2" + espree "^9.4.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" + find-up "^5.0.0" glob-parent "^6.0.1" globals "^13.15.0" + globby "^11.1.0" + grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -1435,14 +1456,13 @@ eslint@^8.17.0: strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^9.3.2: - version "9.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" - integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== dependencies: - acorn "^8.7.1" + acorn "^8.8.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" @@ -1662,6 +1682,14 @@ find-up@^4.0.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -1743,11 +1771,6 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -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 sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - functions-have-names@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" @@ -1851,6 +1874,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + handle-thing@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" @@ -2304,6 +2332,11 @@ joi@^17.4.0: "@sideway/formula" "^3.0.0" "@sideway/pinpoint" "^2.0.0" +js-sdsl@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== + js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -2385,10 +2418,10 @@ lilconfig@2.0.5: resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.5.tgz#19e57fd06ccc3848fd1891655b5a447092225b25" integrity sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg== -lint-staged@^13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.0.1.tgz#899e78065ab29b88fdd922482411121664ef66be" - integrity sha512-Ykaf4QTi0a02BF7cnq7JIPGOJxH4TkNMWhSlJdH9wOekd0X+gog47Jfh/0L31DqZe5AiydLGC7LkPqpaNm+Kvg== +lint-staged@^13.0.3: + version "13.0.3" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.0.3.tgz#d7cdf03a3830b327a2b63c6aec953d71d9dc48c6" + integrity sha512-9hmrwSCFroTSYLjflGI8Uk+GWAwMB4OlpU4bMJEAT5d/llQwtYKoim4bLOyLCuWFAhWEupE0vkIFqtw/WIsPug== dependencies: cli-truncate "^3.1.0" colorette "^2.0.17" @@ -2440,6 +2473,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -2807,6 +2847,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + 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" @@ -2814,6 +2861,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -2978,10 +3032,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.0.tgz#a4fdae07e5596c51c9857ea676cd41a0163879d6" - integrity sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ== +prettier@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== pretty-error@^4.0.0: version "4.0.0" @@ -3278,6 +3332,13 @@ semver@^7.3.7: dependencies: lru-cache "^6.0.0" +semver@^7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -3826,11 +3887,6 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -4130,3 +4186,8 @@ yargs@^16.1.1: string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" + +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== From 0b54791a411558670abaa71219cc2d1fd957f114 Mon Sep 17 00:00:00 2001 From: netcon Date: Sun, 6 Nov 2022 15:28:23 +0800 Subject: [PATCH 2/3] upgrade vscode to 1.72.1 (#457) * feat: upgrade vscode to 1.72.1 * feat: open editor command --- extensions/github1s/package.json | 13 +- extensions/github1s/src/adapters/index.ts | 9 + extensions/github1s/src/adapters/manager.ts | 5 +- extensions/github1s/src/adapters/types.ts | 2 +- extensions/github1s/src/commands/global.ts | 15 +- package.json | 2 +- resources/initialize.js | 192 +++++++----- vscode-web/.VERSION | 2 +- vscode-web/package.json | 9 +- vscode-web/src/vs/base/common/platform.ts | 287 ------------------ .../vs/code/browser/workbench/workbench.ts | 25 +- .../vs/editor/common/config/editorOptions.ts | 88 ++++-- .../parts/activitybar/activitybarActions.ts | 212 +++++++++---- .../parts/activitybar/activitybarPart.ts | 103 ++++++- .../parts/titlebar/media/titlebarpart.css | 72 ++--- .../src/vs/workbench/browser/web.main.ts | 36 ++- .../contrib/webview/browser/pre/index.html | 25 +- .../builtinExtensionsScannerService.ts | 11 +- .../services/label/common/labelService.ts | 5 +- .../textfile/browser/textFileService.ts | 15 +- vscode-web/yarn.lock | 43 +-- yarn.lock | 60 ++-- 22 files changed, 616 insertions(+), 615 deletions(-) delete mode 100644 vscode-web/src/vs/base/common/platform.ts diff --git a/extensions/github1s/package.json b/extensions/github1s/package.json index 2e99877e9..71bea39c4 100644 --- a/extensions/github1s/package.json +++ b/extensions/github1s/package.json @@ -6,7 +6,8 @@ "private": true, "enabledApiProposals": [ "fileSearchProvider", - "textSearchProvider" + "textSearchProvider", + "resolvers" ], "directories": { "lib": "lib" @@ -16,7 +17,10 @@ "onFileSystem:gitlab1s", "onFileSystem:bitbucket1s", "onFileSystem:npmjs1s", - "onFileSystem:ossinsight" + "onFileSystem:ossinsight", + "onCommand:remoteHub.openRepository", + "onCommand:github1s.commands.openRepository", + "onStartupFinished" ], "browser": "./dist/extension", "engines": { @@ -65,6 +69,11 @@ "title": "Open Repository...", "category": "GitHub1s" }, + { + "command": "github1s.commands.openOnlineEditor", + "title": "Open Online Editor...", + "category": "GitHub1s" + }, { "command": "github1s.commands.checkoutTo", "title": "Checkout to...", diff --git a/extensions/github1s/src/adapters/index.ts b/extensions/github1s/src/adapters/index.ts index 12d86fbbd..4a80be861 100644 --- a/extensions/github1s/src/adapters/index.ts +++ b/extensions/github1s/src/adapters/index.ts @@ -9,9 +9,18 @@ import { GitLab1sAdapter } from './gitlab1s'; import { BitbucketAdapter } from './bitbucket1s'; import { Npmjs1sAdapter } from './npmjs1s'; import { OSSInsightAdapter } from './ossinsight'; +import { DataSource, PlatformName, RouterParser } from './types'; + +const emptyAdapter = { + scheme: 'empty', + platformName: PlatformName.GitHub, + resolveDataSource: () => new DataSource(), + resolveRouterParser: () => new RouterParser(), +}; export const registerAdapters = async (): Promise => { await Promise.all([ + adapterManager.registerAdapter(emptyAdapter), adapterManager.registerAdapter(new GitHub1sAdapter()), adapterManager.registerAdapter(new GitLab1sAdapter()), adapterManager.registerAdapter(new BitbucketAdapter()), diff --git a/extensions/github1s/src/adapters/manager.ts b/extensions/github1s/src/adapters/manager.ts index c2fce06a3..5bb38c430 100644 --- a/extensions/github1s/src/adapters/manager.ts +++ b/extensions/github1s/src/adapters/manager.ts @@ -48,10 +48,7 @@ export class AdapterManager { } public getCurrentScheme(): string { - if (!vscode.workspace.workspaceFolders?.length) { - throw new Error(`Can not found active workspace`); - } - return vscode.workspace.workspaceFolders[0].uri.scheme; + return vscode.workspace.workspaceFolders?.[0]?.uri?.scheme || 'empty'; } public getCurrentAdapter(): Adapter { diff --git a/extensions/github1s/src/adapters/types.ts b/extensions/github1s/src/adapters/types.ts index b6629cf11..0756fc826 100644 --- a/extensions/github1s/src/adapters/types.ts +++ b/extensions/github1s/src/adapters/types.ts @@ -381,7 +381,7 @@ export class RouterParser { // convert giving path to the external link (using for jumping back to origin platform) buildExternalLink(path: string): Promisable { - return '/conwnet/github1s'; + return 'https://github.com/conwnet/github1s'; } } diff --git a/extensions/github1s/src/commands/global.ts b/extensions/github1s/src/commands/global.ts index ab3918562..6d370b0f3 100644 --- a/extensions/github1s/src/commands/global.ts +++ b/extensions/github1s/src/commands/global.ts @@ -69,14 +69,21 @@ export const commandOpenRepository = async () => { quickPick.onDidAccept(async () => { const choice = quickPick.activeItems[0]; const repository = choice === manualInputItem ? quickPick.value : choice.label; - const tagetLink = vscode.Uri.parse((await router.href()) || '').with({ + const targetLink = vscode.Uri.parse((await router.href()) || '').with({ path: await (await router.resolveParser()).buildTreePath(repository), }); - vscode.commands.executeCommand('vscode.open', tagetLink); + vscode.commands.executeCommand('vscode.open', targetLink); quickPick.hide(); }); }; +const commandOpenOnlineEditor = async () => { + const currentScheme = adapterManager.getCurrentScheme(); + const onlineEditorPath = ['github1s', 'ossinsight'].includes(currentScheme) ? '/editor' : '/'; + const targetLink = vscode.Uri.parse((await router.href()) || '').with({ path: onlineEditorPath }); + return vscode.commands.executeCommand('vscode.open', targetLink); +}; + export const registerGlobalCommands = (context: vscode.ExtensionContext) => { return context.subscriptions.push( vscode.commands.registerCommand('github1s.commands.openOnGitHub', commandOpenOnOfficialPage), @@ -85,6 +92,8 @@ export const registerGlobalCommands = (context: vscode.ExtensionContext) => { vscode.commands.registerCommand('github1s.commands.openOnNpm', commandOpenOnOfficialPage), vscode.commands.registerCommand('github1s.commands.openOnOfficialPage', commandOpenOnOfficialPage), vscode.commands.registerCommand('github1s.commands.openOnGitPod', commandOpenGitpod), - vscode.commands.registerCommand('github1s.commands.openRepository', commandOpenRepository) + vscode.commands.registerCommand('github1s.commands.openRepository', commandOpenRepository), + vscode.commands.registerCommand('github1s.commands.openOnlineEditor', commandOpenOnlineEditor), + vscode.commands.registerCommand('remoteHub.openRepository', commandOpenRepository) ); }; diff --git a/package.json b/package.json index a79037156..41d622a88 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lib": "lib" }, "devDependencies": { - "@github1s/vscode-web": "0.5.0", + "@github1s/vscode-web": "0.6.0", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", "chokidar": "^3.5.3", diff --git a/resources/initialize.js b/resources/initialize.js index 19c9be668..173b3d26b 100644 --- a/resources/initialize.js +++ b/resources/initialize.js @@ -15,40 +15,114 @@ }); } - // set workbench config - const hostname = window.location.hostname; - let scheme = 'github1s'; + // build workbench config + const createFolderWorkspace = (scheme) => ({ folderUri: { scheme, authority: '', path: '/' } }); + const openGitHub1sPage = () => window.open('https://github.com/conwnet/github1s', '_blank'); + const openOfficialPage = (origin) => { + const targetPath = window.location.pathname + window.location.search + window.location.hash; + return window.open(origin + targetPath, '_blank'); + }; + const createWindowIndicator = (label) => ({ + label: label || '$(remote)', + command: 'github1s.commands.openRepository', + }); + const createConfigurationDefaults = (disableSomeAnyCodeFeatures) => { + const configurationDefaults = { + 'workbench.colorTheme': 'Default Dark+', + 'telemetry.telemetryLevel': 'off', + 'workbench.startupEditor': 'readme', + }; + // disable some anycode features when we can use sourcegraph instead + if (disableSomeAnyCodeFeatures) { + configurationDefaults['anycode.language.features'] = { + completions: false, + definitions: false, + references: false, + highlights: true, + outline: true, + workspaceSymbols: true, + folding: false, + diagnostics: false, + }; + } + return configurationDefaults; + }; + let platformName = 'GitHub'; - let platformOrigin = 'https://github.com'; - let logoIcon = staticAssetsPrefix + '/config/github.svg'; + let platformConfig = {}; const pathParts = window.location.pathname.split('/').filter(Boolean); - let repository = pathParts.slice(0, 2).join('/') || 'conwnet/github1s'; - let workspaceLabel = ''; + if (window.location.hostname.match(/\.?gitlab1s\.com$/i)) { + const dashIndex = pathParts.indexOf('-'); + const repository = (dashIndex < 0 ? pathParts : pathParts.slice(0, dashIndex)).join('/'); - if (hostname.match(/\.?gitlab1s\.com$/i)) { - scheme = 'gitlab1s'; platformName = 'GitLab'; - platformOrigin = 'https://gitlab.com'; - logoIcon = staticAssetsPrefix + '/config/gitlab.svg'; - const dashIndex = pathParts.indexOf('-'); - repository = (dashIndex < 0 ? pathParts : pathParts.slice(0, dashIndex)).join('/') || 'gitlab-org/gitlab-docs'; - } else if (hostname.match(/\.?bitbucket1s\.org$/i)) { - scheme = 'bitbucket1s'; + platformConfig = { + hideTextFileLabelDecorations: !!repository, + windowIndicator: createWindowIndicator(repository), + configurationDefaults: createConfigurationDefaults(!!repository), + workspace: repository ? createFolderWorkspace('gitlab1s') : undefined, + workspaceId: repository ? 'gitlab1s:' + repository : '', + workspaceLabel: repository, + logo: { + title: 'Open on GitLab', + icon: staticAssetsPrefix + '/config/gitlab.svg', + onClick: () => (repository ? openOfficialPage('https://gitlab.com') : openGitHub1sPage()), + }, + }; + } else if (window.location.hostname.match(/\.?bitbucket1s\.org$/i)) { + const repository = pathParts.length >= 2 ? pathParts.slice(0, 2).join('/') : ''; + platformName = 'Bitbucket'; - platformOrigin = 'https://bitbucket.org'; - logoIcon = staticAssetsPrefix + '/config/bitbucket.svg'; - repository = pathParts >= 2 ? pathParts.slice(0, 2).join('/') : 'atlassian/clover'; - } else if (hostname.match(/\.?npmjs1s\.com$/i)) { - scheme = 'npmjs1s'; + platformConfig = { + hideTextFileLabelDecorations: !!repository, + windowIndicator: createWindowIndicator(repository), + configurationDefaults: createConfigurationDefaults(!!repository), + workspace: repository ? createFolderWorkspace('bitbucket1s') : undefined, + workspaceId: repository ? 'bitbucket1s:' + repository : '', + workspaceLabel: repository, + logo: { + title: 'Open on Bitbucket', + icon: staticAssetsPrefix + '/config/bitbucket.svg', + onClick: () => (repository ? openOfficialPage('https://bitbucket.org') : openGitHub1sPage()), + }, + }; + } else if (window.location.hostname.match(/\.?npmjs1s\.com$/i)) { + const trimmedParts = pathParts[0] === 'package' ? pathParts.slice(1) : pathParts; + const packageParts = trimmedParts.slice(0, trimmedParts[0] && trimmedParts[0][0] === '@' ? 2 : 1); + const repository = pathParts.length ? packageParts.join('/') || 'package' : ''; + platformName = 'npm'; - platformOrigin = 'https://npmjs.com'; - logoIcon = staticAssetsPrefix + '/config/npm.svg'; - const trimedParts = pathParts[0] === 'package' ? pathParts.slice(1) : pathParts; - const packageParts = trimedParts.slice(0, trimedParts[0] && trimedParts[0][0] === '@' ? 2 : 1); - repository = pathParts.length ? packageParts.join('/') || 'package' : 'lodash'; - } else if (!pathParts[0] || pathParts[0] === 'trending') { - scheme = 'ossinsight'; - workspaceLabel = 'GitHub Trending'; + platformConfig = { + hideTextFileLabelDecorations: !!repository, + windowIndicator: createWindowIndicator(repository), + configurationDefaults: createConfigurationDefaults(false), + workspace: repository ? createFolderWorkspace('npmjs1s') : undefined, + workspaceId: repository ? 'npmjs1s:' + repository : '', + workspaceLabel: repository, + logo: { + title: 'Open on npm', + icon: staticAssetsPrefix + '/config/npm.svg', + onClick: () => (repository ? openOfficialPage('https://npmjs.com') : openGitHub1sPage()), + }, + }; + } else { + const repository = pathParts.length >= 2 ? pathParts.slice(0, 2).join('/') : ''; + const isOnlineEditor = pathParts[0] === 'editor'; + + platformName = 'GitHub'; + platformConfig = { + hideTextFileLabelDecorations: !isOnlineEditor, + windowIndicator: createWindowIndicator(repository), + configurationDefaults: createConfigurationDefaults(!!repository), + workspace: !isOnlineEditor ? createFolderWorkspace(repository ? 'github1s' : 'ossinsight') : undefined, + workspaceId: !isOnlineEditor ? 'github1s:' + (repository || 'trending') : '', + workspaceLabel: repository || (isOnlineEditor ? '' : 'GitHub Trending'), + logo: { + title: 'Open on GitHub', + icon: staticAssetsPrefix + '/config/github.svg', + onClick: () => (repository ? openOfficialPage('https://github1s.com') : openGitHub1sPage()), + }, + }; } // set product.json @@ -186,71 +260,27 @@ }; /*** end notificaton block ***/ + const vscodeCommands = [ + { id: 'github1s.commands.vscode.getBrowserUrl', handler: () => window.location.href }, + { id: 'github1s.commands.vscode.replaceBrowserUrl', handler: (url) => window.history.replaceState(null, '', url) }, + { id: 'github1s.commands.vscode.pushBrowserUrl', handler: (url) => window.history.pushState(null, '', url) }, + { id: 'github1s.commands.vscode.connectToGitHub', handler: ConnectToGitHub }, + ]; + window.vscodeWeb = { - windowIndicator: { label: repository, command: 'github1s.commands.openRepository' }, additionalBuiltinExtensions: ['ms-vscode.anycode'], webviewEndpoint: staticAssetsPrefix + '/vscode/vs/workbench/contrib/webview/browser/pre', webWorkerExtensionHostIframeSrc: staticAssetsPrefix + '/vscode/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html', - commands: [ - { - id: 'github1s.commands.vscode.getBrowserUrl', - handler() { - return window.location.href; - }, - }, - { - id: 'github1s.commands.vscode.replaceBrowserUrl', - handler(url) { - window.history.replaceState(null, '', url); - }, - }, - { - id: 'github1s.commands.vscode.pushBrowserUrl', - handler(url) { - window.history.pushState(null, '', url); - }, - }, - { - id: 'github1s.commands.vscode.connectToGitHub', - handler: ConnectToGitHub, - }, - ], + commands: vscodeCommands, productConfiguration: productConfiguration, initialColorTheme: { themeType: 'dark' }, - configurationDefaults: { - 'workbench.colorTheme': 'Default Dark+', - 'telemetry.telemetryLevel': 'off', - 'workbench.startupEditor': 'readme', - 'anycode.language.features': { - completions: false, - definitions: false, - references: false, - highlights: true, - outline: true, - workspaceSymbols: true, - folding: false, - diagnostics: false, - }, - }, builtinExtensions: window.github1sExtensions || [], - folderUri: { scheme: scheme, authority: '', path: '/' }, - workspaceId: scheme + ':' + repository, - workspaceLabel: workspaceLabel || repository, - hideTextFileLabelDecorations: true, - logo: { - icon: logoIcon, - title: 'Open on ' + platformName, - onClick() { - const pathname = window.location.pathname.length > 1 ? window.location.pathname : '/' + repository; - const targetPath = pathname + window.location.search + window.location.hash; - window.open(platformOrigin + targetPath, '_blank'); - }, - }, onWorkbenchReady() { const loadSpinner = document.querySelector('#load-spinner'); loadSpinner && loadSpinner.remove(); renderNotification(); }, + ...platformConfig, }; })(); diff --git a/vscode-web/.VERSION b/vscode-web/.VERSION index c547233b2..698c6ba78 100644 --- a/vscode-web/.VERSION +++ b/vscode-web/.VERSION @@ -1 +1 @@ -1.70.1 \ No newline at end of file +1.72.1 \ No newline at end of file diff --git a/vscode-web/package.json b/vscode-web/package.json index 27690c418..83515ee8d 100644 --- a/vscode-web/package.json +++ b/vscode-web/package.json @@ -34,10 +34,11 @@ "tas-client-umd": "0.1.6", "vscode-oniguruma": "1.6.1", "vscode-textmate": "7.0.1", - "xterm": "4.20.0-beta.20", - "xterm-addon-search": "0.10.0-beta.3", - "xterm-addon-unicode11": "0.4.0-beta.3", - "xterm-addon-webgl": "0.13.0-beta.9" + "xterm": "5.1.0-beta.15", + "xterm-addon-canvas": "0.3.0-beta.1", + "xterm-addon-search": "0.11.0-beta.1", + "xterm-addon-unicode11": "0.5.0-beta.1", + "xterm-addon-webgl": "0.14.0-beta.8" }, "devDependencies": { "@types/trusted-types": "^2.0.0", diff --git a/vscode-web/src/vs/base/common/platform.ts b/vscode-web/src/vs/base/common/platform.ts deleted file mode 100644 index 579b59907..000000000 --- a/vscode-web/src/vs/base/common/platform.ts +++ /dev/null @@ -1,287 +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 nls from 'vs/nls'; - -const LANGUAGE_DEFAULT = 'en'; - -let _isWindows = false; -let _isMacintosh = false; -let _isLinux = false; -let _isLinuxSnap = false; -let _isNative = false; -let _isWeb = false; -let _isElectron = false; -let _isIOS = false; -// below codes are changed by github1s -// test if current platform is mobile/tablet -let _isMobile = false; -// above codes are changed by github1s -let _isCI = false; -let _locale: string | undefined = undefined; -let _language: string = LANGUAGE_DEFAULT; -let _translationsConfigFile: string | undefined = undefined; -let _userAgent: string | undefined = undefined; - -interface NLSConfig { - locale: string; - availableLanguages: { [key: string]: string }; - _translationsConfigFile: string; -} - -export interface IProcessEnvironment { - [key: string]: string | undefined; -} - -/** - * This interface is intentionally not identical to node.js - * process because it also works in sandboxed environments - * where the process object is implemented differently. We - * define the properties here that we need for `platform` - * to work and nothing else. - */ -export interface INodeProcess { - platform: string; - arch: string; - env: IProcessEnvironment; - versions?: { - electron?: string; - }; - type?: string; - cwd: () => string; -} - -declare const process: INodeProcess; -declare const global: unknown; -declare const self: unknown; - -export const globals: any = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); - -let nodeProcess: INodeProcess | undefined = 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 isElectronProcess = typeof nodeProcess?.versions?.electron === 'string'; -const isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer'; - -interface INavigator { - userAgent: string; - maxTouchPoints?: number; -} -declare const navigator: INavigator; - -// Web environment -if (typeof navigator === 'object' && !isElectronRenderer) { - _userAgent = navigator.userAgent; - _isWindows = _userAgent.indexOf('Windows') >= 0; - _isMacintosh = _userAgent.indexOf('Macintosh') >= 0; - _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; - _isLinux = _userAgent.indexOf('Linux') >= 0; - _isWeb = true; - // below codes are changed by github1s - // `window` may can not be accessed in webworker (for example opera) - const _userAgentStr: string = (typeof navigator !== 'undefined' ? (navigator.userAgent || (navigator as any).vendor) : undefined) || (typeof window !== 'undefined' ? (window as any).opera : undefined); - // this code is from http://detectmobilebrowsers.com/ - // eslint-disable-next-line - _isMobile = (function (a) { return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(_userAgentStr || ''); - // above codes are changed by github1s - - const configuredLocale = nls.getConfiguredDefaultLocale( - // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale` - // to ensure that the NLS AMD Loader plugin has been loaded and configured. - // This is because the loader plugin decides what the default locale is based on - // how it's able to resolve the strings. - nls.localize({ key: 'ensureLoaderPluginIsLoaded', comment: ['{Locked}'] }, '_') - ); - - _locale = configuredLocale || LANGUAGE_DEFAULT; - - _language = _locale; -} - -// Native environment -else if (typeof nodeProcess === 'object') { - _isWindows = (nodeProcess.platform === 'win32'); - _isMacintosh = (nodeProcess.platform === 'darwin'); - _isLinux = (nodeProcess.platform === 'linux'); - _isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION']; - _isElectron = isElectronProcess; - _isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY']; - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - const rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig); - const resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } catch (e) { - } - } - _isNative = true; -} - -// Unknown environment -else { - console.error('Unable to resolve platform.'); -} - -export const enum Platform { - Web, - Mac, - Linux, - Windows -} -export function PlatformToString(platform: Platform) { - switch (platform) { - case Platform.Web: return 'Web'; - case Platform.Mac: return 'Mac'; - case Platform.Linux: return 'Linux'; - case Platform.Windows: return 'Windows'; - } -} - -let _platform: Platform = Platform.Web; -if (_isMacintosh) { - _platform = Platform.Mac; -} else if (_isWindows) { - _platform = Platform.Windows; -} else if (_isLinux) { - _platform = Platform.Linux; -} - -export const isWindows = _isWindows; -export const isMacintosh = _isMacintosh; -export const isLinux = _isLinux; -export const isLinuxSnap = _isLinuxSnap; -export const isNative = _isNative; -export const isElectron = _isElectron; -export const isWeb = _isWeb; -export const isWebWorker = (_isWeb && typeof globals.importScripts === 'function'); -export const isIOS = _isIOS; -// below codes are changed by github1s -export const isMobile = _isMobile; -// above codes are changed by github1s -/** - * Whether we run inside a CI environment, such as - * GH actions or Azure Pipelines. - */ -export const isCI = _isCI; -export const platform = _platform; -export const userAgent = _userAgent; - -/** - * The language used for the user interface. The format of - * the string is all lower case (e.g. zh-tw for Traditional - * Chinese) - */ -export const language = _language; - -export namespace Language { - - export function value(): string { - return language; - } - - export function isDefaultVariant(): boolean { - if (language.length === 2) { - return language === 'en'; - } else if (language.length >= 3) { - return language[0] === 'e' && language[1] === 'n' && language[2] === '-'; - } else { - return false; - } - } - - export function isDefault(): boolean { - return language === 'en'; - } -} - -/** - * The OS locale or the locale specified by --locale. The format of - * the string is all lower case (e.g. zh-tw for Traditional - * Chinese). The UI is not necessarily shown in the provided locale. - */ -export const locale = _locale; - -/** - * The translations that are available through language packs. - */ -export const translationsConfigFile = _translationsConfigFile; - -export const setTimeout0IsFaster = (typeof globals.postMessage === 'function' && !globals.importScripts); - -/** - * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-. - * - * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay - * that browsers set when the nesting level is > 5. - */ -export const setTimeout0 = (() => { - if (setTimeout0IsFaster) { - interface IQueueElement { - id: number; - callback: () => void; - } - const pending: IQueueElement[] = []; - globals.addEventListener('message', (e: MessageEvent) => { - if (e.data && e.data.vscodeScheduleAsyncWork) { - for (let i = 0, len = pending.length; i < len; i++) { - const candidate = pending[i]; - if (candidate.id === e.data.vscodeScheduleAsyncWork) { - pending.splice(i, 1); - candidate.callback(); - return; - } - } - } - }); - let lastId = 0; - return (callback: () => void) => { - const myId = ++lastId; - pending.push({ - id: myId, - callback: callback - }); - globals.postMessage({ vscodeScheduleAsyncWork: myId }, '*'); - }; - } - return (callback: () => void) => setTimeout(callback); -})(); - -export const enum OperatingSystem { - Windows = 1, - Macintosh = 2, - Linux = 3 -} -export const OS = (_isMacintosh || _isIOS ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux)); - -let _isLittleEndian = true; -let _isLittleEndianComputed = false; -export function isLittleEndian(): boolean { - if (!_isLittleEndianComputed) { - _isLittleEndianComputed = true; - const test = new Uint8Array(2); - test[0] = 1; - test[1] = 2; - const view = new Uint16Array(test.buffer); - _isLittleEndian = (view[0] === (2 << 8) + 1); - } - return _isLittleEndian; -} - -export const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0); -export const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0); -export const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0)); -export const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0); -export const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0); diff --git a/vscode-web/src/vs/code/browser/workbench/workbench.ts b/vscode-web/src/vs/code/browser/workbench/workbench.ts index f70c49128..eae21009d 100644 --- a/vscode-web/src/vs/code/browser/workbench/workbench.ts +++ b/vscode-web/src/vs/code/browser/workbench/workbench.ts @@ -3,16 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { create, IWorkbenchConstructionOptions, IWorkspaceProvider, UriComponents } from 'vs/workbench/workbench.web.main'; +import { create } from 'vs/workbench/workbench.web.main'; import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; +import { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api'; +import { IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService'; +import { URI, UriComponents } from 'vs/base/common/uri'; import { env } from 'vs/workbench/browser/web.factory'; -import { URI } from 'vs/base/common/uri'; // same as vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts interface IBundledExtension { extensionPath: string; packageJSON: IExtensionManifest; packageNLS?: any; + browserNlsMetadataPath?: string; readmePath?: string; changelogPath?: string; } @@ -20,7 +23,7 @@ interface IBundledExtension { declare global { interface Window { vscodeWeb?: Partial & { - folderUri?: UriComponents; // easy way to build single folder workspace + workspace?: { folderUri?: UriComponents; workspaceUri?: UriComponents; }; workspaceId?: string; // the identifier to distinguish workspace workspaceLabel?: string; // the label shown on explorer hideTextFileReadonlyIcon?: boolean; // if hide the readonly icon for readonly files @@ -40,11 +43,21 @@ declare global { } (function () { - const workspaceProvider: IWorkspaceProvider | undefined = window?.vscodeWeb?.folderUri ? { + const resolveWorkspace = (workspace?: { folderUri?: UriComponents; workspaceUri?: UriComponents; }) => { + if (workspace?.folderUri) { + return { folderUri: URI.from(workspace.folderUri) }; + } + if (workspace?.workspaceUri) { + return { workspaceUri: URI.from(workspace.workspaceUri) }; + } + return { workspaceUri: URI.from({ scheme: 'tmp', path: '/default.code-workspace' }) }; + }; + + const workspaceProvider: IWorkspaceProvider | undefined = { trusted: true, - workspace: { folderUri: URI.from(window.vscodeWeb.folderUri) }, + workspace: resolveWorkspace(window.vscodeWeb?.workspace), open: window.vscodeWeb?.openWorkspace || (() => Promise.resolve(false)), - } : undefined; + }; // Create workbench create(document.body, { workspaceProvider, ...window.vscodeWeb }); diff --git a/vscode-web/src/vs/editor/common/config/editorOptions.ts b/vscode-web/src/vs/editor/common/config/editorOptions.ts index 75982d294..6d9711c08 100644 --- a/vscode-web/src/vs/editor/common/config/editorOptions.ts +++ b/vscode-web/src/vs/editor/common/config/editorOptions.ts @@ -170,9 +170,9 @@ export interface IEditorOptions { */ scrollbar?: IEditorScrollbarOptions; /** - * Control the behavior of experimental options + * Control the behavior of sticky scroll options */ - experimental?: IEditorExperimentalOptions; + stickyScroll?: IEditorStickyScrollOptions; /** * Control the behavior and rendering of the minimap. */ @@ -640,6 +640,10 @@ export interface IEditorOptions { * Controls strikethrough deprecated variables. */ showDeprecated?: boolean; + /** + * Controls whether suggestions allow matches in the middle of the word instead of only at the beginning + */ + matchOnWordStartOnly?: boolean; /** * Control the behavior and rendering of the inline hints. */ @@ -733,6 +737,10 @@ export interface IDiffEditorBaseOptions { * Control the wrapping of the diff editor. */ diffWordWrap?: 'off' | 'on' | 'inherit'; + /** + * Diff Algorithm + */ + diffAlgorithm?: 'smart' | 'experimental'; } /** @@ -2508,51 +2516,56 @@ class EditorLightbulb extends BaseEditorOption { +/** + * @internal + */ +export type EditorStickyScrollOptions = Readonly>; + +class EditorStickyScroll extends BaseEditorOption { constructor() { - const defaults: EditorExperimentalOptions = { stickyScroll: { enabled: false } }; + const defaults: EditorStickyScrollOptions = { enabled: false, maxLineCount: 5 }; super( - EditorOption.experimental, 'experimental', defaults, + EditorOption.stickyScroll, 'stickyScroll', defaults, { - 'editor.experimental.stickyScroll.enabled': { + 'editor.stickyScroll.enabled': { type: 'boolean', - default: defaults.stickyScroll.enabled, - description: nls.localize('editor.experimental.stickyScroll', "Shows the nested current scopes during the scroll at the top of the editor.") + default: defaults.enabled, + description: nls.localize('editor.stickyScroll', "Shows the nested current scopes during the scroll at the top of the editor.") + }, + 'editor.stickyScroll.maxLineCount': { + type: 'number', + default: defaults.maxLineCount, + minimum: 1, + maximum: 10, + description: nls.localize('editor.stickyScroll.', "Defines the maximum number of sticky lines to show.") }, } ); } - public validate(_input: any): EditorExperimentalOptions { + public validate(_input: any): EditorStickyScrollOptions { if (!_input || typeof _input !== 'object') { return this.defaultValue; } - const input = _input as IEditorExperimentalOptions; + const input = _input as IEditorStickyScrollOptions; return { - stickyScroll: { - enabled: boolean(input.stickyScroll?.enabled, this.defaultValue.stickyScroll.enabled) - } + enabled: boolean(input.enabled, this.defaultValue.enabled), + maxLineCount: EditorIntOption.clampedInt(input.maxLineCount, this.defaultValue.maxLineCount, 1, 10), }; } } @@ -2609,8 +2622,8 @@ class EditorInlayHints extends BaseEditorOption