From b78a9e4bd305f0378c230cf2139a462acd38d03b Mon Sep 17 00:00:00 2001 From: Heejae Chang <1333179+heejaechang@users.noreply.github.com> Date: Wed, 4 Jan 2023 14:07:31 -0800 Subject: [PATCH] Push pylance changes to pyright (#4404) Co-authored-by: Bill Schnurr Co-authored-by: HeeJae Chang Co-authored-by: Erik De Bonte Co-authored-by: Rich Chiodo --- package-lock.json | 534 ++++++++++-------- package.json | 12 +- packages/pyright-internal/package-lock.json | 106 ++-- packages/pyright-internal/package.json | 10 +- .../src/analyzer/importResolver.ts | 36 +- .../pyright-internal/src/analyzer/program.ts | 79 ++- .../pyright-internal/src/analyzer/regions.ts | 21 +- .../src/analyzer/sourceMapper.ts | 17 +- .../src/analyzer/typeDocStringUtils.ts | 22 +- .../src/commands/quickActionCommand.ts | 4 +- .../src/common/collectionUtils.ts | 9 + .../src/common/textEditUtils.ts | 20 +- .../src/languageService/completionProvider.ts | 440 +++++++++------ .../src/languageService/hoverProvider.ts | 38 +- .../src/languageService/indentationUtils.ts | 2 +- .../src/languageService/tooltipUtils.ts | 45 +- .../src/tests/completions.test.ts | 360 ++++++++++++ .../src/tests/filesystem.test.ts | 15 + .../src/tests/harness/fourslash/testState.ts | 2 +- .../src/tests/harness/vfs/filesystem.ts | 15 +- .../src/tests/hoverProvider.test.ts | 269 +++++++++ .../src/tests/indentationUtils.ptvs.test.ts | 2 +- .../src/tests/indentationUtils.test.ts | 8 +- packages/pyright-internal/src/workspaceMap.ts | 4 +- packages/pyright/package-lock.json | 14 +- packages/pyright/package.json | 2 +- packages/vscode-pyright/package-lock.json | 98 ++-- packages/vscode-pyright/package.json | 10 +- 28 files changed, 1534 insertions(+), 660 deletions(-) create mode 100644 packages/pyright-internal/src/tests/completions.test.ts create mode 100644 packages/pyright-internal/src/tests/hoverProvider.test.ts diff --git a/package-lock.json b/package-lock.json index 8809c80291a9..6b896597b9d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,18 +10,18 @@ "@types/glob": "^7.2.0", "@types/node": "^17.0.45", "@types/yargs": "^16.0.4", - "@typescript-eslint/eslint-plugin": "^5.43.0", - "@typescript-eslint/parser": "^5.43.0", + "@typescript-eslint/eslint-plugin": "^5.48.0", + "@typescript-eslint/parser": "^5.48.0", "detect-indent": "^6.1.0", - "eslint": "^8.27.0", - "eslint-config-prettier": "^8.5.0", + "eslint": "^8.31.0", + "eslint-config-prettier": "^8.6.0", "eslint-plugin-simple-import-sort": "^7.0.0", "glob": "^7.2.3", "jsonc-parser": "^3.2.0", "lerna": "^5.6.2", - "npm-check-updates": "^16.4.1", + "npm-check-updates": "^16.6.2", "p-queue": "^6.6.2", - "prettier": "2.7.1", + "prettier": "2.8.1", "syncpack": "^5.8.15", "typescript": "~4.4.4", "yargs": "^16.2.0" @@ -134,15 +134,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -163,14 +163,14 @@ "dev": true }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.6", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.6.tgz", - "integrity": "sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" @@ -1904,14 +1904,14 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.43.0.tgz", - "integrity": "sha512-wNPzG+eDR6+hhW4yobEmpR36jrqqQv1vxBq5LJO3fBAktjkvekfr4BRl+3Fn1CM/A+s8/EiGUbOMDoYqWdbtXA==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", + "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.43.0", - "@typescript-eslint/type-utils": "5.43.0", - "@typescript-eslint/utils": "5.43.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/type-utils": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -1937,14 +1937,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.43.0.tgz", - "integrity": "sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", + "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.43.0", - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/typescript-estree": "5.43.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "debug": "^4.3.4" }, "engines": { @@ -1964,13 +1964,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz", - "integrity": "sha512-XNWnGaqAtTJsUiZaoiGIrdJYHsUOd3BZ3Qj5zKp9w6km6HsrjPk/TGZv0qMTWyWj0+1QOqpHQ2gZOLXaGA9Ekw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", + "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/visitor-keys": "5.43.0" + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1981,13 +1981,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.43.0.tgz", - "integrity": "sha512-K21f+KY2/VvYggLf5Pk4tgBOPs2otTaIHy2zjclo7UZGLyFH86VfUOm5iq+OtDtxq/Zwu2I3ujDBykVW4Xtmtg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", + "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.43.0", - "@typescript-eslint/utils": "5.43.0", + "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -2008,9 +2008,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.43.0.tgz", - "integrity": "sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", + "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2021,13 +2021,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz", - "integrity": "sha512-BZ1WVe+QQ+igWal2tDbNg1j2HWUkAa+CVqdU79L4HP9izQY6CNhXfkNwd1SS4+sSZAP/EthI1uiCSY/+H0pROg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", + "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/visitor-keys": "5.43.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2048,16 +2048,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.43.0.tgz", - "integrity": "sha512-8nVpA6yX0sCjf7v/NDfeaOlyaIIqL7OaIGOWSPFqUKK59Gnumd3Wa+2l8oAaYO2lk0sO+SbWFWRSvhu8gLGv4A==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", + "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.43.0", - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/typescript-estree": "5.43.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -2074,12 +2074,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz", - "integrity": "sha512-icl1jNH/d18OVHLfcwdL3bWUKsBeIiKYTGxMJCoGe7xFht+E4QgzOqoWYrU8XSLJWhVw8nTacbm03v23J/hFTg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", + "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.43.0", + "@typescript-eslint/types": "5.48.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -3785,13 +3785,13 @@ } }, "node_modules/eslint": { - "version": "8.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.27.0.tgz", - "integrity": "sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==", + "version": "8.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", + "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -3810,7 +3810,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -3841,9 +3841,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", - "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -3933,9 +3933,9 @@ } }, "node_modules/espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "dependencies": { "acorn": "^8.8.0", @@ -4638,9 +4638,9 @@ } }, "node_modules/globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -6542,12 +6542,12 @@ } }, "node_modules/npm-check-updates": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.4.1.tgz", - "integrity": "sha512-g0Uf1kCw0p5boutvu5E4htsjYEDuFT9LxYHYFLldAzWs5012jVikEH1Wdae68xedu4twF4EVbKcs83+G2nGnQg==", + "version": "16.6.2", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.6.2.tgz", + "integrity": "sha512-J/L90a+NDDWscBQGKIsPKer+qbQEQRJDpK+BPsVZf9YWDN5DCAMicPqRb+Emnxfi8QboiNmvDJWRUFFWRQzDMg==", "dev": true, "dependencies": { - "chalk": "^5.1.2", + "chalk": "^5.2.0", "cli-table": "^0.3.11", "commander": "^9.4.1", "fast-memoize": "^2.5.2", @@ -6560,9 +6560,9 @@ "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", - "minimatch": "^5.1.0", + "minimatch": "^5.1.2", "p-map": "^4.0.0", - "pacote": "15.0.6", + "pacote": "15.0.8", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^2.5.1", @@ -6575,7 +6575,7 @@ "spawn-please": "^2.0.1", "untildify": "^4.0.0", "update-notifier": "^6.0.2", - "yaml": "^2.1.3" + "yaml": "^2.2.0" }, "bin": { "ncu": "build/src/bin/cli.js", @@ -6643,9 +6643,9 @@ } }, "node_modules/npm-check-updates/node_modules/@npmcli/promise-spawn": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.1.tgz", - "integrity": "sha512-+hcUpxgx0vEpDJI9Cn+lkTdKLoqKBXFCVps5H7FujEU2vLOp6KwqjLlxbnz8Wzgm8oEqW/u5FeNAXSFjLdCD0A==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "dev": true, "dependencies": { "which": "^3.0.0" @@ -6680,16 +6680,16 @@ } }, "node_modules/npm-check-updates/node_modules/cacache": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.2.tgz", - "integrity": "sha512-rYUs2x4OjSgCQND7nTrh21AHIBFgd7s/ctAYvU3a8u+nK+R5YaX/SFPDYz4Azz7SGL6+6L9ZZWI4Kawpb7grzQ==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", "dev": true, "dependencies": { "@npmcli/fs": "^3.1.0", - "fs-minipass": "^2.1.0", + "fs-minipass": "^3.0.0", "glob": "^8.0.1", "lru-cache": "^7.7.1", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -6704,9 +6704,9 @@ } }, "node_modules/npm-check-updates/node_modules/chalk": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", - "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -6715,6 +6715,18 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/npm-check-updates/node_modules/fs-minipass": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.0.tgz", + "integrity": "sha512-EUojgQaSPy6sxcqcZgQv6TVF6jiKvurji3AxhAivs/Ep4O1UpS8TusaxpybfFHZ2skRhLqzk6WR8nqNYIMMDeA==", + "dev": true, + "dependencies": { + "minipass": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm-check-updates/node_modules/glob": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", @@ -6777,9 +6789,9 @@ } }, "node_modules/npm-check-updates/node_modules/make-fetch-happen": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.1.tgz", - "integrity": "sha512-clv3IblugXn2CDUmqFhNzii3rjKa46u5wNeivc+QlLXkGI5FjLX3rGboo+y2kwf1pd8W0iDiC384cemeDtw9kw==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.2.tgz", + "integrity": "sha512-5n/Pq41w/uZghpdlXAY5kIM85RgJThtTH/NYBRAZ9VUOBWV90USaQjwGrw76fZP3Lj5hl/VZjpVvOaRBMoL/2w==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -6789,7 +6801,7 @@ "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-collect": "^1.0.2", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", @@ -6804,9 +6816,9 @@ } }, "node_modules/npm-check-updates/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -6815,13 +6827,25 @@ "node": ">=10" } }, + "node_modules/npm-check-updates/node_modules/minipass": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.0.tgz", + "integrity": "sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/npm-check-updates/node_modules/minipass-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.0.tgz", - "integrity": "sha512-NSx3k5gR4Q5Ts2poCM/19d45VwhVLBtJZ6ypYcthj2BwmDx/e7lW8Aadnyt3edd2W0ecb+b0o7FYLRYE2AGcQg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", "dev": true, "dependencies": { - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, @@ -6893,9 +6917,9 @@ } }, "node_modules/npm-check-updates/node_modules/npm-package-arg": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.0.0.tgz", - "integrity": "sha512-7dkh8mRp7s0KwVHKIVJnFCJQ2B34gOGnzgBjDGyprycmARq/82SX/lhilQ95ZuacP/G/1gsS345iAkKmxWBQ2Q==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, "dependencies": { "hosted-git-info": "^6.0.0", @@ -6920,9 +6944,9 @@ } }, "node_modules/npm-check-updates/node_modules/npm-packlist": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.2.tgz", - "integrity": "sha512-d2+7RMySjVXssww23rV5NuIq1NzGvM04OlI5kwnvtYKfFTAPVs6Zxmxns2HRtJEA1oNj7D/BbFXeVAOLmW3N3Q==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", + "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", "dev": true, "dependencies": { "ignore-walk": "^6.0.0" @@ -6947,13 +6971,13 @@ } }, "node_modules/npm-check-updates/node_modules/npm-registry-fetch": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.2.tgz", - "integrity": "sha512-TMenrMagFA9KF81E2bkS5XRyzERK4KXu70vgXt5+i8FcrFeLNgNsc6e5hekTqjDwPDkL3HGn/holWcXDMfnFgw==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.3.tgz", + "integrity": "sha512-YaeRbVNpnWvsGOjX2wk5s85XJ7l1qQBGAp724h8e2CZFFhMSuw9enom7K1mWVUtvXO1uUSFIAPofQK0pPN0ZcA==", "dev": true, "dependencies": { "make-fetch-happen": "^11.0.0", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", @@ -6965,9 +6989,9 @@ } }, "node_modules/npm-check-updates/node_modules/pacote": { - "version": "15.0.6", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.0.6.tgz", - "integrity": "sha512-dQwcz/sME7QIL+cdrw/jftQfMMXxSo17i2kJ/gnhBhUvvBAsxoBu1lw9B5IzCH/Ce8CvEkG/QYZ6txzKfn0bTw==", + "version": "15.0.8", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.0.8.tgz", + "integrity": "sha512-UlcumB/XS6xyyIMwg/WwMAyUmga+RivB5KgkRwA1hZNtrx+0Bt41KxHCvg1kr0pZ/ZeD8qjhW4fph6VaYRCbLw==", "dev": true, "dependencies": { "@npmcli/git": "^4.0.0", @@ -6975,8 +6999,8 @@ "@npmcli/promise-spawn": "^6.0.1", "@npmcli/run-script": "^6.0.0", "cacache": "^17.0.0", - "fs-minipass": "^2.1.0", - "minipass": "^3.1.6", + "fs-minipass": "^3.0.0", + "minipass": "^4.0.0", "npm-package-arg": "^10.0.0", "npm-packlist": "^7.0.0", "npm-pick-manifest": "^8.0.0", @@ -7020,9 +7044,9 @@ } }, "node_modules/npm-check-updates/node_modules/read-package-json-fast": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.1.tgz", - "integrity": "sha512-8+HW7Yo+cjfF+md8DqsZHgats2mxf7gGYow/+2JjxrftoHFZz9v4dzd0EubzYbkNaLxrTVcnllHwklXN2+7aTQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", "dev": true, "dependencies": { "json-parse-even-better-errors": "^3.0.0", @@ -7033,12 +7057,12 @@ } }, "node_modules/npm-check-updates/node_modules/ssri": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.0.tgz", - "integrity": "sha512-64ghGOpqW0k+jh7m5jndBGdVEoPikWwGQmBNN5ks6jyUSMymzHDTlnNHOvzp+6MmHOljr2MokUzvRksnTwG0Iw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", "dev": true, "dependencies": { - "minipass": "^3.1.1" + "minipass": "^4.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -7096,9 +7120,9 @@ } }, "node_modules/npm-check-updates/node_modules/yaml": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", - "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", "dev": true, "engines": { "node": ">= 14" @@ -8132,9 +8156,9 @@ } }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz", + "integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -10380,15 +10404,15 @@ } }, "@eslint/eslintrc": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", - "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -10403,14 +10427,14 @@ "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.6", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.6.tgz", - "integrity": "sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" } }, "@humanwhocodes/module-importer": { @@ -11814,14 +11838,14 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.43.0.tgz", - "integrity": "sha512-wNPzG+eDR6+hhW4yobEmpR36jrqqQv1vxBq5LJO3fBAktjkvekfr4BRl+3Fn1CM/A+s8/EiGUbOMDoYqWdbtXA==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", + "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.43.0", - "@typescript-eslint/type-utils": "5.43.0", - "@typescript-eslint/utils": "5.43.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/type-utils": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -11831,53 +11855,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.43.0.tgz", - "integrity": "sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", + "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.43.0", - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/typescript-estree": "5.43.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz", - "integrity": "sha512-XNWnGaqAtTJsUiZaoiGIrdJYHsUOd3BZ3Qj5zKp9w6km6HsrjPk/TGZv0qMTWyWj0+1QOqpHQ2gZOLXaGA9Ekw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", + "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", "dev": true, "requires": { - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/visitor-keys": "5.43.0" + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0" } }, "@typescript-eslint/type-utils": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.43.0.tgz", - "integrity": "sha512-K21f+KY2/VvYggLf5Pk4tgBOPs2otTaIHy2zjclo7UZGLyFH86VfUOm5iq+OtDtxq/Zwu2I3ujDBykVW4Xtmtg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", + "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.43.0", - "@typescript-eslint/utils": "5.43.0", + "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.43.0.tgz", - "integrity": "sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", + "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz", - "integrity": "sha512-BZ1WVe+QQ+igWal2tDbNg1j2HWUkAa+CVqdU79L4HP9izQY6CNhXfkNwd1SS4+sSZAP/EthI1uiCSY/+H0pROg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", + "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/visitor-keys": "5.43.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/visitor-keys": "5.48.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -11886,28 +11910,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.43.0.tgz", - "integrity": "sha512-8nVpA6yX0sCjf7v/NDfeaOlyaIIqL7OaIGOWSPFqUKK59Gnumd3Wa+2l8oAaYO2lk0sO+SbWFWRSvhu8gLGv4A==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", + "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.43.0", - "@typescript-eslint/types": "5.43.0", - "@typescript-eslint/typescript-estree": "5.43.0", + "@typescript-eslint/scope-manager": "5.48.0", + "@typescript-eslint/types": "5.48.0", + "@typescript-eslint/typescript-estree": "5.48.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.43.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz", - "integrity": "sha512-icl1jNH/d18OVHLfcwdL3bWUKsBeIiKYTGxMJCoGe7xFht+E4QgzOqoWYrU8XSLJWhVw8nTacbm03v23J/hFTg==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", + "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.43.0", + "@typescript-eslint/types": "5.48.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -13185,13 +13209,13 @@ "dev": true }, "eslint": { - "version": "8.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.27.0.tgz", - "integrity": "sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==", + "version": "8.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", + "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -13210,7 +13234,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -13250,9 +13274,9 @@ } }, "eslint-config-prettier": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", - "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", "dev": true, "requires": {} }, @@ -13297,9 +13321,9 @@ "dev": true }, "espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "requires": { "acorn": "^8.8.0", @@ -13839,9 +13863,9 @@ } }, "globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -15274,12 +15298,12 @@ } }, "npm-check-updates": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.4.1.tgz", - "integrity": "sha512-g0Uf1kCw0p5boutvu5E4htsjYEDuFT9LxYHYFLldAzWs5012jVikEH1Wdae68xedu4twF4EVbKcs83+G2nGnQg==", + "version": "16.6.2", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.6.2.tgz", + "integrity": "sha512-J/L90a+NDDWscBQGKIsPKer+qbQEQRJDpK+BPsVZf9YWDN5DCAMicPqRb+Emnxfi8QboiNmvDJWRUFFWRQzDMg==", "dev": true, "requires": { - "chalk": "^5.1.2", + "chalk": "^5.2.0", "cli-table": "^0.3.11", "commander": "^9.4.1", "fast-memoize": "^2.5.2", @@ -15292,9 +15316,9 @@ "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", - "minimatch": "^5.1.0", + "minimatch": "^5.1.2", "p-map": "^4.0.0", - "pacote": "15.0.6", + "pacote": "15.0.8", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^2.5.1", @@ -15307,7 +15331,7 @@ "spawn-please": "^2.0.1", "untildify": "^4.0.0", "update-notifier": "^6.0.2", - "yaml": "^2.1.3" + "yaml": "^2.2.0" }, "dependencies": { "@npmcli/fs": { @@ -15353,9 +15377,9 @@ "dev": true }, "@npmcli/promise-spawn": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.1.tgz", - "integrity": "sha512-+hcUpxgx0vEpDJI9Cn+lkTdKLoqKBXFCVps5H7FujEU2vLOp6KwqjLlxbnz8Wzgm8oEqW/u5FeNAXSFjLdCD0A==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "dev": true, "requires": { "which": "^3.0.0" @@ -15384,16 +15408,16 @@ } }, "cacache": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.2.tgz", - "integrity": "sha512-rYUs2x4OjSgCQND7nTrh21AHIBFgd7s/ctAYvU3a8u+nK+R5YaX/SFPDYz4Azz7SGL6+6L9ZZWI4Kawpb7grzQ==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", "dev": true, "requires": { "@npmcli/fs": "^3.1.0", - "fs-minipass": "^2.1.0", + "fs-minipass": "^3.0.0", "glob": "^8.0.1", "lru-cache": "^7.7.1", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", @@ -15405,11 +15429,20 @@ } }, "chalk": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz", - "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true }, + "fs-minipass": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.0.tgz", + "integrity": "sha512-EUojgQaSPy6sxcqcZgQv6TVF6jiKvurji3AxhAivs/Ep4O1UpS8TusaxpybfFHZ2skRhLqzk6WR8nqNYIMMDeA==", + "dev": true, + "requires": { + "minipass": "^4.0.0" + } + }, "glob": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", @@ -15454,9 +15487,9 @@ "dev": true }, "make-fetch-happen": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.1.tgz", - "integrity": "sha512-clv3IblugXn2CDUmqFhNzii3rjKa46u5wNeivc+QlLXkGI5FjLX3rGboo+y2kwf1pd8W0iDiC384cemeDtw9kw==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.0.2.tgz", + "integrity": "sha512-5n/Pq41w/uZghpdlXAY5kIM85RgJThtTH/NYBRAZ9VUOBWV90USaQjwGrw76fZP3Lj5hl/VZjpVvOaRBMoL/2w==", "dev": true, "requires": { "agentkeepalive": "^4.2.1", @@ -15466,7 +15499,7 @@ "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-collect": "^1.0.2", "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", @@ -15478,22 +15511,31 @@ } }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" } }, + "minipass": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.0.tgz", + "integrity": "sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "minipass-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.0.tgz", - "integrity": "sha512-NSx3k5gR4Q5Ts2poCM/19d45VwhVLBtJZ6ypYcthj2BwmDx/e7lW8Aadnyt3edd2W0ecb+b0o7FYLRYE2AGcQg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.1.tgz", + "integrity": "sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw==", "dev": true, "requires": { "encoding": "^0.1.13", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" } @@ -15546,9 +15588,9 @@ "dev": true }, "npm-package-arg": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.0.0.tgz", - "integrity": "sha512-7dkh8mRp7s0KwVHKIVJnFCJQ2B34gOGnzgBjDGyprycmARq/82SX/lhilQ95ZuacP/G/1gsS345iAkKmxWBQ2Q==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, "requires": { "hosted-git-info": "^6.0.0", @@ -15569,9 +15611,9 @@ } }, "npm-packlist": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.2.tgz", - "integrity": "sha512-d2+7RMySjVXssww23rV5NuIq1NzGvM04OlI5kwnvtYKfFTAPVs6Zxmxns2HRtJEA1oNj7D/BbFXeVAOLmW3N3Q==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", + "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", "dev": true, "requires": { "ignore-walk": "^6.0.0" @@ -15590,13 +15632,13 @@ } }, "npm-registry-fetch": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.2.tgz", - "integrity": "sha512-TMenrMagFA9KF81E2bkS5XRyzERK4KXu70vgXt5+i8FcrFeLNgNsc6e5hekTqjDwPDkL3HGn/holWcXDMfnFgw==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.3.tgz", + "integrity": "sha512-YaeRbVNpnWvsGOjX2wk5s85XJ7l1qQBGAp724h8e2CZFFhMSuw9enom7K1mWVUtvXO1uUSFIAPofQK0pPN0ZcA==", "dev": true, "requires": { "make-fetch-happen": "^11.0.0", - "minipass": "^3.1.6", + "minipass": "^4.0.0", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", @@ -15605,9 +15647,9 @@ } }, "pacote": { - "version": "15.0.6", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.0.6.tgz", - "integrity": "sha512-dQwcz/sME7QIL+cdrw/jftQfMMXxSo17i2kJ/gnhBhUvvBAsxoBu1lw9B5IzCH/Ce8CvEkG/QYZ6txzKfn0bTw==", + "version": "15.0.8", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.0.8.tgz", + "integrity": "sha512-UlcumB/XS6xyyIMwg/WwMAyUmga+RivB5KgkRwA1hZNtrx+0Bt41KxHCvg1kr0pZ/ZeD8qjhW4fph6VaYRCbLw==", "dev": true, "requires": { "@npmcli/git": "^4.0.0", @@ -15615,8 +15657,8 @@ "@npmcli/promise-spawn": "^6.0.1", "@npmcli/run-script": "^6.0.0", "cacache": "^17.0.0", - "fs-minipass": "^2.1.0", - "minipass": "^3.1.6", + "fs-minipass": "^3.0.0", + "minipass": "^4.0.0", "npm-package-arg": "^10.0.0", "npm-packlist": "^7.0.0", "npm-pick-manifest": "^8.0.0", @@ -15648,9 +15690,9 @@ } }, "read-package-json-fast": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.1.tgz", - "integrity": "sha512-8+HW7Yo+cjfF+md8DqsZHgats2mxf7gGYow/+2JjxrftoHFZz9v4dzd0EubzYbkNaLxrTVcnllHwklXN2+7aTQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", "dev": true, "requires": { "json-parse-even-better-errors": "^3.0.0", @@ -15658,12 +15700,12 @@ } }, "ssri": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.0.tgz", - "integrity": "sha512-64ghGOpqW0k+jh7m5jndBGdVEoPikWwGQmBNN5ks6jyUSMymzHDTlnNHOvzp+6MmHOljr2MokUzvRksnTwG0Iw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.1.tgz", + "integrity": "sha512-WVy6di9DlPOeBWEjMScpNipeSX2jIZBGEn5Uuo8Q7aIuFEuDX0pw8RxcOjlD1TWP4obi24ki7m/13+nFpcbXrw==", "dev": true, "requires": { - "minipass": "^3.1.1" + "minipass": "^4.0.0" } }, "unique-filename": { @@ -15703,9 +15745,9 @@ } }, "yaml": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", - "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", "dev": true } } @@ -16477,9 +16519,9 @@ "dev": true }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz", + "integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==", "dev": true }, "proc-log": { diff --git a/package.json b/package.json index 7119f0a3f527..b3c88b53ea3e 100644 --- a/package.json +++ b/package.json @@ -23,18 +23,18 @@ "@types/glob": "^7.2.0", "@types/node": "^17.0.45", "@types/yargs": "^16.0.4", - "@typescript-eslint/eslint-plugin": "^5.43.0", - "@typescript-eslint/parser": "^5.43.0", + "@typescript-eslint/eslint-plugin": "^5.48.0", + "@typescript-eslint/parser": "^5.48.0", "detect-indent": "^6.1.0", - "eslint": "^8.27.0", - "eslint-config-prettier": "^8.5.0", + "eslint": "^8.31.0", + "eslint-config-prettier": "^8.6.0", "eslint-plugin-simple-import-sort": "^7.0.0", "glob": "^7.2.3", "jsonc-parser": "^3.2.0", "lerna": "^5.6.2", - "npm-check-updates": "^16.4.1", + "npm-check-updates": "^16.6.2", "p-queue": "^6.6.2", - "prettier": "2.7.1", + "prettier": "2.8.1", "syncpack": "^5.8.15", "typescript": "~4.4.4", "yargs": "^16.2.0" diff --git a/packages/pyright-internal/package-lock.json b/packages/pyright-internal/package-lock.json index a5a6ee1173cc..13db8134dcd4 100644 --- a/packages/pyright-internal/package-lock.json +++ b/packages/pyright-internal/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "@yarnpkg/fslib": "2.9.0", + "@yarnpkg/fslib": "2.10.0", "@yarnpkg/libzip": "2.2.4", "chalk": "^4.1.2", "chokidar": "^3.5.3", @@ -20,11 +20,11 @@ "source-map-support": "^0.5.21", "tmp": "^0.2.1", "typescript-char": "^0.0.0", - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageserver": "8.1.0-next.1", - "vscode-languageserver-textdocument": "^1.0.7", + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageserver": "8.1.0-next.4", + "vscode-languageserver-textdocument": "^1.0.8", "vscode-languageserver-types": "3.17.2", - "vscode-uri": "^3.0.6" + "vscode-uri": "^3.0.7" }, "devDependencies": { "@types/command-line-args": "^5.2.0", @@ -1044,9 +1044,9 @@ "dev": true }, "node_modules/@yarnpkg/fslib": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.9.0.tgz", - "integrity": "sha512-PIdwI2z1HFl6aUkketbgUJK3FGRVWVwH1vgHltNe+snJzjlKHMavyIR0fipkAJuHVcac+hzWI1/eMr90rVyMHw==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.10.0.tgz", + "integrity": "sha512-eHqvrVlzlhd4owKoLsMRaL4wTGer+r9BXi95u1omHYcAcEQbKnHH3PqYf3j7nxsc8apa09WyA1XNCiiIniFXLg==", "dependencies": { "@yarnpkg/libzip": "^2.2.4", "tslib": "^1.13.0" @@ -4185,37 +4185,42 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.1.tgz", - "integrity": "sha512-FiPG+9TuMIga3t+kkalQytwqMtJu1djI+Pq+Ut2tvAJpcNHDJ0PYdjFv5mgEvTEJLujrYwjWHVkNe+XfHPBD/w==", + "version": "8.1.0-next.5", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.5.tgz", + "integrity": "sha512-9l9lB8gXW1kPECKLC5Goc41pFztSCfODY3dvGaNTJ0KfRgwKIUyIhEBSdlWT2IU4uL4Tcl/zcitpb+Lj6QP7aQ==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.1.tgz", - "integrity": "sha512-u14Rk4JgXI+7iS6AEXI2pNc1dWh/5JEXtaqa4TeBECKJlN+5242mbGBBPaHMOE7sSI1Kh66XhEMZJhPYjUfjHw==", + "version": "8.1.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.4.tgz", + "integrity": "sha512-W+sdV5sgOTgE1bmEBdCrCpjfYIwD7f0ykwoPOTkvaNFdsgbMIvq4VZLjGMVnFR7U2tPa/w0Kn7lXodlSJudNmQ==", "dependencies": { - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-languageserver-protocol": "3.17.3-next.4" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.3-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.1.tgz", - "integrity": "sha512-vgjvPE0zox+1Fi4ljsSFJ+B3g8wGNbuAEEdulueVdv+R2VHtc06+dgxhWiG4LKPqXwjPDmiuxCnvd2xk3fzTTw==", + "version": "3.17.3-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.4.tgz", + "integrity": "sha512-G6XrjZGSe2LIo7uDa860JKX97sLKc1vQF4AU4SW8DI7NNVKxnCB+vEs8gYHmle7kD9v13PvFkDCBD5ApeONGNQ==", "dependencies": { - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageserver-types": "3.17.2" + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageserver-types": "3.17.3-next.1" } }, + "node_modules/vscode-languageserver-protocol/node_modules/vscode-languageserver-types": { + "version": "3.17.3-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.1.tgz", + "integrity": "sha512-i7HXZs5CdNibVHXZORZw9m5Bm0mfXiGhD/tZv6f7arBtz4iatgiiHu2qInxn0fKeahhMJoBbp6irhsL9+E3UAA==" + }, "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz", + "integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==" }, "node_modules/vscode-languageserver-types": { "version": "3.17.2", @@ -4223,9 +4228,9 @@ "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" }, "node_modules/vscode-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.6.tgz", - "integrity": "sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" }, "node_modules/w3c-hr-time": { "version": "1.0.2", @@ -5246,9 +5251,9 @@ "dev": true }, "@yarnpkg/fslib": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.9.0.tgz", - "integrity": "sha512-PIdwI2z1HFl6aUkketbgUJK3FGRVWVwH1vgHltNe+snJzjlKHMavyIR0fipkAJuHVcac+hzWI1/eMr90rVyMHw==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.10.0.tgz", + "integrity": "sha512-eHqvrVlzlhd4owKoLsMRaL4wTGer+r9BXi95u1omHYcAcEQbKnHH3PqYf3j7nxsc8apa09WyA1XNCiiIniFXLg==", "requires": { "@yarnpkg/libzip": "^2.2.4", "tslib": "^1.13.0" @@ -7597,31 +7602,38 @@ } }, "vscode-jsonrpc": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.1.tgz", - "integrity": "sha512-FiPG+9TuMIga3t+kkalQytwqMtJu1djI+Pq+Ut2tvAJpcNHDJ0PYdjFv5mgEvTEJLujrYwjWHVkNe+XfHPBD/w==" + "version": "8.1.0-next.5", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.5.tgz", + "integrity": "sha512-9l9lB8gXW1kPECKLC5Goc41pFztSCfODY3dvGaNTJ0KfRgwKIUyIhEBSdlWT2IU4uL4Tcl/zcitpb+Lj6QP7aQ==" }, "vscode-languageserver": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.1.tgz", - "integrity": "sha512-u14Rk4JgXI+7iS6AEXI2pNc1dWh/5JEXtaqa4TeBECKJlN+5242mbGBBPaHMOE7sSI1Kh66XhEMZJhPYjUfjHw==", + "version": "8.1.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.4.tgz", + "integrity": "sha512-W+sdV5sgOTgE1bmEBdCrCpjfYIwD7f0ykwoPOTkvaNFdsgbMIvq4VZLjGMVnFR7U2tPa/w0Kn7lXodlSJudNmQ==", "requires": { - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-languageserver-protocol": "3.17.3-next.4" } }, "vscode-languageserver-protocol": { - "version": "3.17.3-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.1.tgz", - "integrity": "sha512-vgjvPE0zox+1Fi4ljsSFJ+B3g8wGNbuAEEdulueVdv+R2VHtc06+dgxhWiG4LKPqXwjPDmiuxCnvd2xk3fzTTw==", + "version": "3.17.3-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.4.tgz", + "integrity": "sha512-G6XrjZGSe2LIo7uDa860JKX97sLKc1vQF4AU4SW8DI7NNVKxnCB+vEs8gYHmle7kD9v13PvFkDCBD5ApeONGNQ==", "requires": { - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageserver-types": "3.17.2" + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageserver-types": "3.17.3-next.1" + }, + "dependencies": { + "vscode-languageserver-types": { + "version": "3.17.3-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.1.tgz", + "integrity": "sha512-i7HXZs5CdNibVHXZORZw9m5Bm0mfXiGhD/tZv6f7arBtz4iatgiiHu2qInxn0fKeahhMJoBbp6irhsL9+E3UAA==" + } } }, "vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz", + "integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==" }, "vscode-languageserver-types": { "version": "3.17.2", @@ -7629,9 +7641,9 @@ "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" }, "vscode-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.6.tgz", - "integrity": "sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" }, "w3c-hr-time": { "version": "1.0.2", diff --git a/packages/pyright-internal/package.json b/packages/pyright-internal/package.json index 539463b5671d..2907f9c3b723 100644 --- a/packages/pyright-internal/package.json +++ b/packages/pyright-internal/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@iarna/toml": "2.2.5", - "@yarnpkg/fslib": "2.9.0", + "@yarnpkg/fslib": "2.10.0", "@yarnpkg/libzip": "2.2.4", "chalk": "^4.1.2", "chokidar": "^3.5.3", @@ -26,11 +26,11 @@ "source-map-support": "^0.5.21", "tmp": "^0.2.1", "typescript-char": "^0.0.0", - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageserver": "8.1.0-next.1", - "vscode-languageserver-textdocument": "^1.0.7", + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageserver": "8.1.0-next.4", + "vscode-languageserver-textdocument": "^1.0.8", "vscode-languageserver-types": "3.17.2", - "vscode-uri": "^3.0.6" + "vscode-uri": "^3.0.7" }, "devDependencies": { "@types/command-line-args": "^5.2.0", diff --git a/packages/pyright-internal/src/analyzer/importResolver.ts b/packages/pyright-internal/src/analyzer/importResolver.ts index e30deba92b72..119999803537 100644 --- a/packages/pyright-internal/src/analyzer/importResolver.ts +++ b/packages/pyright-internal/src/analyzer/importResolver.ts @@ -368,9 +368,9 @@ export class ImportResolver { sourceFilePath: string, execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor - ): Set { + ): Map { const importFailureInfo: string[] = []; - const suggestions = new Set(); + const suggestions = new Map(); // Is it a relative import? if (moduleDescriptor.leadingDots > 0) { @@ -707,6 +707,11 @@ export class ImportResolver { return this._getStdlibTypeshedPath(execEnv, unused); } + getTypeshedThirdPartyPath(execEnv: ExecutionEnvironment) { + const unused: string[] = []; + return this._getThirdPartyTypeshedPath(execEnv, unused); + } + isStdlibModule(module: ImportedModuleDescriptor, execEnv: ExecutionEnvironment): boolean { if (!this._stdlibModules) { this._stdlibModules = this._buildStdlibCache(this.getTypeshedStdLibPath(execEnv)); @@ -1693,7 +1698,7 @@ export class ImportResolver { execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor, isStdLib: boolean, - suggestions: Set + suggestions: Map ) { const importFailureInfo: string[] = []; @@ -2015,7 +2020,7 @@ export class ImportResolver { sourceFilePath: string, execEnv: ExecutionEnvironment, moduleDescriptor: ImportedModuleDescriptor, - suggestions: Set + suggestions: Map ) { // Determine which search path this file is part of. const directory = getDirectoryLeadingDotsPointsTo( @@ -2050,7 +2055,7 @@ export class ImportResolver { execEnv: ExecutionEnvironment, rootPath: string, moduleDescriptor: ImportedModuleDescriptor, - suggestions: Set, + suggestions: Map, strictOnly = true ) { // Starting at the specified path, walk the file system to find the @@ -2112,7 +2117,7 @@ export class ImportResolver { execEnv: ExecutionEnvironment, currentPath: string, filter: string, - suggestions: Set, + suggestions: Map, leadingDots: number, parentNameParts: string[], strictOnly: boolean @@ -2153,7 +2158,7 @@ export class ImportResolver { return; } - suggestions.add(fileWithoutExtension); + suggestions.set(fileWithoutExtension, combinePaths(currentPath, file)); } }); @@ -2169,7 +2174,20 @@ export class ImportResolver { return; } - suggestions.add(dir); + const initPyiPath = combinePaths(currentPath, dir, '__init__.pyi'); + if (this.fileExistsCached(initPyiPath)) { + suggestions.set(dir, initPyiPath); + return; + } + + const initPyPath = combinePaths(currentPath, dir, '__init__.py'); + if (this.fileExistsCached(initPyPath)) { + suggestions.set(dir, initPyPath); + return; + } + + // It is a namespace package. there is no corresponding module path. + suggestions.set(dir, ''); }); } @@ -2202,7 +2220,7 @@ export class ImportResolver { return this._resolveImport(sourceFilePath, execEnv, moduleDescriptor).isImportFound; } - private _isUniqueValidSuggestion(suggestionToAdd: string, suggestions: Set) { + private _isUniqueValidSuggestion(suggestionToAdd: string, suggestions: Map) { if (suggestions.has(suggestionToAdd)) { return false; } diff --git a/packages/pyright-internal/src/analyzer/program.ts b/packages/pyright-internal/src/analyzer/program.ts index 92c705da6047..783b4a002c1f 100644 --- a/packages/pyright-internal/src/analyzer/program.ts +++ b/packages/pyright-internal/src/analyzer/program.ts @@ -835,29 +835,7 @@ export class Program { let shadowFileInfo = this.getSourceFileInfo(shadowImplPath); if (!shadowFileInfo) { - const importName = this._getImportNameForFile(shadowImplPath); - const sourceFile = new SourceFile( - this._fs, - shadowImplPath, - importName, - /* isThirdPartyImport */ false, - /* isInPyTypedPackage */ false, - this._console, - this._logTracker - ); - shadowFileInfo = { - sourceFile, - isTracked: false, - isOpenByClient: false, - isTypeshedFile: false, - isThirdPartyImport: false, - isThirdPartyPyTypedPresent: false, - diagnosticsVersion: undefined, - imports: [], - importedBy: [], - shadows: [], - shadowedBy: [], - }; + shadowFileInfo = this._createIntrimFileInfo(shadowImplPath); this._addToSourceFileListAndMap(shadowFileInfo); } @@ -872,6 +850,34 @@ export class Program { return shadowFileInfo.sourceFile; } + private _createIntrimFileInfo(filePath: string) { + const importName = this._getImportNameForFile(filePath); + const sourceFile = new SourceFile( + this._fs, + filePath, + importName, + /* isThirdPartyImport */ false, + /* isInPyTypedPackage */ false, + this._console, + this._logTracker + ); + const sourceFileInfo = { + sourceFile, + isTracked: false, + isOpenByClient: false, + isTypeshedFile: false, + isThirdPartyImport: false, + isThirdPartyPyTypedPresent: false, + diagnosticsVersion: undefined, + imports: [], + importedBy: [], + shadows: [], + shadowedBy: [], + }; + + return sourceFileInfo; + } + private _createNewEvaluator() { if (this._evaluator) { // We shouldn't need to call this, but there appears to be a bug @@ -2588,15 +2594,34 @@ export class Program { execEnv, this._evaluator!, (stubFilePath: string, implFilePath: string) => { - const stubFileInfo = this.getSourceFileInfo(stubFilePath); + let stubFileInfo = this.getSourceFileInfo(stubFilePath); if (!stubFileInfo) { - return undefined; + // Special case for import statement. + // ex) import X.Y + // SourceFile for X might not be in memory since import `X.Y` only brings in Y + stubFileInfo = this._createIntrimFileInfo(stubFilePath); + this._addToSourceFileListAndMap(stubFileInfo); } + this._addShadowedFile(stubFileInfo, implFilePath); return this.getBoundSourceFile(implFilePath); }, - (f) => this.getBoundSourceFileInfo(f), - (f) => this.getSourceFileInfo(f), + (f) => { + let fileInfo = this.getBoundSourceFileInfo(f); + if (!fileInfo) { + // Special case for import statement. + // ex) import X.Y + // SourceFile for X might not be in memory since import `X.Y` only brings in Y + fileInfo = this._createIntrimFileInfo(f); + this._addToSourceFileListAndMap(fileInfo); + + // Even though this file is not referenced by anything, make sure + // we have parse tree for doc string. + fileInfo.sourceFile.parse(this._configOptions, this._importResolver); + } + + return fileInfo; + }, mapCompiled ?? false, preferStubs ?? false, from, diff --git a/packages/pyright-internal/src/analyzer/regions.ts b/packages/pyright-internal/src/analyzer/regions.ts index 795ed716a96d..69f161995ba5 100644 --- a/packages/pyright-internal/src/analyzer/regions.ts +++ b/packages/pyright-internal/src/analyzer/regions.ts @@ -39,6 +39,9 @@ export function getRegionComments(parseResults: ParseResults): RegionComment[] { return comments; } +const StartRegionRegx = /^\s*region(\s*)(.*)$/; +const EndRegionRegex = /^\s*endregion(\s*)(.*)$/; + function getRegionCommentType(comment: Comment, parseResults: ParseResults): RegionCommentType | undefined { const hashOffset = comment.start - 1; const hashPosition = convertOffsetToPosition(hashOffset, parseResults.tokenizerOutput.lines); @@ -53,11 +56,19 @@ function getRegionCommentType(comment: Comment, parseResults: ParseResults): Reg } } - const trimmedValue = comment.value.trimStart(); - if (trimmedValue.startsWith('region')) { - return RegionCommentType.Region; - } else if (trimmedValue.startsWith('endregion')) { - return RegionCommentType.EndRegion; + const startRegionMatch = StartRegionRegx.exec(comment.value); + const endRegionMatch = EndRegionRegex.exec(comment.value); + + // If the # region is followed by a space or has nothing after it, it's treated as a region. + // Whereas, # regionfoo should not be a region. + if (startRegionMatch && startRegionMatch.length > 2) { + return startRegionMatch[1].length > 0 || (startRegionMatch[1].length === 0 && startRegionMatch[2].length === 0) + ? RegionCommentType.Region + : undefined; + } else if (endRegionMatch && endRegionMatch.length > 2) { + return endRegionMatch[1].length > 0 || (endRegionMatch[1].length === 0 && endRegionMatch[2].length === 0) + ? RegionCommentType.EndRegion + : undefined; } else { return undefined; } diff --git a/packages/pyright-internal/src/analyzer/sourceMapper.ts b/packages/pyright-internal/src/analyzer/sourceMapper.ts index 8135ed44bb13..c15c1328215f 100644 --- a/packages/pyright-internal/src/analyzer/sourceMapper.ts +++ b/packages/pyright-internal/src/analyzer/sourceMapper.ts @@ -53,7 +53,6 @@ export class SourceMapper { private _evaluator: TypeEvaluator, private _fileBinder: ShadowFileBinder, private _boundSourceGetter: BoundSourceGetter, - private _sourceGetter: BoundSourceGetter, private _mapCompiled: boolean, private _preferStubs: boolean, private _fromFile: SourceFileInfo | undefined, @@ -61,8 +60,18 @@ export class SourceMapper { ) {} findModules(stubFilePath: string): ModuleNode[] { - const sourceFiles = this._getBoundSourceFilesFromStubFile(stubFilePath); - return sourceFiles.map((sf) => sf.getParseResults()?.parseTree).filter(isDefined); + const sourceFiles = this._isStubThatShouldBeMappedToImplementation(stubFilePath) + ? this._getBoundSourceFilesFromStubFile(stubFilePath) + : [this._boundSourceGetter(stubFilePath)?.sourceFile]; + + return sourceFiles + .filter(isDefined) + .map((sf) => sf.getParseResults()?.parseTree) + .filter(isDefined); + } + + getModuleNode(filePath: string): ModuleNode | undefined { + return this._boundSourceGetter(filePath)?.sourceFile.getParseResults()?.parseTree; } findDeclarations(stubDecl: Declaration): Declaration[] { @@ -94,7 +103,7 @@ export class SourceMapper { } isUserCode(path: string): boolean { - return isUserCode(this._sourceGetter(path)); + return isUserCode(this._boundSourceGetter(path)); } getNextFileName(path: string) { diff --git a/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts b/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts index fafd48a84d0b..f894d2a0d293 100644 --- a/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts +++ b/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts @@ -32,6 +32,7 @@ import { Type, TypeCategory, } from '../analyzer/types'; +import { addIfNotNull } from '../common/collectionUtils'; import { ModuleNode, ParseNodeType } from '../parser/parseNodes'; import { TypeEvaluator } from './typeEvaluatorTypes'; import { @@ -179,7 +180,7 @@ export function getVariableInStubFileDocStrings(decl: VariableDeclaration, sourc return docStrings; } -export function getModuleNodeDocString(modules: ModuleNode[]): string | undefined { +export function getModuleDocStringFromModuleNodes(modules: ModuleNode[]): string | undefined { for (const module of modules) { if (module.statements) { const docString = ParseTreeUtils.getDocString(module.statements); @@ -192,6 +193,19 @@ export function getModuleNodeDocString(modules: ModuleNode[]): string | undefine return undefined; } +export function getModuleDocStringFromPaths(filePaths: string[], sourceMapper: SourceMapper) { + const modules: ModuleNode[] = []; + for (const filePath of filePaths) { + if (isStubFile(filePath)) { + addIfNotNull(modules, sourceMapper.getModuleNode(filePath)); + } + + modules.push(...sourceMapper.findModules(filePath)); + } + + return getModuleDocStringFromModuleNodes(modules); +} + export function getModuleDocString( type: ModuleType, resolvedDecl: DeclarationBase | undefined, @@ -199,10 +213,8 @@ export function getModuleDocString( ) { let docString = type.docString; if (!docString) { - if (resolvedDecl && isStubFile(resolvedDecl.path)) { - const modules = sourceMapper.findModules(resolvedDecl.path); - docString = getModuleNodeDocString(modules); - } + const filePath = resolvedDecl?.path ?? type.filePath; + docString = getModuleDocStringFromPaths([filePath], sourceMapper); } return docString; diff --git a/packages/pyright-internal/src/commands/quickActionCommand.ts b/packages/pyright-internal/src/commands/quickActionCommand.ts index 066f3bb28160..c28df1a7f025 100644 --- a/packages/pyright-internal/src/commands/quickActionCommand.ts +++ b/packages/pyright-internal/src/commands/quickActionCommand.ts @@ -8,7 +8,7 @@ import { CancellationToken, ExecuteCommandParams } from 'vscode-languageserver'; -import { convertTextEdits } from '../common/textEditUtils'; +import { convertEditActionsToWorkspaceEdit } from '../common/textEditUtils'; import { LanguageServerInterface } from '../languageServerBase'; import { ServerCommand } from './commandController'; import { Commands } from './commands'; @@ -34,7 +34,7 @@ export class QuickActionCommand implements ServerCommand { token ); - return convertTextEdits(docUri, editActions); + return convertEditActionsToWorkspaceEdit(docUri, editActions); } } } diff --git a/packages/pyright-internal/src/common/collectionUtils.ts b/packages/pyright-internal/src/common/collectionUtils.ts index ccb69f59cbe9..8b6bfd3bc4de 100644 --- a/packages/pyright-internal/src/common/collectionUtils.ts +++ b/packages/pyright-internal/src/common/collectionUtils.ts @@ -377,3 +377,12 @@ export function getMapValues(m: Map, predicate: (k: K, v: V) => bool return values; } + +export function addIfNotNull(arr: T[], t: T): T[] { + if (t === undefined) { + return arr; + } + + arr.push(t); + return arr; +} diff --git a/packages/pyright-internal/src/common/textEditUtils.ts b/packages/pyright-internal/src/common/textEditUtils.ts index a398d9cac179..3dc6fcb8f5fb 100644 --- a/packages/pyright-internal/src/common/textEditUtils.ts +++ b/packages/pyright-internal/src/common/textEditUtils.ts @@ -24,18 +24,22 @@ import { isString } from './core'; import { convertTextRangeToRange } from './positionUtils'; import { doRangesIntersect, extendRange, Range, rangesAreEqual, TextRange } from './textRange'; -export function convertTextEdits(uri: string, editActions: TextEditAction[] | undefined): WorkspaceEdit { +export function convertEditActionsToTextEdits(editActions: TextEditAction[]): TextEdit[] { + return editActions.map((editAction) => ({ + range: editAction.range, + newText: editAction.replacementText, + })); +} + +export function convertEditActionsToWorkspaceEdit( + uri: string, + editActions: TextEditAction[] | undefined +): WorkspaceEdit { if (!editActions) { return {}; } - const edits: TextEdit[] = []; - editActions.forEach((editAction) => { - edits.push({ - range: editAction.range, - newText: editAction.replacementText, - }); - }); + const edits = convertEditActionsToTextEdits(editActions); return { changes: { diff --git a/packages/pyright-internal/src/languageService/completionProvider.ts b/packages/pyright-internal/src/languageService/completionProvider.ts index 0d98d6d07831..28ca8834baea 100644 --- a/packages/pyright-internal/src/languageService/completionProvider.ts +++ b/packages/pyright-internal/src/languageService/completionProvider.ts @@ -41,6 +41,7 @@ import { Symbol, SymbolTable } from '../analyzer/symbol'; import * as SymbolNameUtils from '../analyzer/symbolNameUtils'; import { getLastTypedDeclaredForSymbol, isVisibleExternally } from '../analyzer/symbolUtils'; import { getTypedDictMembersForClass } from '../analyzer/typedDicts'; +import { getModuleDocStringFromPaths } from '../analyzer/typeDocStringUtils'; import { CallSignatureInfo, TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { printLiteralValue } from '../analyzer/typePrinter'; import { @@ -58,6 +59,7 @@ import { isUnknown, Type, TypeBase, + TypeCategory, UnknownType, } from '../analyzer/types'; import { @@ -82,6 +84,7 @@ import { fromLSPAny, toLSPAny } from '../common/lspUtils'; import { convertOffsetToPosition, convertPositionToOffset } from '../common/positionUtils'; import { PythonVersion } from '../common/pythonVersion'; import * as StringUtils from '../common/stringUtils'; +import { convertEditActionsToTextEdits } from '../common/textEditUtils'; import { comparePositions, Position } from '../common/textRange'; import { TextRange } from '../common/textRange'; import { TextRangeCollection } from '../common/textRangeCollection'; @@ -224,6 +227,7 @@ export interface CompletionItemData { autoImportText?: string; symbolLabel?: string; funcParensDisabled?: boolean; + modulePath?: string; } // MemberAccessInfo attempts to gather info for unknown types @@ -319,6 +323,7 @@ interface CompletionDetail extends CommonDetail { }; sortText?: string; itemDetail?: string; + modulePath?: string; } export const autoImportDetail = 'Auto-import'; @@ -610,26 +615,49 @@ export class CompletionProvider { CompletionProvider._mostRecentCompletions.pop(); } - if (completionItemData.symbolLabel) { - this._itemToResolve = completionItem; + if (!completionItemData.symbolLabel) { + return; + } - if (!completionItemData.autoImportText) { - // Rerun the completion lookup. It will fill in additional information - // about the item to be resolved. We'll ignore the rest of the returned - // list. This is a bit wasteful, but all of that information should be - // cached, so it's not as bad as it might seem. - this.getCompletionsForPosition(); - } else if (!completionItem.additionalTextEdits) { - const completionMap = new CompletionMap(); - const completionResults = { completionMap }; + if (completionItemData.modulePath) { + const documentation = getModuleDocStringFromPaths([completionItemData.modulePath], this._sourceMapper); + if (!documentation) { + return; + } - this._addAutoImportCompletions( - completionItemData.symbolLabel, - /* similarityLimit */ 1, - /* lazyEdit */ false, - completionResults - ); + if (this._options.format === MarkupKind.Markdown) { + const markdownString = convertDocStringToMarkdown(documentation); + completionItem.documentation = { + kind: MarkupKind.Markdown, + value: markdownString, + }; + } else if (this._options.format === MarkupKind.PlainText) { + const plainTextString = convertDocStringToPlainText(documentation); + completionItem.documentation = { + kind: MarkupKind.PlainText, + value: plainTextString, + }; } + return; + } + + this._itemToResolve = completionItem; + if (!completionItemData.autoImportText) { + // Rerun the completion lookup. It will fill in additional information + // about the item to be resolved. We'll ignore the rest of the returned + // list. This is a bit wasteful, but all of that information should be + // cached, so it's not as bad as it might seem. + this.getCompletionsForPosition(); + } else if (!completionItem.additionalTextEdits) { + const completionMap = new CompletionMap(); + const completionResults = { completionMap }; + + this._addAutoImportCompletions( + completionItemData.symbolLabel, + /* similarityLimit */ 1, + /* lazyEdit */ false, + completionResults + ); } } @@ -2441,7 +2469,9 @@ export class CompletionProvider { // Add the implicit imports. importInfo.implicitImports.forEach((implImport) => { if (!importFromNode.imports.find((imp) => imp.name.value === implImport.name)) { - this._addNameToCompletions(implImport.name, CompletionItemKind.Module, priorWord, completionMap); + this._addNameToCompletions(implImport.name, CompletionItemKind.Module, priorWord, completionMap, { + modulePath: implImport.path, + }); } }); @@ -2606,165 +2636,108 @@ export class CompletionProvider { } } - if (primaryDecl) { - let itemKind: CompletionItemKind = CompletionItemKind.Variable; + primaryDecl = primaryDecl + ? this._evaluator.resolveAliasDeclaration(primaryDecl, /* resolveLocalNames */ true) ?? primaryDecl + : undefined; - primaryDecl = this._evaluator.resolveAliasDeclaration(primaryDecl, /* resolveLocalNames */ true); - if (primaryDecl) { - itemKind = this._convertDeclarationTypeToItemKind(primaryDecl); + const autoImportText = detail.autoImportSource + ? this._getAutoImportText(name, detail.autoImportSource, detail.autoImportAlias) + : undefined; + + // Are we resolving a completion item? If so, see if this symbol + // is the one that we're trying to match. + if (this._itemToResolve) { + const completionItemData = fromLSPAny(this._itemToResolve.data); + + if (completionItemData.symbolLabel !== name) { + // It's not what we are looking for. + return; + } - // Handle enum members specially. Enum members normally look like - // variables, but the are declared using assignment expressions - // within an enum class. + if (completionItemData.autoImportText) { if ( - primaryDecl.type === DeclarationType.Variable && - detail.boundObjectOrClass && - isInstantiableClass(detail.boundObjectOrClass) && - ClassType.isEnumClass(detail.boundObjectOrClass) && - primaryDecl.node.parent?.nodeType === ParseNodeType.Assignment + completionItemData.autoImportText === autoImportText?.importText && + detail.edits?.additionalTextEdits ) { - itemKind = CompletionItemKind.EnumMember; + this._itemToResolve.additionalTextEdits = convertEditActionsToTextEdits( + detail.edits.additionalTextEdits + ); } + return; + } - // Are we resolving a completion item? If so, see if this symbol - // is the one that we're trying to match. - if (this._itemToResolve) { - const completionItemData = fromLSPAny(this._itemToResolve.data); - - if (completionItemData.symbolLabel === name && !completionItemData.autoImportText) { - // This call can be expensive to perform on every completion item - // that we return, so we do it lazily in the "resolve" callback. - const type = this._evaluator.getEffectiveTypeOfSymbol(symbol); - if (type) { - let typeDetail: string | undefined; - let documentation: string | undefined; - - switch (primaryDecl.type) { - case DeclarationType.Intrinsic: - case DeclarationType.Variable: - case DeclarationType.Parameter: - case DeclarationType.TypeParameter: { - let expandTypeAlias = false; - if (type && TypeBase.isInstantiable(type)) { - const typeAliasInfo = getTypeAliasInfo(type); - if (typeAliasInfo) { - if (typeAliasInfo.name === name) { - expandTypeAlias = true; - } - } - } - typeDetail = name + ': ' + this._evaluator.printType(type, { expandTypeAlias }); - break; - } - - case DeclarationType.Function: { - const functionType = - detail.boundObjectOrClass && (isFunction(type) || isOverloadedFunction(type)) - ? this._evaluator.bindFunctionToClassOrObject( - detail.boundObjectOrClass, - type - ) - : type; - if (functionType) { - if ( - isProperty(functionType) && - detail.boundObjectOrClass && - isClassInstance(detail.boundObjectOrClass) - ) { - const propertyType = - this._evaluator.getGetterTypeFromProperty( - functionType as ClassType, - /* inferTypeIfNeeded */ true - ) || UnknownType.create(); - typeDetail = - name + ': ' + this._evaluator.printType(propertyType) + ' (property)'; - } else if (isOverloadedFunction(functionType)) { - // 35 is completion tooltip's default width size - typeDetail = getOverloadedFunctionTooltip( - functionType, - this._evaluator, - /* columnThreshold */ 35 - ); - } else if (isFunction(functionType)) { - typeDetail = name + this._evaluator.printType(functionType); - } else { - typeDetail = name + ': ' + this._evaluator.printType(functionType); - } - } - break; - } - - case DeclarationType.Class: - case DeclarationType.SpecialBuiltInClass: { - typeDetail = 'class ' + name + '()'; - break; - } - - case DeclarationType.Alias: { - typeDetail = name; - if (primaryDecl.path) { - const lookupResults = this._importLookup(primaryDecl.path); - if (lookupResults) { - documentation = lookupResults.docString; - } - } - break; - } - - default: { - typeDetail = name; - break; - } - } + // This call can be expensive to perform on every completion item + // that we return, so we do it lazily in the "resolve" callback. + const type = this._evaluator.getEffectiveTypeOfSymbol(symbol); + if (!type) { + // Can't resolve. so bail out. + return; + } - documentation = getDocumentationPartsForTypeAndDecl( - this._sourceMapper, - type, - primaryDecl, - this._evaluator, - symbol, - detail.boundObjectOrClass - ); - - if (this._options.format === MarkupKind.Markdown) { - let markdownString = '```python\n' + typeDetail + '\n```\n'; - - if (documentation) { - markdownString += '---\n'; - markdownString += convertDocStringToMarkdown(documentation); - } - - markdownString = markdownString.trimEnd(); - - this._itemToResolve.documentation = { - kind: MarkupKind.Markdown, - value: markdownString, - }; - } else if (this._options.format === MarkupKind.PlainText) { - let plainTextString = typeDetail + '\n'; - - if (documentation) { - plainTextString += '\n'; - plainTextString += convertDocStringToPlainText(documentation); - } - - plainTextString = plainTextString.trimEnd(); - - this._itemToResolve.documentation = { - kind: MarkupKind.PlainText, - value: plainTextString, - }; - } else { - fail(`Unsupported markup type: ${this._options.format}`); - } - } - } + const typeDetail = this._getTypeDetail(primaryDecl, type, name, detail); + const documentation = getDocumentationPartsForTypeAndDecl( + this._sourceMapper, + type, + primaryDecl, + this._evaluator, + { + name, + symbol, + boundObjectOrClass: detail.boundObjectOrClass, + } + ); + + if (this._options.format === MarkupKind.Markdown) { + let markdownString = '```python\n' + typeDetail + '\n```\n'; + + if (documentation) { + markdownString += '---\n'; + markdownString += convertDocStringToMarkdown(documentation); + } + + markdownString = markdownString.trimEnd(); + + this._itemToResolve.documentation = { + kind: MarkupKind.Markdown, + value: markdownString, + }; + } else if (this._options.format === MarkupKind.PlainText) { + let plainTextString = typeDetail + '\n'; + + if (documentation) { + plainTextString += '\n'; + plainTextString += convertDocStringToPlainText(documentation); } + + plainTextString = plainTextString.trimEnd(); + + this._itemToResolve.documentation = { + kind: MarkupKind.PlainText, + value: plainTextString, + }; + } else { + fail(`Unsupported markup type: ${this._options.format}`); } - const autoImportText = detail.autoImportSource - ? this._getAutoImportText(name, detail.autoImportSource, detail.autoImportAlias) - : undefined; + // Bail out. We don't need to add items to completion. + return; + } + + if (primaryDecl) { + let itemKind = this._convertDeclarationTypeToItemKind(primaryDecl); + + // Handle enum members specially. Enum members normally look like + // variables, but the are declared using assignment expressions + // within an enum class. + if ( + primaryDecl.type === DeclarationType.Variable && + detail.boundObjectOrClass && + isInstantiableClass(detail.boundObjectOrClass) && + ClassType.isEnumClass(detail.boundObjectOrClass) && + primaryDecl.node.parent?.nodeType === ParseNodeType.Assignment + ) { + itemKind = CompletionItemKind.EnumMember; + } this._addNameToCompletions(detail.autoImportAlias ?? name, itemKind, priorWord, completionMap, { autoImportText, @@ -2776,7 +2749,7 @@ export class CompletionProvider { // Does the symbol have no declaration but instead has a synthesized type? const synthesizedType = symbol.getSynthesizedType(); if (synthesizedType) { - const itemKind: CompletionItemKind = CompletionItemKind.Variable; + const itemKind: CompletionItemKind = this._convertTypeToItemKind(synthesizedType); this._addNameToCompletions(name, itemKind, priorWord, completionMap, { extraCommitChars: detail.extraCommitChars, funcParensDisabled: detail.funcParensDisabled, @@ -2786,6 +2759,86 @@ export class CompletionProvider { } } + private _getTypeDetail(primaryDecl: Declaration | undefined, type: Type, name: string, detail: SymbolDetail) { + if (!primaryDecl) { + if (isModule(type)) { + // Special casing import modules. + // submodule imported through `import` statement doesn't have + // corresponding decls. so use given name as it is. + // + // ex) import X.Y + // X.[Y] + return name; + } + + return; + } + + switch (primaryDecl.type) { + case DeclarationType.Intrinsic: + case DeclarationType.Variable: + case DeclarationType.Parameter: + case DeclarationType.TypeParameter: { + let expandTypeAlias = false; + if (type && TypeBase.isInstantiable(type)) { + const typeAliasInfo = getTypeAliasInfo(type); + if (typeAliasInfo) { + if (typeAliasInfo.name === name) { + expandTypeAlias = true; + } + } + } + + return name + ': ' + this._evaluator.printType(type, { expandTypeAlias }); + } + + case DeclarationType.Function: { + const functionType = + detail.boundObjectOrClass && (isFunction(type) || isOverloadedFunction(type)) + ? this._evaluator.bindFunctionToClassOrObject(detail.boundObjectOrClass, type) + : type; + if (!functionType) { + return undefined; + } + + if ( + isProperty(functionType) && + detail.boundObjectOrClass && + isClassInstance(detail.boundObjectOrClass) + ) { + const propertyType = + this._evaluator.getGetterTypeFromProperty( + functionType as ClassType, + /* inferTypeIfNeeded */ true + ) || UnknownType.create(); + return name + ': ' + this._evaluator.printType(propertyType) + ' (property)'; + } + + if (isOverloadedFunction(functionType)) { + // 35 is completion tooltip's default width size + return getOverloadedFunctionTooltip(functionType, this._evaluator, /* columnThreshold */ 35); + } else if (isFunction(functionType)) { + return name + this._evaluator.printType(functionType); + } else { + return name + ': ' + this._evaluator.printType(functionType); + } + } + + case DeclarationType.Class: + case DeclarationType.SpecialBuiltInClass: { + return 'class ' + name + '()'; + } + + case DeclarationType.Alias: { + return name; + } + + default: { + return name; + } + } + } + private _getAutoImportText(importName: string, importFrom?: string, importAlias?: string) { const autoImportText = getAutoImportText(importName, importFrom, importAlias); @@ -2840,6 +2893,10 @@ export class CompletionProvider { completionItemData.funcParensDisabled = true; } + if (detail?.modulePath) { + completionItemData.modulePath = detail.modulePath; + } + completionItem.data = toLSPAny(completionItemData); if (detail?.sortText || detail?.itemDetail) { @@ -2943,17 +3000,9 @@ export class CompletionProvider { } if (detail?.edits?.additionalTextEdits) { - completionItem.additionalTextEdits = detail.edits.additionalTextEdits.map((te) => { - const textEdit: TextEdit = { - range: { - start: { line: te.range.start.line, character: te.range.start.character }, - end: { line: te.range.end.line, character: te.range.end.character }, - }, - newText: te.replacementText, - }; - return textEdit; - }); + completionItem.additionalTextEdits = convertEditActionsToTextEdits(detail.edits.additionalTextEdits); + // This is for auto import entries from indices which skip symbols. if (this._itemToResolve) { const data = fromLSPAny(this._itemToResolve.data); if (data.autoImportText === completionItemData.autoImportText) { @@ -3060,6 +3109,27 @@ export class CompletionProvider { } } + private _convertTypeToItemKind(type: Type): CompletionItemKind { + switch (type.category) { + case TypeCategory.Module: + return CompletionItemKind.Module; + case TypeCategory.Class: + return CompletionItemKind.Class; + case TypeCategory.Function: + case TypeCategory.OverloadedFunction: + if (isProperty(type)) { + return CompletionItemKind.Property; + } + + return CompletionItemKind.Function; + case TypeCategory.TypeVar: + return CompletionItemKind.TypeParameter; + + default: + return CompletionItemKind.Variable; + } + } + private _getImportModuleCompletions(node: ModuleNameNode): CompletionResults { const moduleDescriptor: ImportedModuleDescriptor = { leadingDots: node.leadingDots, @@ -3091,15 +3161,11 @@ export class CompletionProvider { completionMap.set(completionItem); } - completions.forEach((completionName) => { - if (completionMap.has(completionName)) { - return; - } - - const completionItem = CompletionItem.create(completionName); - completionItem.kind = CompletionItemKind.Module; - completionItem.sortText = this._makeSortText(SortCategory.ImportModuleName, completionName); - completionMap.set(completionItem); + completions.forEach((modulePath, completionName) => { + this._addNameToCompletions(completionName, CompletionItemKind.Module, '', completionMap, { + sortText: this._makeSortText(SortCategory.ImportModuleName, completionName), + modulePath, + }); }); return { completionMap }; diff --git a/packages/pyright-internal/src/languageService/hoverProvider.ts b/packages/pyright-internal/src/languageService/hoverProvider.ts index fdce356fa969..b8731ae8bab7 100644 --- a/packages/pyright-internal/src/languageService/hoverProvider.ts +++ b/packages/pyright-internal/src/languageService/hoverProvider.ts @@ -15,7 +15,6 @@ import { Declaration, DeclarationType } from '../analyzer/declaration'; import { convertDocStringToMarkdown, convertDocStringToPlainText } from '../analyzer/docStringConversion'; import * as ParseTreeUtils from '../analyzer/parseTreeUtils'; import { SourceMapper } from '../analyzer/sourceMapper'; -import { getModuleNodeDocString } from '../analyzer/typeDocStringUtils'; import { TypeEvaluator } from '../analyzer/typeEvaluatorTypes'; import { ClassType, @@ -117,7 +116,7 @@ export class HoverProvider { if (results.parts.length === 0) { const type = evaluator.getType(node) || UnknownType.create(); - let typeText = ''; + let typeText: string; if (isModule(type)) { // Handle modules specially because submodules aren't associated with // declarations, but we want them to be presented in the same way as @@ -300,7 +299,9 @@ export class HoverProvider { } case DeclarationType.Alias: { - this._addModuleParts(format, sourceMapper, parts, node.value, [resolvedDecl.path]); + // First the 'module' header. + this._addResultsPart(parts, '(module) ' + node.value, /* python */ true); + this._addDocumentationPart(format, sourceMapper, parts, node, evaluator, resolvedDecl); break; } @@ -494,40 +495,19 @@ export class HoverProvider { resolvedDecl: Declaration | undefined ) { const type = evaluator.getType(node); - if (type) { - this._addDocumentationPartForType(format, sourceMapper, parts, type, resolvedDecl, evaluator); - } - } - - private static _addModuleParts( - format: MarkupKind, - sourceMapper: SourceMapper, - parts: HoverTextPart[], - name: string, - resolvedPaths: string[] - ) { - // First the 'module' header. - this._addResultsPart(parts, '(module) ' + name, /* python */ true); - - // Parse the modules files and try to find the doc string. - const modules = resolvedPaths.map((p) => sourceMapper.findModules(p)).flat(); - const docString = getModuleNodeDocString(modules); - if (docString) { - this._addDocumentationResultsPart(format, parts, docString); - return true; - } - return false; + this._addDocumentationPartForType(format, sourceMapper, parts, type, resolvedDecl, evaluator, node.value); } private static _addDocumentationPartForType( format: MarkupKind, sourceMapper: SourceMapper, parts: HoverTextPart[], - type: Type, + type: Type | undefined, resolvedDecl: Declaration | undefined, - evaluator: TypeEvaluator + evaluator: TypeEvaluator, + name?: string ): boolean { - const docString = getDocumentationPartsForTypeAndDecl(sourceMapper, type, resolvedDecl, evaluator); + const docString = getDocumentationPartsForTypeAndDecl(sourceMapper, type, resolvedDecl, evaluator, { name }); if (docString) { this._addDocumentationResultsPart(format, parts, docString); return true; diff --git a/packages/pyright-internal/src/languageService/indentationUtils.ts b/packages/pyright-internal/src/languageService/indentationUtils.ts index 644becd56d98..c9f17b3d5338 100644 --- a/packages/pyright-internal/src/languageService/indentationUtils.ts +++ b/packages/pyright-internal/src/languageService/indentationUtils.ts @@ -174,7 +174,7 @@ function _getIndentation( } const suiteSpan = convertTextRangeToRange(suite, parseResults.tokenizerOutput.lines); - if (preferDedent || suiteSpan.start.line === suiteSpan.end.line) { + if (preferDedent || (suiteSpan.start.line === suiteSpan.end.line && suite.statements.length > 0)) { // Go one more level up. const outerContainer = getContainer(suite, /*includeSelf*/ false); return _getIndentationForNode(parseResults, offset, outerContainer ?? parseResults.parseTree, suite); diff --git a/packages/pyright-internal/src/languageService/tooltipUtils.ts b/packages/pyright-internal/src/languageService/tooltipUtils.ts index bbda32b8f73c..d929030700e8 100644 --- a/packages/pyright-internal/src/languageService/tooltipUtils.ts +++ b/packages/pyright-internal/src/languageService/tooltipUtils.ts @@ -16,6 +16,7 @@ import { getClassDocString, getFunctionDocStringInherited, getModuleDocString, + getModuleDocStringFromPaths, getOverloadedFunctionDocStringsInherited, getPropertyDocStringInherited, getVariableDocString, @@ -32,6 +33,7 @@ import { Type, } from '../analyzer/types'; import { isDefined } from '../common/core'; +import { ParseNodeType } from '../parser/parseNodes'; // 70 is vscode's default hover width size. export function getOverloadedFunctionTooltip( @@ -91,7 +93,7 @@ export function getOverloadedFunctionDocStringsFromType( ); } -function getDocumentationPartForAlias( +function getDocumentationPartForTypeAlias( sourceMapper: SourceMapper, resolvedDecl: Declaration | undefined, evaluator: TypeEvaluator, @@ -160,17 +162,48 @@ function getDocumentationPartForType( export function getDocumentationPartsForTypeAndDecl( sourceMapper: SourceMapper, - type: Type, + type: Type | undefined, resolvedDecl: Declaration | undefined, evaluator: TypeEvaluator, - symbol?: Symbol, - boundObjectOrClass?: ClassType | undefined + optional?: { + name?: string; + symbol?: Symbol; + boundObjectOrClass?: ClassType | undefined; + } ): string | undefined { // Get the alias first - const aliasDoc = getDocumentationPartForAlias(sourceMapper, resolvedDecl, evaluator, symbol); + const aliasDoc = getDocumentationPartForTypeAlias(sourceMapper, resolvedDecl, evaluator, optional?.symbol); // Combine this with the type doc - const typeDoc = getDocumentationPartForType(sourceMapper, type, resolvedDecl, evaluator, boundObjectOrClass); + let typeDoc: string | undefined; + if (resolvedDecl?.type === DeclarationType.Alias) { + // Handle another alias decl special case. + // ex) import X.Y + // [X].Y + // Asking decl for X gives us "X.Y" rather than "X" since "X" is not actually a symbol. + // We need to get corresponding module name to use special code in type eval for this case. + if ( + resolvedDecl.type === DeclarationType.Alias && + resolvedDecl.node && + resolvedDecl.node.nodeType === ParseNodeType.ImportAs && + !!optional?.name && + !resolvedDecl.node.alias + ) { + const name = resolvedDecl.node.module.nameParts.find((n) => n.value === optional.name); + if (name) { + const aliasDecls = evaluator.getDeclarationsForNameNode(name) ?? [resolvedDecl]; + resolvedDecl = aliasDecls.length > 0 ? aliasDecls[0] : resolvedDecl; + } + } + + typeDoc = getModuleDocStringFromPaths([resolvedDecl.path], sourceMapper); + } + + typeDoc = + typeDoc ?? + (type + ? getDocumentationPartForType(sourceMapper, type, resolvedDecl, evaluator, optional?.boundObjectOrClass) + : undefined); // Combine with a new line if they both exist return aliasDoc && typeDoc ? `${aliasDoc}\n\n${typeDoc}` : aliasDoc || typeDoc; diff --git a/packages/pyright-internal/src/tests/completions.test.ts b/packages/pyright-internal/src/tests/completions.test.ts new file mode 100644 index 000000000000..28b121c56ee2 --- /dev/null +++ b/packages/pyright-internal/src/tests/completions.test.ts @@ -0,0 +1,360 @@ +/* + * completions.test.ts + * + * completions tests. + */ + +import { CompletionItemKind, MarkupKind } from 'vscode-languageserver-types'; + +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('completion import statement tooltip', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion import statement tooltip - stub file', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker*/m|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion import statement tooltip - doc in stub file', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker*/m|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/__init__.py +// @library: true +//// # empty + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion import statement tooltip - sub modules', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.[|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: 'pyplot', + }, + ], + }, + }); +}); + +test('completion import reference tooltip', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib +//// [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: '```python\nmatplotlib\n```\n---\nmatplotlib', + }, + ], + }, + }); +}); + +test('completion import reference tooltip - first module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: '```python\nmatplotlib\n```\n---\nmatplotlib', + }, + ], + }, + }); +}); + +test('completion import reference tooltip - child module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// matplotlib.[|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: '```python\npyplot\n```\n---\npyplot', + }, + ], + }, + }); +}); + +test('completion from import statement tooltip - first module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from [|/*marker*/m|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'matplotlib', + documentation: 'matplotlib', + }, + ], + }, + }); +}); + +test('completion from import statement tooltip - child module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from matplotlib.[|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: 'pyplot', + }, + ], + }, + }); +}); + +test('completion from import statement tooltip - implicit module', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from matplotlib import [|/*marker*/p|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + await state.verifyCompletion('included', MarkupKind.Markdown, { + marker: { + completions: [ + { + kind: CompletionItemKind.Module, + label: 'pyplot', + documentation: 'pyplot', + }, + ], + }, + }); +}); diff --git a/packages/pyright-internal/src/tests/filesystem.test.ts b/packages/pyright-internal/src/tests/filesystem.test.ts index f096f9143788..8961631cc701 100644 --- a/packages/pyright-internal/src/tests/filesystem.test.ts +++ b/packages/pyright-internal/src/tests/filesystem.test.ts @@ -41,6 +41,21 @@ test('Folders', () => { }); }); +test('Folders Recursive', () => { + const cwd = normalizeSlashes('/'); + const fs = new vfs.TestFileSystem(/*ignoreCase*/ true, { cwd }); + + // no such dir exist + assert.throws(() => { + fs.chdir('a'); + }); + + const path = combinePaths('/', 'a', 'b', 'c'); + fs.mkdirSync(path, { recursive: true }); + + assert(fs.existsSync(path)); +}); + test('Files', () => { const cwd = normalizeSlashes('/'); const fs = new vfs.TestFileSystem(/*ignoreCase*/ true, { cwd }); diff --git a/packages/pyright-internal/src/tests/harness/fourslash/testState.ts b/packages/pyright-internal/src/tests/harness/fourslash/testState.ts index 14d467753180..fb2c99f65b44 100644 --- a/packages/pyright-internal/src/tests/harness/fourslash/testState.ts +++ b/packages/pyright-internal/src/tests/harness/fourslash/testState.ts @@ -990,7 +990,7 @@ export class TestState { this.verifyCompletionItem(expected, actual); if (expected.documentation !== undefined) { - if (actual.documentation === undefined) { + if (actual.documentation === undefined && actual.data) { this.workspace.serviceInstance.resolveCompletionItem( filePath, actual, diff --git a/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts b/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts index e0ab82708fb9..e7fc6188af7a 100644 --- a/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts +++ b/packages/pyright-internal/src/tests/harness/vfs/filesystem.ts @@ -10,7 +10,13 @@ import { Dirent, ReadStream, WriteStream } from 'fs'; import { URI } from 'vscode-uri'; -import { FileSystem, FileWatcher, FileWatcherEventHandler, TmpfileOptions } from '../../../common/fileSystem'; +import { + FileSystem, + FileWatcher, + FileWatcherEventHandler, + MkDirOptions, + TmpfileOptions, +} from '../../../common/fileSystem'; import * as pathUtil from '../../../common/pathUtils'; import { bufferFrom, createIOError } from '../utils'; import { closeIterator, getIterator, Metadata, nextResult, SortedMap } from './../utils'; @@ -614,11 +620,16 @@ export class TestFileSystem implements FileSystem { * * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module. */ - mkdirSync(path: string) { + mkdirSync(path: string, options?: MkDirOptions) { if (this.isReadonly) { throw createIOError('EROFS'); } + if (options?.recursive) { + this.mkdirpSync(path); + return; + } + this._mkdir(this._walk(this._resolve(path), /*noFollow*/ true)); } diff --git a/packages/pyright-internal/src/tests/hoverProvider.test.ts b/packages/pyright-internal/src/tests/hoverProvider.test.ts new file mode 100644 index 000000000000..b9b53bdb1b19 --- /dev/null +++ b/packages/pyright-internal/src/tests/hoverProvider.test.ts @@ -0,0 +1,269 @@ +/* + * hoverProvider.test.ts + * + * hoverProvider tests. + */ + +import { parseAndGetTestState } from './harness/fourslash/testState'; + +test('import tooltip - import statement', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import reference', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import statement with stubs', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/pyplot.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import reference - stub files', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import matplotlib.pyplot +//// [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/pyplot.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - import submodules statement', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import A.B.[|/*marker*/C|] + +// @filename: A/__init__.py +// @library: true +//// # empty + +// @filename: A/B/__init__.py +// @library: true +//// # empty + +// @filename: A/B/C/__init__.py +// @library: true +//// """ C """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { marker: '```python\n(module) C\n```\n---\nC' }); +}); + +test('import tooltip - import submodules reference', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// import A.B.C +//// A.B.[|/*marker*/C|] + +// @filename: A/__init__.py +// @library: true +//// # empty + +// @filename: A/B/__init__.py +// @library: true +//// # empty + +// @filename: A/B/C/__init__.py +// @library: true +//// """ C """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { marker: '```python\n(module) C\n```\n---\nC' }); +}); + +test('import tooltip - from import statement with stubs', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from [|/*marker1*/matplotlib|].[|/*marker2*/pyplot|] import * + +// @filename: matplotlib/__init__.pyi +// @library: true +//// # empty + +// @filename: matplotlib/pyplot.pyi +// @library: true +//// # empty + +// @filename: matplotlib/__init__.py +// @library: true +//// """ matplotlib """ + +// @filename: matplotlib/pyplot.py +// @library: true +//// """ pyplot """ + `; + + const state = parseAndGetTestState(code).state; + const marker1 = state.getMarkerByName('marker1'); + state.openFile(marker1.fileName); + + state.verifyHover('markdown', { + marker1: '```python\n(module) matplotlib\n```\n---\nmatplotlib', + marker2: '```python\n(module) pyplot\n```\n---\npyplot', + }); +}); + +test('import tooltip - from import submodules statement', async () => { + const code = ` +// @filename: pyrightconfig.json +//// { +//// "useLibraryCodeForTypes": true +//// } + +// @filename: test.py +//// from A.B.[|/*marker*/C|] import * + +// @filename: A/__init__.py +// @library: true +//// # empty + +// @filename: A/B/__init__.py +// @library: true +//// # empty + +// @filename: A/B/C/__init__.py +// @library: true +//// """ C """ + `; + + const state = parseAndGetTestState(code).state; + const marker = state.getMarkerByName('marker'); + state.openFile(marker.fileName); + + state.verifyHover('markdown', { marker: '```python\n(module) C\n```\n---\nC' }); +}); diff --git a/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts b/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts index cb3ec0e408ad..544c192d2d6b 100644 --- a/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts +++ b/packages/pyright-internal/src/tests/indentationUtils.ptvs.test.ts @@ -26,7 +26,7 @@ test('top level statement - function', () => { //// [|/*marker*/|] `; - testIndentation(code, 0); + testIndentation(code, 4); }); test('function with open paren at end of file', () => { diff --git a/packages/pyright-internal/src/tests/indentationUtils.test.ts b/packages/pyright-internal/src/tests/indentationUtils.test.ts index cc83f87d60f1..c9121be1f4bb 100644 --- a/packages/pyright-internal/src/tests/indentationUtils.test.ts +++ b/packages/pyright-internal/src/tests/indentationUtils.test.ts @@ -45,7 +45,7 @@ test('first child indentation', () => { //// [|/*marker*/|] `; - testIndentation(code, 0); + testIndentation(code, 4); }); test('nested first child indentation', () => { @@ -55,7 +55,7 @@ test('nested first child indentation', () => { //// [|/*marker*/|] `; - testIndentation(code, 4); + testIndentation(code, 8); }); test('nested sibling indentation', () => { @@ -272,7 +272,7 @@ test('single line comment', () => { `; - testIndentation(code, 0); + testIndentation(code, 4); }); test('multiline string literals top', () => { @@ -442,7 +442,7 @@ test('unfinished block', () => { //// return 1 `; - testIndentation(code, 4); + testIndentation(code, 8); }); function testIndentation(code: string, indentation: number, preferDedent?: boolean) { diff --git a/packages/pyright-internal/src/workspaceMap.ts b/packages/pyright-internal/src/workspaceMap.ts index 4246cc66a19b..6615b39ff20c 100644 --- a/packages/pyright-internal/src/workspaceMap.ts +++ b/packages/pyright-internal/src/workspaceMap.ts @@ -77,9 +77,7 @@ export class WorkspaceMap extends Map { // Wait for all workspaces to be initialized before attempting to find the best workspace. Otherwise // the list of files won't be complete and the `contains` check might fail. - for (const workspace of this.values()) { - await workspace.isInitialized.promise; - } + await Promise.all([...this.values()].map((w) => w.isInitialized.promise)); // The order of how we find the best matching workspace for the given file is // 1. The given file is the workspace itself (ex, a file being a virtual workspace itself). diff --git a/packages/pyright/package-lock.json b/packages/pyright/package-lock.json index f54021abf24f..83a5d9e66cac 100644 --- a/packages/pyright/package-lock.json +++ b/packages/pyright/package-lock.json @@ -18,7 +18,7 @@ "copy-webpack-plugin": "^10.2.4", "esbuild-loader": "^2.20.0", "shx": "^0.3.4", - "ts-loader": "^9.4.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", "webpack": "^5.75.0", "webpack-cli": "^4.10.0" @@ -2242,9 +2242,9 @@ } }, "node_modules/ts-loader": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", - "integrity": "sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -4079,9 +4079,9 @@ } }, "ts-loader": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", - "integrity": "sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "requires": { "chalk": "^4.1.0", diff --git a/packages/pyright/package.json b/packages/pyright/package.json index 89cc834213f1..6b7a0cea043c 100644 --- a/packages/pyright/package.json +++ b/packages/pyright/package.json @@ -28,7 +28,7 @@ "copy-webpack-plugin": "^10.2.4", "esbuild-loader": "^2.20.0", "shx": "^0.3.4", - "ts-loader": "^9.4.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", "webpack": "^5.75.0", "webpack-cli": "^4.10.0" diff --git a/packages/vscode-pyright/package-lock.json b/packages/vscode-pyright/package-lock.json index feaae6a3a019..2eacad72be35 100644 --- a/packages/vscode-pyright/package-lock.json +++ b/packages/vscode-pyright/package-lock.json @@ -9,10 +9,10 @@ "version": "1.1.287", "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageclient": "8.1.0-next.1", - "vscode-languageserver": "8.1.0-next.1", - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageclient": "8.1.0-next.4", + "vscode-languageserver": "8.1.0-next.4", + "vscode-languageserver-protocol": "3.17.3-next.4" }, "devDependencies": { "@types/copy-webpack-plugin": "^10.1.0", @@ -21,7 +21,7 @@ "copy-webpack-plugin": "^10.2.4", "detect-indent": "^6.1.0", "shx": "^0.3.4", - "ts-loader": "^9.4.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", "vsce": "^2.7.0", "webpack": "^5.75.0", @@ -2819,9 +2819,9 @@ } }, "node_modules/ts-loader": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", - "integrity": "sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -3027,21 +3027,21 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.1.tgz", - "integrity": "sha512-FiPG+9TuMIga3t+kkalQytwqMtJu1djI+Pq+Ut2tvAJpcNHDJ0PYdjFv5mgEvTEJLujrYwjWHVkNe+XfHPBD/w==", + "version": "8.1.0-next.5", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.5.tgz", + "integrity": "sha512-9l9lB8gXW1kPECKLC5Goc41pFztSCfODY3dvGaNTJ0KfRgwKIUyIhEBSdlWT2IU4uL4Tcl/zcitpb+Lj6QP7aQ==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageclient": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0-next.1.tgz", - "integrity": "sha512-lJraJ8IrqXr83ZciAs4dN32f9kEPuOb/FqAeUTgnW5cAxo0Qux0/EMgKyU33Qf9LdEI0I9iwRVxQWtawbyUUfg==", + "version": "8.1.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0-next.4.tgz", + "integrity": "sha512-dwo3Vf1aAb3o62mDhLHRGqYaLAYWN5RXAbHKL85Cs+yCJghxYzseuGGBvOUOH3BF5scnCU2BFrghekyP1xCUmQ==", "dependencies": { "minimatch": "^5.1.0", "semver": "^7.3.7", - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-languageserver-protocol": "3.17.3-next.4" }, "engines": { "vscode": "^1.67.0" @@ -3067,29 +3067,29 @@ } }, "node_modules/vscode-languageserver": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.1.tgz", - "integrity": "sha512-u14Rk4JgXI+7iS6AEXI2pNc1dWh/5JEXtaqa4TeBECKJlN+5242mbGBBPaHMOE7sSI1Kh66XhEMZJhPYjUfjHw==", + "version": "8.1.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.4.tgz", + "integrity": "sha512-W+sdV5sgOTgE1bmEBdCrCpjfYIwD7f0ykwoPOTkvaNFdsgbMIvq4VZLjGMVnFR7U2tPa/w0Kn7lXodlSJudNmQ==", "dependencies": { - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-languageserver-protocol": "3.17.3-next.4" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.3-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.1.tgz", - "integrity": "sha512-vgjvPE0zox+1Fi4ljsSFJ+B3g8wGNbuAEEdulueVdv+R2VHtc06+dgxhWiG4LKPqXwjPDmiuxCnvd2xk3fzTTw==", + "version": "3.17.3-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.4.tgz", + "integrity": "sha512-G6XrjZGSe2LIo7uDa860JKX97sLKc1vQF4AU4SW8DI7NNVKxnCB+vEs8gYHmle7kD9v13PvFkDCBD5ApeONGNQ==", "dependencies": { - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageserver-types": "3.17.2" + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageserver-types": "3.17.3-next.1" } }, "node_modules/vscode-languageserver-types": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", - "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" + "version": "3.17.3-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.1.tgz", + "integrity": "sha512-i7HXZs5CdNibVHXZORZw9m5Bm0mfXiGhD/tZv6f7arBtz4iatgiiHu2qInxn0fKeahhMJoBbp6irhsL9+E3UAA==" }, "node_modules/watchpack": { "version": "2.4.0", @@ -5490,9 +5490,9 @@ } }, "ts-loader": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", - "integrity": "sha512-384TYAqGs70rn9F0VBnh6BPTfhga7yFNdC5gXbQpDrBj9/KsT4iRkGqKXhziofHOlE2j6YEaiTYVGKKvPhGWvw==", + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", + "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -5659,18 +5659,18 @@ } }, "vscode-jsonrpc": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.1.tgz", - "integrity": "sha512-FiPG+9TuMIga3t+kkalQytwqMtJu1djI+Pq+Ut2tvAJpcNHDJ0PYdjFv5mgEvTEJLujrYwjWHVkNe+XfHPBD/w==" + "version": "8.1.0-next.5", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.5.tgz", + "integrity": "sha512-9l9lB8gXW1kPECKLC5Goc41pFztSCfODY3dvGaNTJ0KfRgwKIUyIhEBSdlWT2IU4uL4Tcl/zcitpb+Lj6QP7aQ==" }, "vscode-languageclient": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0-next.1.tgz", - "integrity": "sha512-lJraJ8IrqXr83ZciAs4dN32f9kEPuOb/FqAeUTgnW5cAxo0Qux0/EMgKyU33Qf9LdEI0I9iwRVxQWtawbyUUfg==", + "version": "8.1.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0-next.4.tgz", + "integrity": "sha512-dwo3Vf1aAb3o62mDhLHRGqYaLAYWN5RXAbHKL85Cs+yCJghxYzseuGGBvOUOH3BF5scnCU2BFrghekyP1xCUmQ==", "requires": { "minimatch": "^5.1.0", "semver": "^7.3.7", - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-languageserver-protocol": "3.17.3-next.4" }, "dependencies": { "brace-expansion": { @@ -5692,26 +5692,26 @@ } }, "vscode-languageserver": { - "version": "8.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.1.tgz", - "integrity": "sha512-u14Rk4JgXI+7iS6AEXI2pNc1dWh/5JEXtaqa4TeBECKJlN+5242mbGBBPaHMOE7sSI1Kh66XhEMZJhPYjUfjHw==", + "version": "8.1.0-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0-next.4.tgz", + "integrity": "sha512-W+sdV5sgOTgE1bmEBdCrCpjfYIwD7f0ykwoPOTkvaNFdsgbMIvq4VZLjGMVnFR7U2tPa/w0Kn7lXodlSJudNmQ==", "requires": { - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-languageserver-protocol": "3.17.3-next.4" } }, "vscode-languageserver-protocol": { - "version": "3.17.3-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.1.tgz", - "integrity": "sha512-vgjvPE0zox+1Fi4ljsSFJ+B3g8wGNbuAEEdulueVdv+R2VHtc06+dgxhWiG4LKPqXwjPDmiuxCnvd2xk3fzTTw==", + "version": "3.17.3-next.4", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.4.tgz", + "integrity": "sha512-G6XrjZGSe2LIo7uDa860JKX97sLKc1vQF4AU4SW8DI7NNVKxnCB+vEs8gYHmle7kD9v13PvFkDCBD5ApeONGNQ==", "requires": { - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageserver-types": "3.17.2" + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageserver-types": "3.17.3-next.1" } }, "vscode-languageserver-types": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", - "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" + "version": "3.17.3-next.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.1.tgz", + "integrity": "sha512-i7HXZs5CdNibVHXZORZw9m5Bm0mfXiGhD/tZv6f7arBtz4iatgiiHu2qInxn0fKeahhMJoBbp6irhsL9+E3UAA==" }, "watchpack": { "version": "2.4.0", diff --git a/packages/vscode-pyright/package.json b/packages/vscode-pyright/package.json index 8b004b351a74..61504e1c7be2 100644 --- a/packages/vscode-pyright/package.json +++ b/packages/vscode-pyright/package.json @@ -929,10 +929,10 @@ "webpack-dev": "npm run clean && webpack --mode development --watch --progress" }, "dependencies": { - "vscode-jsonrpc": "8.1.0-next.1", - "vscode-languageclient": "8.1.0-next.1", - "vscode-languageserver": "8.1.0-next.1", - "vscode-languageserver-protocol": "3.17.3-next.1" + "vscode-jsonrpc": "8.1.0-next.5", + "vscode-languageclient": "8.1.0-next.4", + "vscode-languageserver": "8.1.0-next.4", + "vscode-languageserver-protocol": "3.17.3-next.4" }, "devDependencies": { "@types/copy-webpack-plugin": "^10.1.0", @@ -941,7 +941,7 @@ "copy-webpack-plugin": "^10.2.4", "detect-indent": "^6.1.0", "shx": "^0.3.4", - "ts-loader": "^9.4.1", + "ts-loader": "^9.4.2", "typescript": "~4.4.4", "vsce": "^2.7.0", "webpack": "^5.75.0",