mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-05 12:27:30 +03:00
Push pylance changes to pyright (#7719)
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com> Co-authored-by: HeeJae Chang <hechang@microsoft.com> Co-authored-by: Erik De Bonte <erikd@microsoft.com> Co-authored-by: Rich Chiodo <rchiodo@microsoft.com> Co-authored-by: Stella Huang <stellahuang@microsoft.com> Co-authored-by: Kacie Kang <jikang@microsoft.com>
This commit is contained in:
parent
cc3467fda4
commit
fc1b547130
84
package-lock.json
generated
84
package-lock.json
generated
@ -13,7 +13,6 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||||
"@typescript-eslint/parser": "^6.21.0",
|
"@typescript-eslint/parser": "^6.21.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"detect-indent": "^6.1.0",
|
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-prettier": "^8.10.0",
|
"eslint-config-prettier": "^8.10.0",
|
||||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||||
@ -21,7 +20,6 @@
|
|||||||
"jsonc-parser": "^3.2.1",
|
"jsonc-parser": "^3.2.1",
|
||||||
"lerna": "^7.4.2",
|
"lerna": "^7.4.2",
|
||||||
"npm-check-updates": "^16.14.14",
|
"npm-check-updates": "^16.14.14",
|
||||||
"nx": "^17.3.2",
|
|
||||||
"p-queue": "^6.6.2",
|
"p-queue": "^6.6.2",
|
||||||
"prettier": "2.8.8",
|
"prettier": "2.8.8",
|
||||||
"syncpack": "~10.9.3",
|
"syncpack": "~10.9.3",
|
||||||
@ -1128,6 +1126,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-17.3.2.tgz",
|
||||||
"integrity": "sha512-5uvpSmij0J9tteFV/0M/024K+H/o3XAlqtSdU8j03Auj1IleclSLF2yCTuIo7pYXhG3cgx1+nR+3nMs1QVAdUA==",
|
"integrity": "sha512-5uvpSmij0J9tteFV/0M/024K+H/o3XAlqtSdU8j03Auj1IleclSLF2yCTuIo7pYXhG3cgx1+nR+3nMs1QVAdUA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nx": "17.3.2",
|
"nx": "17.3.2",
|
||||||
"tslib": "^2.3.0"
|
"tslib": "^2.3.0"
|
||||||
@ -1175,6 +1174,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1191,6 +1191,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1207,6 +1208,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"freebsd"
|
"freebsd"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1223,6 +1225,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1239,6 +1242,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1255,6 +1259,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1271,6 +1276,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1287,6 +1293,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1303,6 +1310,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -1319,6 +1327,7 @@
|
|||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
@ -3240,14 +3249,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/detect-indent": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/diff-sequences": {
|
"node_modules/diff-sequences": {
|
||||||
"version": "29.4.3",
|
"version": "29.4.3",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
@ -7192,6 +7193,7 @@
|
|||||||
"integrity": "sha512-QjF1gnwKebQISvATrSbW7dsmIcLbA0fcyDyxLo5wVHx/MIlcaIb/lLYaPTld73ZZ6svHEZ6n2gOkhMitmkIPQA==",
|
"integrity": "sha512-QjF1gnwKebQISvATrSbW7dsmIcLbA0fcyDyxLo5wVHx/MIlcaIb/lLYaPTld73ZZ6svHEZ6n2gOkhMitmkIPQA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nrwl/tao": "17.3.2",
|
"@nrwl/tao": "17.3.2",
|
||||||
"@yarnpkg/lockfile": "^1.1.0",
|
"@yarnpkg/lockfile": "^1.1.0",
|
||||||
@ -7262,6 +7264,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^1.0.0"
|
"balanced-match": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -7271,6 +7274,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||||
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"string-width": "^4.2.0",
|
"string-width": "^4.2.0",
|
||||||
"strip-ansi": "^6.0.1",
|
"strip-ansi": "^6.0.1",
|
||||||
@ -7284,12 +7288,14 @@
|
|||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||||
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/nx/node_modules/lines-and-columns": {
|
"node_modules/nx/node_modules/lines-and-columns": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||||
}
|
}
|
||||||
@ -7299,6 +7305,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
|
||||||
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
|
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^2.0.1"
|
"brace-expansion": "^2.0.1"
|
||||||
},
|
},
|
||||||
@ -7314,6 +7321,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz",
|
||||||
"integrity": "sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==",
|
"integrity": "sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bl": "^4.0.3",
|
"bl": "^4.0.3",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
@ -7335,6 +7343,7 @@
|
|||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"rimraf": "^3.0.0"
|
"rimraf": "^3.0.0"
|
||||||
},
|
},
|
||||||
@ -7346,6 +7355,7 @@
|
|||||||
"version": "17.7.2",
|
"version": "17.7.2",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cliui": "^8.0.1",
|
"cliui": "^8.0.1",
|
||||||
"escalade": "^3.1.1",
|
"escalade": "^3.1.1",
|
||||||
@ -7363,6 +7373,7 @@
|
|||||||
"version": "21.1.1",
|
"version": "21.1.1",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
@ -11133,6 +11144,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-17.3.2.tgz",
|
||||||
"integrity": "sha512-5uvpSmij0J9tteFV/0M/024K+H/o3XAlqtSdU8j03Auj1IleclSLF2yCTuIo7pYXhG3cgx1+nR+3nMs1QVAdUA==",
|
"integrity": "sha512-5uvpSmij0J9tteFV/0M/024K+H/o3XAlqtSdU8j03Auj1IleclSLF2yCTuIo7pYXhG3cgx1+nR+3nMs1QVAdUA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"nx": "17.3.2",
|
"nx": "17.3.2",
|
||||||
"tslib": "^2.3.0"
|
"tslib": "^2.3.0"
|
||||||
@ -11164,70 +11176,80 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-17.3.2.tgz",
|
||||||
"integrity": "sha512-hn12o/tt26Pf4wG+8rIBgNIEZq5BFlHLv3scNrgKbd5SancHlTbY4RveRGct737UQ/78GCMCgMDRgNdagbCr6w==",
|
"integrity": "sha512-hn12o/tt26Pf4wG+8rIBgNIEZq5BFlHLv3scNrgKbd5SancHlTbY4RveRGct737UQ/78GCMCgMDRgNdagbCr6w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-darwin-x64": {
|
"@nx/nx-darwin-x64": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-17.3.2.tgz",
|
||||||
"integrity": "sha512-5F28wrfE7yU60MzEXGjndy1sPJmNMIaV2W/g82kTXzxAbGHgSjwrGFmrJsrexzLp9oDlWkbc6YmInKV8gmmIaQ==",
|
"integrity": "sha512-5F28wrfE7yU60MzEXGjndy1sPJmNMIaV2W/g82kTXzxAbGHgSjwrGFmrJsrexzLp9oDlWkbc6YmInKV8gmmIaQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-freebsd-x64": {
|
"@nx/nx-freebsd-x64": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-17.3.2.tgz",
|
||||||
"integrity": "sha512-07MMTfsJooONqL1Vrm5L6qk/gzmSrYLazjkiTmJz+9mrAM61RdfSYfO3mSyAoyfgWuQ5yEvfI56P036mK8aoPg==",
|
"integrity": "sha512-07MMTfsJooONqL1Vrm5L6qk/gzmSrYLazjkiTmJz+9mrAM61RdfSYfO3mSyAoyfgWuQ5yEvfI56P036mK8aoPg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-linux-arm-gnueabihf": {
|
"@nx/nx-linux-arm-gnueabihf": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-17.3.2.tgz",
|
||||||
"integrity": "sha512-gQxMF6U/h18Rz+FZu50DZCtfOdk27hHghNh3d3YTeVsrJTd1SmUQbYublmwU/ia1HhFS8RVI8GvkaKt5ph0HoA==",
|
"integrity": "sha512-gQxMF6U/h18Rz+FZu50DZCtfOdk27hHghNh3d3YTeVsrJTd1SmUQbYublmwU/ia1HhFS8RVI8GvkaKt5ph0HoA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-linux-arm64-gnu": {
|
"@nx/nx-linux-arm64-gnu": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-17.3.2.tgz",
|
||||||
"integrity": "sha512-X20wiXtXmKlC01bpVEREsRls1uVOM22xDTpqILvVty6+P+ytEYFR3Vs5EjDtzBKF51wjrwf03rEoToZbmgM8MA==",
|
"integrity": "sha512-X20wiXtXmKlC01bpVEREsRls1uVOM22xDTpqILvVty6+P+ytEYFR3Vs5EjDtzBKF51wjrwf03rEoToZbmgM8MA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-linux-arm64-musl": {
|
"@nx/nx-linux-arm64-musl": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-17.3.2.tgz",
|
||||||
"integrity": "sha512-yko3Xsezkn4tjeudZYLjxFl07X/YB84K+DLK7EFyh9elRWV/8VjFcQmBAKUS2r9LfaEMNXq8/vhWMOWYyWBrIA==",
|
"integrity": "sha512-yko3Xsezkn4tjeudZYLjxFl07X/YB84K+DLK7EFyh9elRWV/8VjFcQmBAKUS2r9LfaEMNXq8/vhWMOWYyWBrIA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-linux-x64-gnu": {
|
"@nx/nx-linux-x64-gnu": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-17.3.2.tgz",
|
||||||
"integrity": "sha512-RiPvvQMmlZmDu9HdT6n6sV0+fEkyAqR5VocrD5ZAzEzFIlh4dyVLripFR3+MD+QhIhXyPt/hpri1kq9sgs4wnw==",
|
"integrity": "sha512-RiPvvQMmlZmDu9HdT6n6sV0+fEkyAqR5VocrD5ZAzEzFIlh4dyVLripFR3+MD+QhIhXyPt/hpri1kq9sgs4wnw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-linux-x64-musl": {
|
"@nx/nx-linux-x64-musl": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-17.3.2.tgz",
|
||||||
"integrity": "sha512-PWfVGmFsFJi+N1Nljg/jTKLHdufpGuHlxyfHqhDso/o4Qc0exZKSeZ1C63WkD7eTcT5kInifTQ/PffLiIDE3MA==",
|
"integrity": "sha512-PWfVGmFsFJi+N1Nljg/jTKLHdufpGuHlxyfHqhDso/o4Qc0exZKSeZ1C63WkD7eTcT5kInifTQ/PffLiIDE3MA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-win32-arm64-msvc": {
|
"@nx/nx-win32-arm64-msvc": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-17.3.2.tgz",
|
||||||
"integrity": "sha512-O+4FFPbQz1mqaIj+SVE02ppe7T9ELj7Z5soQct5TbRRhwjGaw5n5xaPPBW7jUuQe2L5htid1E82LJyq3JpVc8A==",
|
"integrity": "sha512-O+4FFPbQz1mqaIj+SVE02ppe7T9ELj7Z5soQct5TbRRhwjGaw5n5xaPPBW7jUuQe2L5htid1E82LJyq3JpVc8A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@nx/nx-win32-x64-msvc": {
|
"@nx/nx-win32-x64-msvc": {
|
||||||
"version": "17.3.2",
|
"version": "17.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-17.3.2.tgz",
|
||||||
"integrity": "sha512-4hQm+7coy+hBqGY9J709hz/tUPijhf/WS7eML2r2xBmqBew3PMHfeZuaAAYWN690nIsu0WX3wyDsNjulR8HGPQ==",
|
"integrity": "sha512-4hQm+7coy+hBqGY9J709hz/tUPijhf/WS7eML2r2xBmqBew3PMHfeZuaAAYWN690nIsu0WX3wyDsNjulR8HGPQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"@octokit/auth-token": {
|
"@octokit/auth-token": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
@ -12448,10 +12470,6 @@
|
|||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"detect-indent": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"diff-sequences": {
|
"diff-sequences": {
|
||||||
"version": "29.4.3",
|
"version": "29.4.3",
|
||||||
"dev": true
|
"dev": true
|
||||||
@ -15048,6 +15066,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/nx/-/nx-17.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/nx/-/nx-17.3.2.tgz",
|
||||||
"integrity": "sha512-QjF1gnwKebQISvATrSbW7dsmIcLbA0fcyDyxLo5wVHx/MIlcaIb/lLYaPTld73ZZ6svHEZ6n2gOkhMitmkIPQA==",
|
"integrity": "sha512-QjF1gnwKebQISvATrSbW7dsmIcLbA0fcyDyxLo5wVHx/MIlcaIb/lLYaPTld73ZZ6svHEZ6n2gOkhMitmkIPQA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@nrwl/tao": "17.3.2",
|
"@nrwl/tao": "17.3.2",
|
||||||
"@nx/nx-darwin-arm64": "17.3.2",
|
"@nx/nx-darwin-arm64": "17.3.2",
|
||||||
@ -15100,6 +15119,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0"
|
"balanced-match": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -15109,6 +15129,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||||
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"string-width": "^4.2.0",
|
"string-width": "^4.2.0",
|
||||||
"strip-ansi": "^6.0.1",
|
"strip-ansi": "^6.0.1",
|
||||||
@ -15119,17 +15140,20 @@
|
|||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||||
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"lines-and-columns": {
|
"lines-and-columns": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "9.0.3",
|
"version": "9.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
|
||||||
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
|
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^2.0.1"
|
"brace-expansion": "^2.0.1"
|
||||||
}
|
}
|
||||||
@ -15139,6 +15163,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz",
|
||||||
"integrity": "sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==",
|
"integrity": "sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"bl": "^4.0.3",
|
"bl": "^4.0.3",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
@ -15153,6 +15178,7 @@
|
|||||||
"tmp": {
|
"tmp": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"rimraf": "^3.0.0"
|
"rimraf": "^3.0.0"
|
||||||
}
|
}
|
||||||
@ -15160,6 +15186,7 @@
|
|||||||
"yargs": {
|
"yargs": {
|
||||||
"version": "17.7.2",
|
"version": "17.7.2",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"cliui": "^8.0.1",
|
"cliui": "^8.0.1",
|
||||||
"escalade": "^3.1.1",
|
"escalade": "^3.1.1",
|
||||||
@ -15172,7 +15199,8 @@
|
|||||||
},
|
},
|
||||||
"yargs-parser": {
|
"yargs-parser": {
|
||||||
"version": "21.1.1",
|
"version": "21.1.1",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"peer": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||||
"@typescript-eslint/parser": "^6.21.0",
|
"@typescript-eslint/parser": "^6.21.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"detect-indent": "^6.1.0",
|
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-prettier": "^8.10.0",
|
"eslint-config-prettier": "^8.10.0",
|
||||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||||
@ -35,7 +34,6 @@
|
|||||||
"jsonc-parser": "^3.2.1",
|
"jsonc-parser": "^3.2.1",
|
||||||
"lerna": "^7.4.2",
|
"lerna": "^7.4.2",
|
||||||
"npm-check-updates": "^16.14.14",
|
"npm-check-updates": "^16.14.14",
|
||||||
"nx": "^17.3.2",
|
|
||||||
"p-queue": "^6.6.2",
|
"p-queue": "^6.6.2",
|
||||||
"prettier": "2.8.8",
|
"prettier": "2.8.8",
|
||||||
"syncpack": "~10.9.3",
|
"syncpack": "~10.9.3",
|
||||||
|
@ -53,7 +53,6 @@ import { ImportResolver, ImportResolverFactory, createImportedModuleDescriptor }
|
|||||||
import { MaxAnalysisTime, Program } from './program';
|
import { MaxAnalysisTime, Program } from './program';
|
||||||
import { findPythonSearchPaths } from './pythonPathUtils';
|
import { findPythonSearchPaths } from './pythonPathUtils';
|
||||||
import { IPythonMode } from './sourceFile';
|
import { IPythonMode } from './sourceFile';
|
||||||
import { TypeEvaluator } from './typeEvaluatorTypes';
|
|
||||||
|
|
||||||
export const configFileNames = ['pyrightconfig.json'];
|
export const configFileNames = ['pyrightconfig.json'];
|
||||||
export const pyprojectTomlName = 'pyproject.toml';
|
export const pyprojectTomlName = 'pyproject.toml';
|
||||||
@ -368,10 +367,6 @@ export class AnalyzerService {
|
|||||||
return this._program.getTextOnRange(fileUri, range, token);
|
return this._program.getTextOnRange(fileUri, range, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEvaluator(): TypeEvaluator | undefined {
|
|
||||||
return this._program.evaluator;
|
|
||||||
}
|
|
||||||
|
|
||||||
run<T>(callback: (p: ProgramView) => T, token: CancellationToken): T {
|
run<T>(callback: (p: ProgramView) => T, token: CancellationToken): T {
|
||||||
return this._program.run(callback, token);
|
return this._program.run(callback, token);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import { CacheManager } from './analyzer/cacheManager';
|
|||||||
import { OperationCanceledException, setCancellationFolderName } from './common/cancellationUtils';
|
import { OperationCanceledException, setCancellationFolderName } from './common/cancellationUtils';
|
||||||
import { ConfigOptions } from './common/configOptions';
|
import { ConfigOptions } from './common/configOptions';
|
||||||
import { ConsoleInterface, LogLevel } from './common/console';
|
import { ConsoleInterface, LogLevel } from './common/console';
|
||||||
import { isThenable } from './common/core';
|
import { Disposable, isThenable } from './common/core';
|
||||||
import * as debug from './common/debug';
|
import * as debug from './common/debug';
|
||||||
import { PythonVersion } from './common/pythonVersion';
|
import { PythonVersion } from './common/pythonVersion';
|
||||||
import { createFromRealFileSystem, RealTempFile } from './common/realFileSystem';
|
import { createFromRealFileSystem, RealTempFile } from './common/realFileSystem';
|
||||||
@ -101,7 +101,11 @@ export class BackgroundThreadBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected handleShutdown() {
|
protected handleShutdown() {
|
||||||
this._serviceProvider.tryGet(ServiceKeys.tempFile)?.dispose();
|
const tempFile = this._serviceProvider.tryGet(ServiceKeys.tempFile);
|
||||||
|
if (Disposable.is(tempFile)) {
|
||||||
|
tempFile.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
parentPort?.close();
|
parentPort?.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ import {
|
|||||||
import { ParseFileResults } from '../parser/parser';
|
import { ParseFileResults } from '../parser/parser';
|
||||||
import { KeywordType, NewLineType, OperatorType, StringTokenFlags, Token, TokenType } from '../parser/tokenizerTypes';
|
import { KeywordType, NewLineType, OperatorType, StringTokenFlags, Token, TokenType } from '../parser/tokenizerTypes';
|
||||||
import { ServerCommand } from './commandController';
|
import { ServerCommand } from './commandController';
|
||||||
|
import { Workspace } from '../workspaceFactory';
|
||||||
|
|
||||||
export class DumpFileDebugInfoCommand implements ServerCommand {
|
export class DumpFileDebugInfoCommand implements ServerCommand {
|
||||||
constructor(private _ls: LanguageServerInterface) {}
|
constructor(private _ls: LanguageServerInterface) {}
|
||||||
@ -134,9 +135,17 @@ export class DumpFileDebugInfoCommand implements ServerCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fileUri = Uri.parse(params.arguments[0] as string, this._ls.serviceProvider);
|
const fileUri = Uri.parse(params.arguments[0] as string, this._ls.serviceProvider);
|
||||||
const kind = params.arguments[1];
|
|
||||||
|
|
||||||
const workspace = await this._ls.getWorkspaceForFile(fileUri);
|
const workspace = await this._ls.getWorkspaceForFile(fileUri);
|
||||||
|
|
||||||
|
return new DumpFileDebugInfo().dump(workspace, fileUri, params.arguments, token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DumpFileDebugInfo {
|
||||||
|
dump(workspace: Workspace, fileUri: Uri, args: any[], token: CancellationToken) {
|
||||||
|
return workspace.service.run((p) => {
|
||||||
|
const kind = args[1];
|
||||||
|
|
||||||
const parseResults = workspace.service.getParseResults(workspace.service.fs.realCasePath(fileUri));
|
const parseResults = workspace.service.getParseResults(workspace.service.fs.realCasePath(fileUri));
|
||||||
if (!parseResults) {
|
if (!parseResults) {
|
||||||
return [];
|
return [];
|
||||||
@ -182,9 +191,9 @@ export class DumpFileDebugInfoCommand implements ServerCommand {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'types': {
|
case 'types': {
|
||||||
const evaluator = workspace.service.getEvaluator();
|
const evaluator = p.evaluator;
|
||||||
const start = params.arguments[2] as number;
|
const start = args[2] as number;
|
||||||
const end = params.arguments[3] as number;
|
const end = args[3] as number;
|
||||||
if (!evaluator || !start || !end) {
|
if (!evaluator || !start || !end) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -194,21 +203,23 @@ export class DumpFileDebugInfoCommand implements ServerCommand {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'cachedtypes': {
|
case 'cachedtypes': {
|
||||||
const evaluator = workspace.service.getEvaluator();
|
const evaluator = p.evaluator;
|
||||||
const start = params.arguments[2] as number;
|
const start = args[2] as number;
|
||||||
const end = params.arguments[3] as number;
|
const end = args[3] as number;
|
||||||
if (!evaluator || !start || !end) {
|
if (!evaluator || !start || !end) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
collectingConsole.info(`* Cached Type info`);
|
collectingConsole.info(`* Cached Type info`);
|
||||||
collectingConsole.info(`${getTypeEvaluatorString(fileUri, evaluator, parseResults, start, end, true)}`);
|
collectingConsole.info(
|
||||||
|
`${getTypeEvaluatorString(fileUri, evaluator, parseResults, start, end, true)}`
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'codeflowgraph': {
|
case 'codeflowgraph': {
|
||||||
const evaluator = workspace.service.getEvaluator();
|
const evaluator = p.evaluator;
|
||||||
const offset = params.arguments[2] as number;
|
const offset = args[2] as number;
|
||||||
if (!evaluator || offset === undefined) {
|
if (!evaluator || offset === undefined) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -226,7 +237,9 @@ export class DumpFileDebugInfoCommand implements ServerCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print all of the output in one message so the trace log is smaller.
|
// Print all of the output in one message so the trace log is smaller.
|
||||||
this._ls.console.info(output.join('\n'));
|
workspace.service.serviceProvider.console().info(output.join('\n'));
|
||||||
|
return [];
|
||||||
|
}, token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,3 +183,9 @@ export function containsOnlyWhitespace(text: string, span?: TextRange) {
|
|||||||
|
|
||||||
return /^\s*$/.test(text);
|
return /^\s*$/.test(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export namespace Disposable {
|
||||||
|
export function is(value: any): value is { dispose(): void } {
|
||||||
|
return value && typeof value.dispose === 'function';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -85,7 +85,6 @@ export interface TempFile {
|
|||||||
// The directory returned by tmpdir must exist and be the same each time tmpdir is called.
|
// The directory returned by tmpdir must exist and be the same each time tmpdir is called.
|
||||||
tmpdir(): Uri;
|
tmpdir(): Uri;
|
||||||
tmpfile(options?: TmpfileOptions): Uri;
|
tmpfile(options?: TmpfileOptions): Uri;
|
||||||
dispose(): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace FileSystem {
|
export namespace FileSystem {
|
||||||
@ -96,7 +95,7 @@ export namespace FileSystem {
|
|||||||
|
|
||||||
export namespace TempFile {
|
export namespace TempFile {
|
||||||
export function is(value: any): value is TempFile {
|
export function is(value: any): value is TempFile {
|
||||||
return value.tmpdir && value.tmpfile && value.dispose;
|
return value.tmpdir && value.tmpfile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,9 @@ class YarnFS extends PosixFS {
|
|||||||
|
|
||||||
const yarnFS = new YarnFS();
|
const yarnFS = new YarnFS();
|
||||||
|
|
||||||
class RealFileSystem implements FileSystem {
|
// Use `createFromRealFileSystem` instead of `new RealFileSystem`
|
||||||
|
// unless you are creating a new file system that inherits from `RealFileSystem`
|
||||||
|
export class RealFileSystem implements FileSystem {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _caseSensitiveDectector: CaseSensitivityDetector,
|
private readonly _caseSensitiveDectector: CaseSensitivityDetector,
|
||||||
private readonly _console: ConsoleInterface,
|
private readonly _console: ConsoleInterface,
|
||||||
|
@ -489,7 +489,7 @@ test('resolve alias of not needed file', () => {
|
|||||||
const state = parseAndGetTestState(code).state;
|
const state = parseAndGetTestState(code).state;
|
||||||
const marker = state.getMarkerByName('marker')!;
|
const marker = state.getMarkerByName('marker')!;
|
||||||
|
|
||||||
const evaluator = state.workspace.service.getEvaluator()!;
|
const evaluator = state.workspace.service.test_program.evaluator!;
|
||||||
state.openFile(marker.fileName);
|
state.openFile(marker.fileName);
|
||||||
|
|
||||||
const markerUri = marker.fileUri;
|
const markerUri = marker.fileUri;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
//@ts-check
|
//@ts-check
|
||||||
|
|
||||||
const { promises: fsAsync } = require('fs');
|
const { promises: fsAsync } = require('fs');
|
||||||
const detectIndent = require('detect-indent');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} filepath
|
* @param {string} filepath
|
||||||
@ -10,12 +9,12 @@ const detectIndent = require('detect-indent');
|
|||||||
*/
|
*/
|
||||||
async function modifyJsonInPlace(filepath, modifier) {
|
async function modifyJsonInPlace(filepath, modifier) {
|
||||||
const input = await fsAsync.readFile(filepath, 'utf-8');
|
const input = await fsAsync.readFile(filepath, 'utf-8');
|
||||||
const indent = detectIndent(input);
|
|
||||||
const obj = JSON.parse(input);
|
const obj = JSON.parse(input);
|
||||||
|
|
||||||
modifier(obj);
|
modifier(obj);
|
||||||
|
|
||||||
let output = JSON.stringify(obj, null, indent.indent);
|
// Always 4 spaces for indent.
|
||||||
|
let output = JSON.stringify(obj, null, 4);
|
||||||
|
|
||||||
if (input.endsWith('\n')) {
|
if (input.endsWith('\n')) {
|
||||||
output += '\n';
|
output += '\n';
|
||||||
|
16
packages/vscode-pyright/package-lock.json
generated
16
packages/vscode-pyright/package-lock.json
generated
@ -18,7 +18,6 @@
|
|||||||
"@types/node": "^17.0.45",
|
"@types/node": "^17.0.45",
|
||||||
"@types/vscode": "^1.82.0",
|
"@types/vscode": "^1.82.0",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"detect-indent": "^6.1.0",
|
|
||||||
"esbuild-loader": "^3.2.0",
|
"esbuild-loader": "^3.2.0",
|
||||||
"shx": "^0.3.4",
|
"shx": "^0.3.4",
|
||||||
"ts-loader": "^9.5.1",
|
"ts-loader": "^9.5.1",
|
||||||
@ -1301,15 +1300,6 @@
|
|||||||
"node": ">=4.0.0"
|
"node": ">=4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/detect-indent": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/detect-libc": {
|
"node_modules/detect-libc": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
||||||
@ -4589,12 +4579,6 @@
|
|||||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"detect-indent": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"detect-libc": {
|
"detect-libc": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
||||||
|
@ -1585,7 +1585,6 @@
|
|||||||
"@types/node": "^17.0.45",
|
"@types/node": "^17.0.45",
|
||||||
"@types/vscode": "^1.82.0",
|
"@types/vscode": "^1.82.0",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"detect-indent": "^6.1.0",
|
|
||||||
"esbuild-loader": "^3.2.0",
|
"esbuild-loader": "^3.2.0",
|
||||||
"shx": "^0.3.4",
|
"shx": "^0.3.4",
|
||||||
"ts-loader": "^9.5.1",
|
"ts-loader": "^9.5.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user