From b3bc682cfe787dd0d12729581dba98c69cb86e70 Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 29 Sep 2024 01:31:51 +0800 Subject: [PATCH 01/58] 1.4.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba9a93a..f335b4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vba-lsp", - "version": "1.4.4", + "version": "1.4.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vba-lsp", - "version": "1.4.4", + "version": "1.4.5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b0a0ac4..d790ae2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "icon": "images/vba-lsp-icon.png", "author": "SSlinky", "license": "MIT", - "version": "1.4.4", + "version": "1.4.5", "repository": { "type": "git", "url": "https://github.com/SSlinky/VBA-LanguageServer" From 28e6fe3a9ae4ec4c3fe6fe1386a70d8cb97a12dc Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 29 Sep 2024 15:25:13 +0800 Subject: [PATCH 02/58] Fixed #17 --- client/src/syntaxes/vba.tmLanguage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/syntaxes/vba.tmLanguage.yaml b/client/src/syntaxes/vba.tmLanguage.yaml index 092734f..94a0499 100644 --- a/client/src/syntaxes/vba.tmLanguage.yaml +++ b/client/src/syntaxes/vba.tmLanguage.yaml @@ -377,7 +377,7 @@ repository: repository: argsVariable: name: meta.arguments.argsVariable.vba - match: (?i),?\s*((?:Optional\s+)?(?:(?:ByVal|ByRef)\s+)?)?([a-z][a-z0-9_]*)(?:\s+(as\s+[a-z][a-z0-9_]*))?(\s*=\s*[^,)]+)? + match: (?i),?\s*((?:Optional\s+)?(?:(?:ByVal|ByRef)\s+)?)?([a-z][a-z0-9_]*)(\(\))?(?:\s+(as\s+[a-z][a-z0-9_]*))?(\s*=\s*[^,)]+)? # Attempted replacing \s with (?:\s+|\s*_\s*\n) to consume a space or a line ending but it refuses to play the game. # match: ~~ doesn't work (?i),?(?:\s+|\s*_\s*\n)*((?:Optional(?:\s+|\s*_\s*\n)+)?(?:(?:ByVal|ByRef)(?:\s+|\s*_\s*\n)+)?)?([a-z][a-z0-9_]*)(?:(?:\s+|\s*_\s*\n)+(as(?:\s+|\s*_\s*\n)+[a-z][a-z0-9_]*))?((?:\s+|\s*_\s*\n)*=(?:\s+|\s*_\s*\n)*[^,\n)]+)? # match: ~~ all broken (?i),?(?:\s*_\s*\n)*((?:Optional(?:\s+(?:\s*_\s*\n)*))?(?:(?:ByVal|ByRef)(?:\s+(?:\s*_\s*\n)*))?)?([a-z][a-z0-9_]*)(?:(?:\s+(?:\s*_\s*\n)*)(as\(?:\s+(?:\s*_\s*\n)*)[a-z][a-z0-9_]*))?((?:\s*_\s*\n)*=(?:\s*_\s*\n)*[^,)]+)? From 13e7bf6c2dcf92a7ae5f25a20681c65ce2a63959 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 4 Oct 2024 11:21:17 +0800 Subject: [PATCH 03/58] update packages --- client/package-lock.json | 1131 +++---- client/package.json | 6 +- client/tsconfig.tsbuildinfo | 1 + package-lock.json | 2924 +++++------------- package.json | 16 +- server/package-lock.json | 83 +- server/package.json | 4 +- server/src/project/parser/vbaSyntaxParser.ts | 3 +- server/tsconfig.tsbuildinfo | 1 + 9 files changed, 1232 insertions(+), 2937 deletions(-) create mode 100644 client/tsconfig.tsbuildinfo create mode 100644 server/tsconfig.tsbuildinfo diff --git a/client/package-lock.json b/client/package-lock.json index 3fca6ec..f2a7edd 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,7 +1,7 @@ { "name": "vba-lsp-client", "version": "0.0.1", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -9,359 +9,460 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "vscode-languageclient": "^7.0.0" + "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@types/vscode": "^1.63.0", - "@vscode/test-electron": "^2.1.2" + "@types/vscode": "^1.94.0", + "@vscode/test-electron": "^2.4.1" }, "engines": { "vscode": "^1.63.0" } }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/vscode": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", - "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", - "dev": true + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz", + "integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==", + "dev": true, + "license": "MIT" }, "node_modules/@vscode/test-electron": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.1.2.tgz", - "integrity": "sha512-INjJ0YA9RgR1B/xBl8P4sxww4Dy2996f4Xn5oGTFfC0c2Mm45y/1Id8xmfuoba6tR5i8zZaUIHfEYWe7Rt4uZA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.1.tgz", + "integrity": "sha512-Gc6EdaLANdktQ1t+zozoBVRynfIsMKMc94Svu1QreOBC8y76x4tvaK32TljrLi1LI2+PK58sDVbL7ALdqf3VRQ==", "dev": true, + "license": "MIT", "dependencies": { - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "rimraf": "^3.0.2", - "unzipper": "^0.10.11" + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "jszip": "^3.10.1", + "ora": "^7.0.1", + "semver": "^7.6.2" }, "engines": { - "node": ">=8.9.3" + "node": ">=16" } }, - "node_modules/@vscode/test-electron/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dev": true, + "license": "MIT", "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, - "node_modules/@vscode/test-electron/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, - "dependencies": { - "ms": "2.1.2" - }, + "license": "MIT", "engines": { - "node": ">=6.0" + "node": ">=12" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@vscode/test-electron/node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "dev": true, + "license": "MIT", "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, - "node_modules/@vscode/test-electron/node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, + "license": "MIT", "dependencies": { - "agent-base": "6", - "debug": "4" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { "node": ">= 6" } }, - "node_modules/@vscode/test-electron/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } }, - "node_modules/@vscode/test-electron/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" } }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "node_modules/big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.6" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/binary": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", - "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, + "license": "MIT", "dependencies": { - "buffers": "~0.1.1", - "chainsaw": "~0.1.0" + "restore-cursor": "^4.0.0" }, "engines": { - "node": "*" - } - }, - "node_modules/bluebird": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", - "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/buffer-indexof-polyfill": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz", - "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==", + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/buffers": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", - "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=", + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true, - "engines": { - "node": ">=0.2.0" - } + "license": "MIT" }, - "node_modules/chainsaw": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", - "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { - "traverse": ">=0.3.0 <0.4" + "ms": "^2.1.3" }, "engines": { - "node": "*" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" - } + "license": "MIT" }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" }, - "node_modules/fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, + "license": "MIT", "dependencies": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">=0.6" + "node": ">= 14" } }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, + "license": "MIT", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "agent-base": "^7.0.2", + "debug": "4" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 14" } }, - "node_modules/graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", - "dev": true + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } + "license": "MIT" }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "dev": true, + "license": "ISC" + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/listenercount": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", - "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "license": "(MIT OR GPL-3.0-or-later)", "dependencies": { - "yallist": "^4.0.0" + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" }, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" } }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, + "license": "MIT", "dependencies": { - "minimist": "^1.2.5" + "mimic-fn": "^2.1.0" }, - "bin": { - "mkdirp": "bin/cmd.js" + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/ora": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", "dev": true, + "license": "MIT", "dependencies": { - "wrappy": "1" + "chalk": "^5.3.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.9.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.3.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "string-width": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "license": "(MIT AND Zlib)" }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -372,31 +473,35 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -407,496 +512,122 @@ "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "license": "MIT" + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, - "node_modules/traverse": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", - "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=", + "node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, "engines": { - "node": "*" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/unzipper": { - "version": "0.10.11", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.11.tgz", - "integrity": "sha512-+BrAq2oFqWod5IESRjL3S8baohbevGcVA+teAIOYWM3pDVdseogqbzhhvvmiyQrUNKFUnDMtELW3X8ykbyDCJw==", + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "license": "MIT", "dependencies": { - "big-integer": "^1.6.17", - "binary": "~0.3.0", - "bluebird": "~3.4.1", - "buffer-indexof-polyfill": "~1.0.0", - "duplexer2": "~0.1.4", - "fstream": "^1.0.12", - "graceful-fs": "^4.2.2", - "listenercount": "~1.0.1", - "readable-stream": "~2.3.6", - "setimmediate": "~1.0.4" + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" }, "node_modules/vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "license": "MIT", "engines": { - "node": ">=8.0.0 || >=10.0.0" + "node": ">=14.0.0" } }, "node_modules/vscode-languageclient": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", - "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz", + "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==", + "license": "MIT", "dependencies": { - "minimatch": "^3.0.4", - "semver": "^7.3.4", - "vscode-languageserver-protocol": "3.16.0" + "minimatch": "^5.1.0", + "semver": "^7.3.7", + "vscode-languageserver-protocol": "3.17.5" }, "engines": { - "vscode": "^1.52.0" + "vscode": "^1.82.0" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "license": "MIT", "dependencies": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" } }, "node_modules/vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - }, - "dependencies": { - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true - }, - "@types/vscode": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", - "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", - "dev": true - }, - "@vscode/test-electron": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.1.2.tgz", - "integrity": "sha512-INjJ0YA9RgR1B/xBl8P4sxww4Dy2996f4Xn5oGTFfC0c2Mm45y/1Id8xmfuoba6tR5i8zZaUIHfEYWe7Rt4uZA==", - "dev": true, - "requires": { - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "rimraf": "^3.0.2", - "unzipper": "^0.10.11" - }, - "dependencies": { - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "requires": { - "debug": "4" - } - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", - "dev": true - }, - "binary": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", - "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", - "dev": true, - "requires": { - "buffers": "~0.1.1", - "chainsaw": "~0.1.0" - } - }, - "bluebird": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", - "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "buffer-indexof-polyfill": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz", - "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==", - "dev": true - }, - "buffers": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", - "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=", - "dev": true - }, - "chainsaw": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", - "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", - "dev": true, - "requires": { - "traverse": ">=0.3.0 <0.4" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "listenercount": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", - "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "traverse": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", - "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=", - "dev": true - }, - "unzipper": { - "version": "0.10.11", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.11.tgz", - "integrity": "sha512-+BrAq2oFqWod5IESRjL3S8baohbevGcVA+teAIOYWM3pDVdseogqbzhhvvmiyQrUNKFUnDMtELW3X8ykbyDCJw==", - "dev": true, - "requires": { - "big-integer": "^1.6.17", - "binary": "~0.3.0", - "bluebird": "~3.4.1", - "buffer-indexof-polyfill": "~1.0.0", - "duplexer2": "~0.1.4", - "fstream": "^1.0.12", - "graceful-fs": "^4.2.2", - "listenercount": "~1.0.1", - "readable-stream": "~2.3.6", - "setimmediate": "~1.0.4" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" - }, - "vscode-languageclient": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", - "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", - "requires": { - "minimatch": "^3.0.4", - "semver": "^7.3.4", - "vscode-languageserver-protocol": "3.16.0" - } - }, - "vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "requires": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "license": "MIT" } } } diff --git a/client/package.json b/client/package.json index 7215d19..db42369 100644 --- a/client/package.json +++ b/client/package.json @@ -13,10 +13,10 @@ "vscode": "^1.63.0" }, "dependencies": { - "vscode-languageclient": "^7.0.0" + "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@types/vscode": "^1.63.0", - "@vscode/test-electron": "^2.1.2" + "@types/vscode": "^1.94.0", + "@vscode/test-electron": "^2.4.1" } } diff --git a/client/tsconfig.tsbuildinfo b/client/tsconfig.tsbuildinfo new file mode 100644 index 0000000..9f52941 --- /dev/null +++ b/client/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/extension.ts","./src/test/completion.test.ts","./src/test/diagnostics.test.ts","./src/test/helper.ts","./src/test/index.ts","./src/test/runtest.ts"],"version":"5.6.2"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f335b4e..e2bd230 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "vba-lsp", "version": "1.4.5", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -10,95 +10,213 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "antlr4ng": "^3.0.4" + "antlr4ng": "^3.0.7" }, "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.11.7", - "@typescript-eslint/eslint-plugin": "^5.30.0", - "@typescript-eslint/parser": "^5.30.0", + "@types/mocha": "^10.0.8", + "@types/node": "^22.7.4", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", "antlr4ng-cli": "^2.0.0", - "eslint": "^8.13.0", + "eslint": "^9.11.1", "js-yaml": "^4.1.0", - "mocha": "^9.2.1", - "typescript": "^5.4.5" + "mocha": "^10.7.3", + "typescript": "^5.6.2" }, "engines": { "vscode": "^1.63.0" } }, - "../../Users/svand/Downloads/antlr4ng-3.0.4": { - "name": "antlr4ng", - "version": "3.0.4", - "extraneous": true, - "license": "BSD-3-Clause", - "devDependencies": { - "@mike-lischke/antlr-tgen": "1.0.8", - "@types/jest": "29.5.12", - "@types/node": "20.11.28", - "@types/unicode-properties": "1.3.2", - "@typescript-eslint/eslint-plugin": "7.2.0", - "@typescript-eslint/parser": "7.2.0", - "esbuild": "0.20.2", - "eslint": "8.57.0", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-jsdoc": "48.2.1", - "eslint-plugin-prefer-arrow": "1.2.3", - "jest": "29.7.0", - "ts-jest": "29.1.2", - "ts-node": "10.9.2", - "typescript": "5.4.2", - "unicode-properties": "1.4.1" + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "peerDependencies": { - "antlr4ng-cli": "^2.0.0" + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", + "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/core": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", + "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10.10.0" + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "9.11.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.11.1.tgz", + "integrity": "sha512-/qu+TWz8WwPWc7/HcIJKi+c+MOm46GdVaSlTTQcaqaL53+GsoA6MxWp5PtTx48qbSP7ylM1Kn7nhvkugfJvRSA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", + "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -112,6 +230,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -121,6 +240,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -129,50 +249,64 @@ "node": ">= 8" } }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", - "dev": true + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.8.tgz", + "integrity": "sha512-HfMcUmy9hTMJh66VNcmeC9iVErIZJli2bszuXc6julh5YGuRb/W5OnkHjwLNYdFlMis0sY3If5SEAp+PktdJjw==", + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "16.11.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.36.tgz", - "integrity": "sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA==", - "dev": true + "version": "22.7.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", + "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.0.tgz", - "integrity": "sha512-lvhRJ2pGe2V9MEU46ELTdiHgiAFZPKtLhiU5wlnaYpMc2+c1R8fh8i80ZAa665drvjHKUJyRRGg3gEm1If54ow==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.0.tgz", + "integrity": "sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.30.0", - "@typescript-eslint/type-utils": "5.30.0", - "@typescript-eslint/utils": "5.30.0", - "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/type-utils": "8.8.0", + "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -180,43 +314,28 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/parser": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.0.tgz", - "integrity": "sha512-2oYYUws5o2liX6SrFQ5RB88+PuRymaM2EU02/9Ppoyu70vllPnHVO7ioxDdq/ypXHA277R04SVjxvwI8HmZpzA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.0.tgz", + "integrity": "sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "5.30.0", - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/typescript-estree": "5.30.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -224,34 +343,18 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.0.tgz", - "integrity": "sha512-3TZxvlQcK5fhTBw5solQucWSJvonXf5yua5nx8OqK94hxdrT7/6W3/CS42MLd/f1BmlmmbGEgQcTHHCktUX5bQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz", + "integrity": "sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/visitor-keys": "5.30.0" + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -259,55 +362,38 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.0.tgz", - "integrity": "sha512-GF8JZbZqSS+azehzlv/lmQQ3EU3VfWYzCczdZjJRxSEeXDQkqFhCBgFhallLDbPwQOEQ4MHpiPfkjKk7zlmeNg==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.0.tgz", + "integrity": "sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "5.30.0", + "@typescript-eslint/typescript-estree": "8.8.0", + "@typescript-eslint/utils": "8.8.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "*" - }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.0.tgz", - "integrity": "sha512-vfqcBrsRNWw/LBXyncMF/KrUTYYzzygCSsVqlZ1qGu1QtGs6vMkt3US0VNSQ05grXi5Yadp3qv5XZdYLjpp8ag==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz", + "integrity": "sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -315,21 +401,23 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.0.tgz", - "integrity": "sha512-hDEawogreZB4n1zoqcrrtg/wPyyiCxmhPLpZ6kmWfKF5M5G0clRLaEexpuWr31fZ42F96SlD/5xCt1bT5Qm4Nw==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz", + "integrity": "sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/visitor-keys": "5.30.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -341,75 +429,53 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.0.tgz", - "integrity": "sha512-0bIgOgZflLKIcZsWvfklsaQTM3ZUbmtH0rJ1hKyV3raoUYyeZwcjQ8ZUJTzS7KnhNcsVT1Rxs7zeeMHEhGlltw==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz", + "integrity": "sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==", "dev": true, + "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.30.0", - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/typescript-estree": "5.30.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.0.tgz", - "integrity": "sha512-6WcIeRk2DQ3pHKxU1Ni0qMXJkjO/zLjBymlYBy/53qxe7yjEFSvzKLDToJjURUhSl2Fzhkl4SMXQoETauF74cw==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz", + "integrity": "sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.30.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.8.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -422,6 +488,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -431,6 +498,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -443,10 +511,11 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -456,6 +525,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -465,6 +535,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -476,9 +547,9 @@ } }, "node_modules/antlr4ng": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.4.tgz", - "integrity": "sha512-u1Ww6wVv9hq70E9AaYe5qW3ba8hvnjJdO3ZsKnb3iJWFV/medLEEhbyWwXCvvD2ef0ptdaiIUgmaazS/WE6uyQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.7.tgz", + "integrity": "sha512-e9VzrS6fErCUTmkZX2eKEMCsmYY87gVhmHkzmOXtUDgvwGhivUvtiHqlOByDx4Nd1PIQ0lMlhflOWEz6cGXqKA==", "license": "BSD-3-Clause", "peerDependencies": { "antlr4ng-cli": "^2.0.0" @@ -494,10 +565,11 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -510,49 +582,47 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "Python-2.0" }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -562,22 +632,25 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -586,10 +659,11 @@ } }, "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -602,16 +676,11 @@ } }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -624,6 +693,9 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } @@ -633,6 +705,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -645,6 +718,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -656,6 +730,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -667,19 +742,22 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -690,12 +768,13 @@ } }, "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -711,6 +790,7 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -722,52 +802,32 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } + "license": "MIT" }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -777,6 +837,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -785,147 +846,172 @@ } }, "node_modules/eslint": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.13.0.tgz", - "integrity": "sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ==", + "version": "9.11.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.11.1.tgz", + "integrity": "sha512-MobhYKIoAO1s1e4VUrgx1l1Sk2JBR/Gqjjgw8+mfgoLE2xwsHur4gdfTxyTgShrhvdVFTaJSgMiQBl1jv/AWxg==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint/eslintrc": "^1.2.1", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/core": "^0.6.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.11.1", + "@eslint/plugin-kit": "^0.2.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", + "@nodelib/fs.walk": "^1.2.8", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^8.0.2", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", + "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", + "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, + "license": "Apache-2.0", "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "engines": { - "node": ">=10" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "*" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/espree": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", + "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.1.0" + }, "engines": { - "node": ">=4.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", "dev": true, - "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" - }, + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -933,20 +1019,12 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -954,20 +1032,12 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -977,6 +1047,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -985,13 +1056,15 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1008,6 +1081,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1019,40 +1093,45 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" }, "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1065,6 +1144,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -1081,41 +1161,46 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, + "license": "BSD-3-Clause", "bin": { "flat": "cli.js" } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1124,36 +1209,32 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1164,6 +1245,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -1171,55 +1253,45 @@ "node": ">=10.13.0" } }, - "node_modules/globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { - "type-fest": "^0.20.2" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, - "engines": { - "node": ">=4.x" - } + "license": "MIT" }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1229,15 +1301,17 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, + "license": "MIT", "bin": { "he": "bin/he" } }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -1247,6 +1321,7 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1261,8 +1336,9 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -1270,8 +1346,10 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1281,13 +1359,15 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -1298,8 +1378,9 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1309,6 +1390,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1318,6 +1400,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1330,15 +1413,27 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1348,6 +1443,7 @@ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1358,14 +1454,16 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -1373,23 +1471,43 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -1403,6 +1521,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -1417,13 +1536,15 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -1440,17 +1561,19 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -1458,86 +1581,76 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", + "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" + "node": ">= 14.0.0" } }, "node_modules/mocha/node_modules/minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1549,35 +1662,25 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1585,24 +1688,26 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -1613,6 +1718,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -1628,6 +1734,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -1643,6 +1750,7 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -1655,33 +1763,17 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1691,6 +1783,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -1703,15 +1796,17 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1734,13 +1829,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } @@ -1750,6 +1847,7 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -1757,23 +1855,12 @@ "node": ">=8.10.0" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1783,6 +1870,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -1792,26 +1880,12 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1831,6 +1905,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -1853,12 +1928,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "license": "ISC", "bin": { @@ -1869,10 +1945,11 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } @@ -1882,6 +1959,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -1894,28 +1972,21 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" @@ -1926,6 +1997,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1938,6 +2010,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -1950,6 +2023,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1960,14 +2034,16 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -1975,25 +2051,17 @@ "node": ">=8.0" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, + "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=16" }, "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "typescript": ">=4.2.0" } }, "node_modules/type-check": { @@ -2001,6 +2069,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -2008,22 +2077,10 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2034,26 +2091,29 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -2075,16 +2135,18 @@ } }, "node_modules/workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2100,14 +2162,16 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" }, "node_modules/y18n": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.6.tgz", - "integrity": "sha512-PlVX4Y0lDTN6E2V4ES2tEdyvXkeKzxa8c/vo0pxPr/TqbztddTP0yn7zZylIyiAuxerqj0Q5GhpJ1YJCP8LaZQ==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -2117,6 +2181,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -2131,10 +2196,11 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -2144,6 +2210,7 @@ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -2159,6 +2226,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -2166,1481 +2234,5 @@ "url": "https://github.com/sponsors/sindresorhus" } } - }, - "dependencies": { - "@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - } - }, - "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", - "dev": true - }, - "@types/node": { - "version": "16.11.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.36.tgz", - "integrity": "sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA==", - "dev": true - }, - "@typescript-eslint/eslint-plugin": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.0.tgz", - "integrity": "sha512-lvhRJ2pGe2V9MEU46ELTdiHgiAFZPKtLhiU5wlnaYpMc2+c1R8fh8i80ZAa665drvjHKUJyRRGg3gEm1If54ow==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.30.0", - "@typescript-eslint/type-utils": "5.30.0", - "@typescript-eslint/utils": "5.30.0", - "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "@typescript-eslint/parser": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.0.tgz", - "integrity": "sha512-2oYYUws5o2liX6SrFQ5RB88+PuRymaM2EU02/9Ppoyu70vllPnHVO7ioxDdq/ypXHA277R04SVjxvwI8HmZpzA==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.30.0", - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/typescript-estree": "5.30.0", - "debug": "^4.3.4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.0.tgz", - "integrity": "sha512-3TZxvlQcK5fhTBw5solQucWSJvonXf5yua5nx8OqK94hxdrT7/6W3/CS42MLd/f1BmlmmbGEgQcTHHCktUX5bQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/visitor-keys": "5.30.0" - } - }, - "@typescript-eslint/type-utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.0.tgz", - "integrity": "sha512-GF8JZbZqSS+azehzlv/lmQQ3EU3VfWYzCczdZjJRxSEeXDQkqFhCBgFhallLDbPwQOEQ4MHpiPfkjKk7zlmeNg==", - "dev": true, - "requires": { - "@typescript-eslint/utils": "5.30.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "@typescript-eslint/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.0.tgz", - "integrity": "sha512-vfqcBrsRNWw/LBXyncMF/KrUTYYzzygCSsVqlZ1qGu1QtGs6vMkt3US0VNSQ05grXi5Yadp3qv5XZdYLjpp8ag==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.0.tgz", - "integrity": "sha512-hDEawogreZB4n1zoqcrrtg/wPyyiCxmhPLpZ6kmWfKF5M5G0clRLaEexpuWr31fZ42F96SlD/5xCt1bT5Qm4Nw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/visitor-keys": "5.30.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "@typescript-eslint/utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.0.tgz", - "integrity": "sha512-0bIgOgZflLKIcZsWvfklsaQTM3ZUbmtH0rJ1hKyV3raoUYyeZwcjQ8ZUJTzS7KnhNcsVT1Rxs7zeeMHEhGlltw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.30.0", - "@typescript-eslint/types": "5.30.0", - "@typescript-eslint/typescript-estree": "5.30.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.0.tgz", - "integrity": "sha512-6WcIeRk2DQ3pHKxU1Ni0qMXJkjO/zLjBymlYBy/53qxe7yjEFSvzKLDToJjURUhSl2Fzhkl4SMXQoETauF74cw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.30.0", - "eslint-visitor-keys": "^3.3.0" - } - }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "antlr4ng": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.4.tgz", - "integrity": "sha512-u1Ww6wVv9hq70E9AaYe5qW3ba8hvnjJdO3ZsKnb3iJWFV/medLEEhbyWwXCvvD2ef0ptdaiIUgmaazS/WE6uyQ==", - "requires": {} - }, - "antlr4ng-cli": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/antlr4ng-cli/-/antlr4ng-cli-2.0.0.tgz", - "integrity": "sha512-oAt5OSSYhRQn1PgahtpAP4Vp3BApCoCqlzX7Q8ZUWWls4hX59ryYuu0t7Hwrnfk796OxP/vgIJaqxdltd/oEvQ==" - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "eslint": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.13.0.tgz", - "integrity": "sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ==", - "dev": true, - "requires": { - "@eslint/eslintrc": "^1.2.1", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true - }, - "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", - "dev": true, - "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" - } - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "dev": true - }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, - "typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true - }, - "workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "y18n": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.6.tgz", - "integrity": "sha512-PlVX4Y0lDTN6E2V4ES2tEdyvXkeKzxa8c/vo0pxPr/TqbztddTP0yn7zZylIyiAuxerqj0Q5GhpJ1YJCP8LaZQ==", - "dev": true - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - } - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true - } } } diff --git a/package.json b/package.json index d790ae2..2b3e7d8 100644 --- a/package.json +++ b/package.json @@ -106,17 +106,17 @@ "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/" }, "dependencies": { - "antlr4ng": "^3.0.4" + "antlr4ng": "^3.0.7" }, "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.11.7", - "@typescript-eslint/eslint-plugin": "^5.30.0", - "@typescript-eslint/parser": "^5.30.0", + "@types/mocha": "^10.0.8", + "@types/node": "^22.7.4", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", "antlr4ng-cli": "^2.0.0", - "eslint": "^8.13.0", + "eslint": "^9.11.1", "js-yaml": "^4.1.0", - "mocha": "^9.2.1", - "typescript": "^5.4.5" + "mocha": "^10.7.3", + "typescript": "^5.6.2" } } diff --git a/server/package-lock.json b/server/package-lock.json index c8256ad..c4f9591 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,7 +1,7 @@ { "name": "vba-lsp-server", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -9,84 +9,55 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "vscode-languageserver": "^7.0.0", - "vscode-languageserver-textdocument": "^1.0.4" + "vscode-languageserver": "^9.0.1", + "vscode-languageserver-textdocument": "^1.0.12" }, "engines": { "node": "*" } }, "node_modules/vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "license": "MIT", "engines": { - "node": ">=8.0.0 || >=10.0.0" + "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", - "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.16.0" + "vscode-languageserver-protocol": "3.17.5" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "license": "MIT", "dependencies": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" } }, "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.4.tgz", - "integrity": "sha512-/xhqXP/2A2RSs+J8JNXpiiNVvvNM0oTosNVmQnunlKvq9o4mupHOBAnnzH0lwIPKazXKvAKsVp1kr+H/K4lgoQ==" + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "license": "MIT" }, "node_modules/vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" - } - }, - "dependencies": { - "vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" - }, - "vscode-languageserver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", - "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", - "requires": { - "vscode-languageserver-protocol": "3.16.0" - } - }, - "vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "requires": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "vscode-languageserver-textdocument": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.4.tgz", - "integrity": "sha512-/xhqXP/2A2RSs+J8JNXpiiNVvvNM0oTosNVmQnunlKvq9o4mupHOBAnnzH0lwIPKazXKvAKsVp1kr+H/K4lgoQ==" - }, - "vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "license": "MIT" } } } diff --git a/server/package.json b/server/package.json index ce3b8c5..5eee087 100644 --- a/server/package.json +++ b/server/package.json @@ -12,8 +12,8 @@ "url": "https://github.com/SSlinky/tbc" }, "dependencies": { - "vscode-languageserver": "^7.0.0", - "vscode-languageserver-textdocument": "^1.0.4" + "vscode-languageserver": "^9.0.1", + "vscode-languageserver-textdocument": "^1.0.12" }, "scripts": {} } diff --git a/server/src/project/parser/vbaSyntaxParser.ts b/server/src/project/parser/vbaSyntaxParser.ts index 401ec71..b25fccb 100644 --- a/server/src/project/parser/vbaSyntaxParser.ts +++ b/server/src/project/parser/vbaSyntaxParser.ts @@ -19,8 +19,7 @@ export class SyntaxParser { const parser = this.createParser(document.textDocument); ParseTreeWalker.DEFAULT.walk( listener, - parser.startRule(), - token + parser.startRule() ); return true; } diff --git a/server/tsconfig.tsbuildinfo b/server/tsconfig.tsbuildinfo new file mode 100644 index 0000000..14aa122 --- /dev/null +++ b/server/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/document.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.2"} \ No newline at end of file From 4e96023d0b092b81b74121bbcc9e742762ff97e5 Mon Sep 17 00:00:00 2001 From: sslinky Date: Mon, 7 Oct 2024 13:58:49 +0800 Subject: [PATCH 04/58] Reimagine scope --- server/src/project/scope.ts | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 server/src/project/scope.ts diff --git a/server/src/project/scope.ts b/server/src/project/scope.ts new file mode 100644 index 0000000..c7b386e --- /dev/null +++ b/server/src/project/scope.ts @@ -0,0 +1,50 @@ +import { DeclarationElement } from './elements/base'; + + +interface IScope { + children: IScope[]; + declaredNames: Map; + pushDeclaredName(element: DeclarationElement): void + findDeclaration(identifier: string): DeclarationElement | undefined; +} + +abstract class BaseScope implements IScope { + children: IScope[] = []; + parentScope?: IScope; + declaredNames: Map = new Map(); + + abstract findDeclaration(identifier: string): DeclarationElement | undefined; + + pushDeclaredName(element: DeclarationElement): void { + const name = element.name; + const names: DeclarationElement[] = this.declaredNames.get(name) ?? []; + names.push(element); + this.declaredNames.set(name, names); + } +} + +export class Scope extends BaseScope { + parentScope: Scope | GlobalScope; + + constructor(parent: Scope | GlobalScope) { + super(); + this.parentScope = parent; + } + + /** + * Recursively searches for the related declaration. + * @param identifier the name of the identifiable element. + * @returns a declaration element if found. + */ + findDeclaration = (identifier: string): DeclarationElement | undefined => + this.declaredNames.get(identifier)?.at(0) ?? this.parentScope?.findDeclaration(identifier); +} + +export class GlobalScope extends BaseScope { + constructor() { + super(); + } + + findDeclaration = (identifier: string) => + this.declaredNames.get(identifier)?.at(0); +} From 703ade6657c76005a5bbaf6ba2b587444bc172b3 Mon Sep 17 00:00:00 2001 From: sslinky Date: Mon, 7 Oct 2024 14:00:14 +0800 Subject: [PATCH 05/58] Update node packages --- server/src/capabilities/diagnostics.ts | 8 ++ server/src/project/document.ts | 93 +++++++++++------ server/src/project/elements/base.ts | 7 +- server/src/project/elements/memory.ts | 104 +++++++++++++------ server/src/project/elements/special.ts | 44 +++++--- server/src/project/parser/vbaSyntaxParser.ts | 60 +++++++---- server/src/project/workspace.ts | 55 +++++++++- server/src/server.ts | 6 ++ server/tsconfig.tsbuildinfo | 2 +- 9 files changed, 272 insertions(+), 107 deletions(-) diff --git a/server/src/capabilities/diagnostics.ts b/server/src/capabilities/diagnostics.ts index cac929d..3ab5659 100644 --- a/server/src/capabilities/diagnostics.ts +++ b/server/src/capabilities/diagnostics.ts @@ -68,6 +68,14 @@ export class DuplicateDeclarationDiagnostic extends BaseDiagnostic { } } +export class ShadowDeclarationDiagnostic extends BaseDiagnostic { + message = "Declaration is shadowed in the local scope."; + severity = DiagnosticSeverity.Error; + constructor(range: Range) { + super(range); + } +} + export class IgnoredAttributeDiagnostic extends BaseDiagnostic { message = "This attribute will be ignored."; severity = DiagnosticSeverity.Information; diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 5db51a4..e70cb9e 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -1,12 +1,14 @@ -import { CancellationToken, Diagnostic, PublishDiagnosticsParams, SymbolInformation, SymbolKind } from 'vscode-languageserver'; +import { CancellationToken, Diagnostic, DocumentDiagnosticReport, DocumentDiagnosticReportKind, PublishDiagnosticsParams, SymbolInformation, SymbolKind } from 'vscode-languageserver'; import { Workspace } from './workspace'; -import { FoldableElement } from './elements/special'; -import { HasDiagnosticCapability, HasSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement, ScopeElement } from './elements/base'; +import { FoldableElement, IdentifiableScopeElement } from './elements/special'; +import { DeclarationElement, HasDiagnosticCapability, HasSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement } from './elements/base'; import { Range, TextDocument } from 'vscode-languageserver-textdocument'; import { SyntaxParser } from './parser/vbaSyntaxParser'; import { FoldingRange } from '../capabilities/folding'; import { SemanticTokensManager } from '../capabilities/semanticTokens'; import { ParseCancellationException } from 'antlr4ng'; +import { Scope } from './scope'; +import { DuplicateDeclarationDiagnostic, ShadowDeclarationDiagnostic } from '../capabilities/diagnostics'; export interface DocumentSettings { maxDocumentLines: number; @@ -22,11 +24,11 @@ export abstract class BaseProjectDocument { protected _hasDiagnosticElements: HasDiagnosticCapability[] = []; protected _unhandledNamedElements: [] = []; - protected _publicScopeDeclarations: Map = new Map(); + // protected _publicScopeDeclarations: Map = new Map(); protected _documentScopeDeclarations: Map> = new Map(); protected _diagnostics: Diagnostic[] = []; - protected _elementParents: ScopeElement[] = []; + protected _elementParents: Scope[] = []; // protected _attributeElements: HasAttribute[] = []; protected _foldableElements: FoldingRange[] = []; protected _symbolInformations: SymbolInformation[] = []; @@ -52,7 +54,16 @@ export abstract class BaseProjectDocument { // } get currentScopeElement() { - return this._elementParents.at(-1); + return this._elementParents.at(-1) ?? this.workspace.globalScope; + } + + get moduleScope() { + const scope = this._elementParents.at(0); + if (!scope) { + throw new Error("Expected module scope!"); + } + + return scope; } async getDocumentConfiguration(): Promise { @@ -124,14 +135,12 @@ export abstract class BaseProjectDocument { return this._symbolInformations; } - languageServerDiagnostics(): PublishDiagnosticsParams { - this._hasDiagnosticElements.forEach(e => - e.evaluateDiagnostics() - ); + languageServerDiagnostics(): DocumentDiagnosticReport { return { - uri: this.textDocument.uri, - diagnostics: this._hasDiagnosticElements - .map((e) => e.diagnostics).flat(1) }; + kind: DocumentDiagnosticReportKind.Full, + items: this._hasDiagnosticElements + .map((e) => e.diagnostics).flat(1) + }; } async parseAsync(token: CancellationToken): Promise { @@ -154,7 +163,7 @@ export abstract class BaseProjectDocument { } // Parse the document. - await (new SyntaxParser()).parseAsync(this, token) + await (new SyntaxParser()).parseAsync(this) // Evaluate the diagnostics. this._hasDiagnosticElements.forEach(element => { @@ -164,13 +173,24 @@ export abstract class BaseProjectDocument { this._isBusy = false; }; - registerNamedElementDeclaration(element: any) { - // Check workspace if public. - // Check for existing entry in local scope. - // Check for overriding name in method (if relevant) - // Check for overriding name in document scope. - // Check for overriding name in workspace. - throw new Error("Not implemented"); + registerNamedElementDeclaration(element: IdentifiableScopeElement) { + const scope = element.isPublic ? this.workspace.globalScope : this.currentScopeElement; + + // Check for duplicate declarations + if (!!scope.declaredNames.has(element.name)) { + element.diagnostics.push(new DuplicateDeclarationDiagnostic(element.identifier.range)) + } + + // Check for variable shadowing. + // TODO: This doesn't work for vars declared at a higher level AFTER the lower level. + // e.g.: Private Const FOO + // Public Const FOO + if (!!scope.parentScope?.findDeclaration(element.name)) { + element.diagnostics.push(new ShadowDeclarationDiagnostic(element.identifier.range)) + } + + scope.pushDeclaredName(element); + return this; } registerDiagnosticElement(element: HasDiagnosticCapability) { @@ -205,30 +225,39 @@ export abstract class BaseProjectDocument { return this; }; - registerNamedElement(element: IdentifiableSyntaxElement) { + registerPublicNamedElement(element: DeclarationElement) { + this.workspace.globalScope.pushDeclaredName(element); + return this; + } + + registerNamedElement(element: DeclarationElement) { this.currentScopeElement?.pushDeclaredName(element); return this; } /** - * Registers an element as a parent to be attached to subsequent elemements. + * Registers scope as a parent to be attached to subsequent elemements. * Should be called when the parser context is entered and matched with - * deregisterScopedElement when the context exits. - * @param element the element to register. - * @returns this for chaining. + * deregisterScope when the context exits. + * @param scope the element to register. + * @returns the registered scope. */ - registerScopedElement(element: ScopeElement) { - this._elementParents.push(element); - return this; + registerScope(): Scope { + const parent = this.currentScopeElement; + const scope = new Scope(parent); + + parent.children.push(scope) + this._elementParents.push(scope); + return scope; } /** - * Deregisters an element as a parent so it isn't attached to subsequent elemements. + * Deregisters a scope as a parent so it isn't attached to subsequent elemements. * Should be called when the parser context is exited and matched with - * deregisterScopedElement when the context is entered. + * registerScope when the context is entered. * @returns this for chaining. */ - deregisterScopedElement = () => { + deregisterScope = () => { this._elementParents.pop(); return this; }; diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index d521eb5..866650c 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -4,6 +4,7 @@ import { Position, TextDocument } from 'vscode-languageserver-textdocument'; import { FoldingRangeKind } from '../../capabilities/folding'; import { IdentifierElement, PropertyDeclarationElement } from './memory'; import '../../extensions/parserExtensions'; +import { IdentifiableScopeElement } from './special'; export interface ContextOptionalSyntaxElement { range?: Range; @@ -54,9 +55,9 @@ export interface FoldingRangeElement { foldingRangeKind?: FoldingRangeKind; } -export interface ScopeElement { - declaredNames: Map; - pushDeclaredName(element: IdentifiableSyntaxElement): void +export interface DeclarationElement extends HasDiagnosticCapability, NamedSyntaxElement { + isPublic: boolean; + isPropertyElement(): this is PropertyDeclarationElement } export abstract class BaseSyntaxElement implements ContextOptionalSyntaxElement { diff --git a/server/src/project/elements/memory.ts b/server/src/project/elements/memory.ts index a69c160..9f12bc8 100644 --- a/server/src/project/elements/memory.ts +++ b/server/src/project/elements/memory.ts @@ -1,14 +1,16 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, SemanticTokenModifiers, SemanticTokenTypes, SymbolInformation, SymbolKind } from 'vscode-languageserver'; -import { AmbiguousIdentifierContext, ConstItemContext, EnumDeclarationContext, EnumMemberContext, FunctionDeclarationContext, ProcedureDeclarationContext, PropertyGetDeclarationContext, PropertySetDeclarationContext, ReservedMemberNameContext, SubroutineDeclarationContext, UdtDeclarationContext, UdtElementContext, UntypedNameContext, VariableDclContext } from '../../antlr/out/vbaParser'; +import { AmbiguousIdentifierContext, ConstItemContext, EnumDeclarationContext, EnumMemberContext, FunctionDeclarationContext, ProcedureDeclarationContext, PropertyGetDeclarationContext, PropertySetDeclarationContext, PublicConstDeclarationContext, ReservedMemberNameContext, SubroutineDeclarationContext, UdtDeclarationContext, UdtElementContext, UntypedNameContext, VariableDclContext } from '../../antlr/out/vbaParser'; -import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSemanticToken, HasSymbolInformation, NamedSyntaxElement } from './base'; +import { BaseContextSyntaxElement, DeclarationElement, HasDiagnosticCapability, HasSemanticToken, HasSymbolInformation, NamedSyntaxElement } from './base'; -import { ScopeElement } from './special'; import { VbaClassDocument, VbaModuleDocument } from '../document'; import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; import '../../extensions/parserExtensions'; import { DuplicateDeclarationDiagnostic, ElementOutOfPlaceDiagnostic } from '../../capabilities/diagnostics'; +import { ScopeElement } from './special'; +import { Scope } from '../scope'; +import { ParserRuleContext } from 'antlr4ng'; @@ -18,7 +20,7 @@ export class IdentifierElement extends BaseContextSyntaxElement { } } -export abstract class DeclarationElement extends ScopeElement implements HasDiagnosticCapability { +export abstract class ProcedureDeclarationElement extends ScopeElement { abstract diagnostics: Diagnostic[]; abstract identifier: IdentifierElement; @@ -31,7 +33,7 @@ export abstract class DeclarationElement extends ScopeElement implements HasDiag } get name(): string { - throw new Error('Method not implemented.'); + return this.identifier.text; } static create(context: ProcedureDeclarationContext, document: VbaClassDocument | VbaModuleDocument) { @@ -67,7 +69,7 @@ export abstract class DeclarationElement extends ScopeElement implements HasDiag } } -export class SubDeclarationElement extends DeclarationElement implements HasSymbolInformation { +export class SubDeclarationElement extends ProcedureDeclarationElement implements DeclarationElement, HasSymbolInformation { identifier: IdentifierElement; symbolInformation: SymbolInformation; diagnostics: Diagnostic[] = []; @@ -86,7 +88,7 @@ export class SubDeclarationElement extends DeclarationElement implements HasSymb } } -export class FunctionDeclarationElement extends DeclarationElement implements HasSymbolInformation { +export class FunctionDeclarationElement extends ProcedureDeclarationElement implements DeclarationElement, HasSymbolInformation { identifier: IdentifierElement; symbolInformation: SymbolInformation; diagnostics: Diagnostic[] = []; @@ -104,7 +106,7 @@ export class FunctionDeclarationElement extends DeclarationElement implements Ha } } -export class PropertyDeclarationElement extends DeclarationElement implements HasSymbolInformation { +export class PropertyDeclarationElement extends ProcedureDeclarationElement implements HasSymbolInformation { identifier: IdentifierElement; diagnostics: Diagnostic[] = []; symbolInformation: SymbolInformation; @@ -166,7 +168,7 @@ export class PropertyDeclarationElement extends DeclarationElement implements Ha } } -class PropertyGetDeclarationElement extends DeclarationElement { +class PropertyGetDeclarationElement extends ProcedureDeclarationElement { identifier: IdentifierElement; diagnostics: Diagnostic[] = []; @@ -176,7 +178,7 @@ class PropertyGetDeclarationElement extends DeclarationElement { } } -class PropertyLetDeclarationElement extends DeclarationElement { +class PropertyLetDeclarationElement extends ProcedureDeclarationElement { identifier: IdentifierElement; diagnostics: Diagnostic[] = []; @@ -186,7 +188,7 @@ class PropertyLetDeclarationElement extends DeclarationElement { } } -class PropertySetDeclarationElement extends DeclarationElement { +class PropertySetDeclarationElement extends ProcedureDeclarationElement { identifier: IdentifierElement; diagnostics: Diagnostic[] = []; @@ -212,13 +214,14 @@ abstract class BaseEnumDeclarationElement extends ScopeElement implements HasSem super(context, document); this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); } - } -export class EnumDeclarationElement extends BaseEnumDeclarationElement implements ScopeElement, HasDiagnosticCapability { +export class EnumDeclarationElement extends BaseEnumDeclarationElement implements HasDiagnosticCapability { + // scope: Scope; diagnostics: Diagnostic[] = []; tokenType: SemanticTokenTypes; isDeclaredAfterMethod: boolean; + enumMembers: EnumMemberDeclarationElement[]; get symbolInformation(): SymbolInformation { return SymbolInformationFactory.create( @@ -226,14 +229,13 @@ export class EnumDeclarationElement extends BaseEnumDeclarationElement implement ); } - constructor(context: EnumDeclarationContext, document: TextDocument, isDeclaredAfterMethod: boolean) { + constructor(context: EnumDeclarationContext, document: TextDocument, isDeclaredAfterMethod: boolean, scope?: Scope) { super(context, document); + // this.scope = scope; this.tokenType = SemanticTokenTypes.enum; this.isDeclaredAfterMethod = isDeclaredAfterMethod; this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); - context.enumMemberList().enumElement().forEach(enumElementContext => - this.pushDeclaredName(new EnumMemberDeclarationElement(enumElementContext.enumMember()!, document)) - ); + this.enumMembers = context.enumMemberList().enumElement().map(e => new EnumMemberDeclarationElement(e.enumMember()!, document)) } evaluateDiagnostics(): void { @@ -241,7 +243,6 @@ export class EnumDeclarationElement extends BaseEnumDeclarationElement implement this.diagnostics.push(new ElementOutOfPlaceDiagnostic(this.range, 'Enum declaration')); } } - } class EnumMemberDeclarationElement extends BaseEnumDeclarationElement { @@ -258,13 +259,16 @@ class EnumMemberDeclarationElement extends BaseEnumDeclarationElement { this.tokenType = SemanticTokenTypes.enumMember; this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); } + + evaluateDiagnostics(): void { } } -abstract class BaseVariableDeclarationStatementElement extends BaseContextSyntaxElement implements HasSemanticToken, HasSymbolInformation, NamedSyntaxElement { +abstract class BaseVariableDeclarationStatementElement extends BaseContextSyntaxElement implements DeclarationElement { tokenType: SemanticTokenTypes; tokenModifiers: SemanticTokenModifiers[] = []; + diagnostics: Diagnostic[] = []; readonly symbolKind: SymbolKind; - + abstract isPublic: boolean; abstract identifier: IdentifierElement; get name(): string { @@ -280,29 +284,58 @@ abstract class BaseVariableDeclarationStatementElement extends BaseContextSyntax ); } - isPropertyElement(): this is PropertyDeclarationElement { - return false; - } - constructor(context: VariableDclContext | ConstItemContext | UdtElementContext, document: TextDocument, tokenType: SemanticTokenTypes, symbolKind: SymbolKind) { super(context, document); this.tokenType = tokenType; this.symbolKind = symbolKind; } + + // Empty method so that implementation is optional. + evaluateDiagnostics(): void { } + + isPropertyElement(): this is PropertyDeclarationElement { + return false; + } } export class ConstDeclarationElement extends BaseVariableDeclarationStatementElement { - tokenModifiers: SemanticTokenModifiers[] = []; identifier: IdentifierElement; - - get name(): string { - return this.identifier.text; - } + isPublic: boolean; constructor(context: ConstItemContext, document: TextDocument) { super(context, document, SemanticTokenTypes.variable, SymbolKind.Constant); - this.identifier = new IdentifierElement(context, document); + const identifierContext = ConstDeclarationElement._getIdentifierContext(context); + this.identifier = new IdentifierElement(identifierContext, document); + + // Public/Global and private are at module level. + // Local cannot have a modifier, i.e., they are private. + // publicConstDeclaration -> moduleConstDeclaration -> constDeclaration -> constItemList -> constItem + // privateConstDeclaration -> moduleConstDeclaration -> constDeclaration -> constItemList -> constItem + // localConstDeclaration -> constDeclaration -> constItemList -> constItem + const constDeclaration = context.parent!.parent!.parent!.parent!; + if(this._isPublicConst(constDeclaration)) { + // TODO: Add logic to get module option private module when no modifiers present. + // *Assuming module level declaration (add this to variable and method too). + this.isPublic = !!constDeclaration.GLOBAL() || !!constDeclaration.PUBLIC(); + } else { + this.isPublic = false; + } } + + // We're always going to have a context here, and if we don't, we'd want it to break anyway. + private static _getIdentifierContext(context: ConstItemContext): AmbiguousIdentifierContext { + const name = context.typedNameConstItem()?.typedName().ambiguousIdentifier() + ?? context.untypedNameConstItem()?.ambiguousIdentifier(); + return name!; + } + + private _isPublicConst(ctx: ParserRuleContext): ctx is PublicConstDeclarationContext { + return 'PUBLIC' in ctx; + } + + // private _isPrivateConst(ctx: ParserRuleContext): ctx is PrivateConstDeclarationContext { + // return 'PRIVATE' in ctx; + // } } export class TypeDeclarationElement extends ScopeElement implements HasSemanticToken, HasSymbolInformation, NamedSyntaxElement { @@ -328,10 +361,19 @@ export class TypeDeclarationElement extends ScopeElement implements HasSemantic this as NamedSyntaxElement, this.symbolKind ); } + + pushDeclaredName(e: TypeMemberDeclarationElement) { + if (!this.declaredNames.has(e.identifier.text)) { + this.declaredNames.set(e.identifier.text, [e]); + } else { + this.declaredNames.get(e.identifier.text)?.push(e); + } + } + evaluateDiagnostics(): void { } } export class TypeMemberDeclarationElement extends BaseVariableDeclarationStatementElement { - tokenModifiers: SemanticTokenModifiers[] = []; + isPublic = false; // temp fix for implementation - TODO: don't inherit base variable. identifier: IdentifierElement; get name(): string { diff --git a/server/src/project/elements/special.ts b/server/src/project/elements/special.ts index 6f12f16..2166b59 100644 --- a/server/src/project/elements/special.ts +++ b/server/src/project/elements/special.ts @@ -1,10 +1,13 @@ import { ParserRuleContext } from 'antlr4ng'; import { FoldingRangeKind } from '../../capabilities/folding'; -import { BaseContextSyntaxElement, FoldingRangeElement, IdentifiableSyntaxElement } from './base'; +import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, IdentifiableSyntaxElement } from './base'; import { Range, TextDocument } from 'vscode-languageserver-textdocument'; -import { PropertyDeclarationElement } from './memory'; +import { IdentifierElement, PropertyDeclarationElement } from './memory'; +import { Diagnostic } from 'vscode-languageserver'; +// TODO: Reorganise this stuff as properties of more generic classes. +// Whether the element is foldable or not is complicating inheritence. export class FoldableElement extends BaseContextSyntaxElement implements FoldingRangeElement { range!: Range; foldingRangeKind?: FoldingRangeKind; @@ -15,21 +18,36 @@ export class FoldableElement extends BaseContextSyntaxElement implements Folding } } -export class ScopeElement extends FoldableElement implements ScopeElement { - declaredNames: Map = new Map(); - - constructor(ctx: ParserRuleContext, doc: TextDocument) { - super(ctx, doc); +export abstract class ScopeElement extends FoldableElement implements DeclarationElement { + isPublic = false; + diagnostics: Diagnostic[] = []; + + isPropertyElement(): this is PropertyDeclarationElement { + return 'getDeclarations' in this; + } + + constructor(ctx: ParserRuleContext, doc: TextDocument, foldingRangeKind?: FoldingRangeKind) { + super(ctx, doc, foldingRangeKind); } - pushDeclaredName(element: IdentifiableSyntaxElement): void { - const name = element.identifier.text; - const names: IdentifiableSyntaxElement[] = this.declaredNames.get(name) ?? []; - names.push(element); - this.declaredNames.set(name, names); + abstract evaluateDiagnostics(): void; + abstract get name(): string; +} + +export abstract class IdentifiableScopeElement extends BaseContextSyntaxElement implements DeclarationElement, IdentifiableSyntaxElement { + isPublic = false; + diagnostics: Diagnostic[] = []; + abstract identifier: IdentifierElement; + + constructor(ctx: ParserRuleContext, doc: TextDocument) { + super(ctx, doc); } isPropertyElement(): this is PropertyDeclarationElement { return 'getDeclarations' in this; } -} + abstract evaluateDiagnostics(): void; + get name(): string { + return this.identifier.text; + } +} \ No newline at end of file diff --git a/server/src/project/parser/vbaSyntaxParser.ts b/server/src/project/parser/vbaSyntaxParser.ts index b25fccb..82b00cc 100644 --- a/server/src/project/parser/vbaSyntaxParser.ts +++ b/server/src/project/parser/vbaSyntaxParser.ts @@ -5,14 +5,13 @@ import { ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredA import { vbaListener } from '../../antlr/out/vbaListener'; import { DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; -import { CancellationToken } from 'vscode-languageserver'; import { CharStream, CommonTokenStream, DefaultErrorStrategy, ErrorNode, ParseTreeWalker, Parser, RecognitionException } from 'antlr4ng'; import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; -import { ConstDeclarationElement, DeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; +import { ConstDeclarationElement, ProcedureDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; import { WhileLoopElement } from '../elements/flow'; export class SyntaxParser { - async parseAsync(document: VbaClassDocument | VbaModuleDocument, token: CancellationToken): Promise { + async parseAsync(document: VbaClassDocument | VbaModuleDocument): Promise { console.debug(`Parse requested: ${document.textDocument.version}`); const listener = new VbaListener(document); await listener.ensureHasSettings(); @@ -59,12 +58,18 @@ class VbaListener extends vbaListener { } enterEnumDeclaration = (ctx: EnumDeclarationContext) => { - const element = new EnumDeclarationElement(ctx, this.document.textDocument, this._isAfterMethodDeclaration); + const element = new EnumDeclarationElement(ctx, + this.document.textDocument, + this._isAfterMethodDeclaration, + ); + + // Element registrations. this.document.registerFoldableElement(element) - .registerScopedElement(element) .registerSemanticToken(element) .registerSymbolInformation(element) .registerDiagnosticElement(element); + + // this.document.registerScope() element.declaredNames.forEach(names => names.forEach(name => this.document .registerSemanticToken(name) @@ -72,25 +77,27 @@ class VbaListener extends vbaListener { ); }; - exitEnumDeclaration = (_: EnumDeclarationContext) => { - this.document.deregisterScopedElement(); - }; + // exitEnumDeclaration = (_: EnumDeclarationContext) => { + // this.document.deregisterScope(); + // }; enterClassModule = (ctx: ClassModuleContext) => { const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? {doWarnOptionExplicitMissing: true}); this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element) - .registerScopedElement(element); + .registerDiagnosticElement(element); + this.document.registerScope(); }; - exitClassModule = (ctx: ClassModuleContext) => { - this.document.deregisterScopedElement(); + exitClassModule = (_: ClassModuleContext) => { + this.document.deregisterScope(); }; enterConstItem = (ctx: ConstItemContext) => { const element = new ConstDeclarationElement(ctx, this.document.textDocument); this.document.registerSemanticToken(element) - .registerSymbolInformation(element); + .registerSymbolInformation(element) + .registerNamedElementDeclaration(element) + .registerDiagnosticElement(element); }; enterIgnoredAttr = (ctx: IgnoredAttrContext) => { @@ -101,29 +108,36 @@ class VbaListener extends vbaListener { enterProceduralModule = (ctx: ProceduralModuleContext) => { const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? {doWarnOptionExplicitMissing: true}); this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element) - .registerScopedElement(element); - }; + .registerDiagnosticElement(element); + this.document.registerScope(); + }; - exitProceduralModule = (ctx: ProceduralModuleContext) => { - this.document.deregisterScopedElement(); + exitProceduralModule = (_: ProceduralModuleContext) => { + this.document.deregisterScope(); }; enterProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { - const element = DeclarationElement.create(ctx, this.document); + const element = ProcedureDeclarationElement.create(ctx, this.document); this.document.registerSymbolInformation(element) - .registerFoldableElement(element) - .registerScopedElement(element); + .registerDiagnosticElement(element) + .registerFoldableElement(element); if (element.isPropertyElement() && element.countDeclarations === 1) { this.document.registerDiagnosticElement(element) .registerNamedElement(element); + } else { + // TODO: Figure out how to do properties differently as it affects the way you access them. + // Maybe all need some `{ get-let: type, get-set: type, set: type, let: type }` types where functions will have get-let or get-set, + // variables will have a getter and a setter of the same type (set or let) and properties will have whatever they have. + this.document.registerNamedElementDeclaration(element); } + + this.document.registerScope(); }; - exitProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { + exitProcedureDeclaration = (_: ProcedureDeclarationContext) => { this._isAfterMethodDeclaration = true; - this.document.deregisterScopedElement(); + this.document.deregisterScope(); }; enterUdtDeclaration = (ctx: UdtDeclarationContext) => { diff --git a/server/src/project/workspace.ts b/server/src/project/workspace.ts index 6ad75eb..e2f3e0b 100644 --- a/server/src/project/workspace.ts +++ b/server/src/project/workspace.ts @@ -1,9 +1,10 @@ -import { CancellationToken, CancellationTokenSource, CompletionItem, CompletionParams, DidChangeConfigurationNotification, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DocumentSymbolParams, FoldingRange, FoldingRangeParams, Hover, HoverParams, SemanticTokensRangeParams, SymbolInformation, TextDocuments, WorkspaceFoldersChangeEvent, _Connection } from 'vscode-languageserver'; +import { CancellationToken, CancellationTokenSource, CompletionItem, CompletionParams, DidChangeConfigurationNotification, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DocumentDiagnosticParams, DocumentDiagnosticReport, DocumentDiagnosticReportKind, DocumentSymbolParams, FoldingRange, FoldingRangeParams, Hover, HoverParams, SemanticTokensRangeParams, SymbolInformation, TextDocuments, WorkspaceFoldersChangeEvent, _Connection } from 'vscode-languageserver'; import { BaseProjectDocument } from './document'; import { LanguageServerConfiguration } from '../server'; import { hasConfigurationCapability } from '../capabilities/workspaceFolder'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { sleep } from '../utils/helpers'; +import { GlobalScope } from './scope'; /** @@ -12,6 +13,7 @@ import { sleep } from '../utils/helpers'; */ export class Workspace { private _events: WorkspaceEvents; + private _globalScope: GlobalScope; private _documents: BaseProjectDocument[] = []; private _activeDocument?: BaseProjectDocument; private _publicScopeDeclarations: Map = new Map(); @@ -28,7 +30,12 @@ export class Workspace { return this._activeDocument; } + get globalScope() { + return this._globalScope; + } + constructor(params: {connection: _Connection, capabilities: LanguageServerConfiguration}) { + this._globalScope = new GlobalScope(); this.connection = params.connection; this._hasConfigurationCapability = hasConfigurationCapability(params.capabilities); this._events = new WorkspaceEvents({ @@ -57,7 +64,6 @@ export class Workspace { } this._parseCancellationTokenSource = undefined; - this.connection.sendDiagnostics(this._activeDocument?.languageServerDiagnostics() ?? {uri: "", diagnostics: []}); } /** @@ -86,6 +92,7 @@ export class Workspace { clearDocumentsConfiguration = () => { this._documents.forEach(d => d.clearDocumentConfiguration()); + this.connection.languages.diagnostics.refresh(); } } @@ -94,6 +101,7 @@ class WorkspaceEvents { private readonly _workspace: Workspace; private readonly _documents: TextDocuments; private readonly _configuration: LanguageServerConfiguration; + private readonly _parsedDocuments: Map; private _activeDocument?: BaseProjectDocument; @@ -101,6 +109,7 @@ class WorkspaceEvents { this._workspace = params.workspace; this._configuration = params.configuration; this._documents = new TextDocuments(TextDocument); + this._parsedDocuments = new Map(); this.initialiseConnectionEvents(params.connection); this._initialiseDocumentsEvents(); this._documents.listen(params.connection); @@ -138,6 +147,33 @@ class WorkspaceEvents { return document; } + private async getParsedDocument(uri: string, version: number, token: CancellationToken): Promise { + // Handle token cancellation. + if (token.isCancellationRequested) { throw new Error("Request cancelled before start."); } + token.onCancellationRequested(() => { throw new Error("Request cancelled during run."); }); + + let document: BaseProjectDocument | undefined; + document = this._parsedDocuments.get(uri); + + // Ensure we have the appropriately versioned document. + while (!document || document.textDocument.version < version) { + await sleep(5); + document = this._parsedDocuments.get(uri); + } + + // Return nothing if the document version is newer than requested. + if (version > 0 && document.textDocument.version != version) { + return; + } + + // Ensure the document is parsed. + while (document.isBusy) { + await sleep(5); + } + + return document; + } + private initialiseConnectionEvents(connection: _Connection) { connection.onInitialized(() => this._onInitialized()); connection.onDidOpenTextDocument(params => this._onDidOpenTextDocumentAsync(params)); @@ -147,6 +183,7 @@ class WorkspaceEvents { connection.onDidChangeWatchedFiles(params => this._onDidChangeWatchedFiles(params)); connection.onDocumentSymbol(async (params, token) => await this._onDocumentSymbolAsync(params, token)); connection.onHover(params => this._onHover(params)); + connection.languages.diagnostics.on(async (params, token) => await this._onDiagnosticAsync(params, token)); if (hasConfigurationCapability(this._configuration)) { connection.onFoldingRanges(async (params, token) => this._onFoldingRangesAsync(params, token)); @@ -197,8 +234,16 @@ class WorkspaceEvents { return document?.languageServerSymbolInformation() ?? []; } - private async _onFoldingRangesAsync(params: FoldingRangeParams, token: CancellationToken): Promise { + private async _onDiagnosticAsync(params: DocumentDiagnosticParams, token: CancellationToken): Promise { const document = await this.activeParsedDocument(0, token); + return document?.languageServerDiagnostics() ?? { + kind: DocumentDiagnosticReportKind.Full, + items: [] + } satisfies DocumentDiagnosticReport; + } + + private async _onFoldingRangesAsync(params: FoldingRangeParams, token: CancellationToken): Promise { + const document = await this.getParsedDocument(params.textDocument.uri, 0, token); const result = document?.languageServerFoldingRanges(); return result ?? []; } @@ -242,7 +287,9 @@ class WorkspaceEvents { } protected async _handleChangeOrOpenAsync(document: TextDocument) { - this._activeDocument = BaseProjectDocument.create(this._workspace, document); + const doc = BaseProjectDocument.create(this._workspace, document); + this._parsedDocuments.set(document.uri, doc); + this._activeDocument = doc; await this._workspace.parseActiveDocument(this._activeDocument); } } diff --git a/server/src/server.ts b/server/src/server.ts index 8c4ca13..fe7f62d 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -45,6 +45,8 @@ class LanguageServer { }); + + this.connection.listen(); } } @@ -56,6 +58,10 @@ export class LanguageServerConfiguration { documentSymbolProvider: true, foldingRangeProvider: true, textDocumentSync: TextDocumentSyncKind.Incremental, + diagnosticProvider: { + interFileDependencies: false, + workspaceDiagnostics: false + }, // Implement soon. codeActionProvider: false, diff --git a/server/tsconfig.tsbuildinfo b/server/tsconfig.tsbuildinfo index 14aa122..6a24b69 100644 --- a/server/tsconfig.tsbuildinfo +++ b/server/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/document.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.2"} \ No newline at end of file +{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/abstractsyntaxtree.ts","./src/project/document.ts","./src/project/objectmodel.ts","./src/project/scope.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.2"} \ No newline at end of file From b6115fd9534f677e6a09f3658dafcb3cc3d3f156 Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 8 Oct 2024 11:12:22 +0800 Subject: [PATCH 06/58] Ignore tsbuildinfo --- .gitignore | 3 ++- server/tsconfig.tsbuildinfo | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4baa129..14d4ba0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ node_modules client/server .vscode-test sample*/** -*.vsix \ No newline at end of file +*.vsix +*.tsbuildinfo \ No newline at end of file diff --git a/server/tsconfig.tsbuildinfo b/server/tsconfig.tsbuildinfo index 14aa122..2086dc1 100644 --- a/server/tsconfig.tsbuildinfo +++ b/server/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/document.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.2"} \ No newline at end of file +{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/antlr/out/vbaprelexer.ts","./src/antlr/out/vbaprelistener.ts","./src/antlr/out/vbapreparser.ts","./src/antlr/out/vbaprevisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/document.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.2"} \ No newline at end of file From abd2b06d041f51b5a00283e77eb995925f5c733c Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 8 Oct 2024 11:13:06 +0800 Subject: [PATCH 07/58] Set up local testing --- package.json | 1 + scripts/e2e.ps1 | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 scripts/e2e.ps1 diff --git a/package.json b/package.json index 2b3e7d8..bbacda3 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "lint": "eslint ./client/src ./server/src --ext .ts,.tsx", "postinstall": "cd client && npm install && cd ../server && npm install && cd ..", "test": "sh ./scripts/e2e.sh", + "testps": "powershell ./scripts/e2e.ps1", "textMate": "npx js-yaml client/src/syntaxes/vba.tmLanguage.yaml > client/out/vba.tmLanguage.json", "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/" }, diff --git a/scripts/e2e.ps1 b/scripts/e2e.ps1 new file mode 100644 index 0000000..8b94b9d --- /dev/null +++ b/scripts/e2e.ps1 @@ -0,0 +1,3 @@ +$ENV:CODE_TESTS_PATH="$(Get-Location)\client\out\test" +$ENV:CODE_TESTS_WORKSPACE="$(Get-Location)\client\testFixture" +Invoke-Expression "node $(Get-Location)\client\out\test\runTest.js" From 767e6d04347562f913e77f302a0dd06d9aaf8a43 Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 8 Oct 2024 11:13:32 +0800 Subject: [PATCH 08/58] Added antlr preparser for compiler directives --- .vscode/launch.json | 10 ++ package.json | 3 +- server/src/antlr/vbapre.g4 | 198 +++++++++++++++++++++++++++++++++++++ 3 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 server/src/antlr/vbapre.g4 diff --git a/.vscode/launch.json b/.vscode/launch.json index b2ca3b6..d82d603 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -46,6 +46,16 @@ "startRule": "startRule", "printParseTree": true, "visualParseTree": true + }, + { + "name": "Debug ANTLR4 Pre grammar", + "type": "antlr-debug", + "request": "launch", + "input": "${file}", + "grammar": "server/src/antlr/vbapre.g4", + "startRule": "startRule", + "printParseTree": true, + "visualParseTree": true } ], "compounds": [ diff --git a/package.json b/package.json index bbacda3..222b6d1 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,8 @@ "test": "sh ./scripts/e2e.sh", "testps": "powershell ./scripts/e2e.ps1", "textMate": "npx js-yaml client/src/syntaxes/vba.tmLanguage.yaml > client/out/vba.tmLanguage.json", - "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/" + "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/", + "antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/" }, "dependencies": { "antlr4ng": "^3.0.7" diff --git a/server/src/antlr/vbapre.g4 b/server/src/antlr/vbapre.g4 new file mode 100644 index 0000000..db5896b --- /dev/null +++ b/server/src/antlr/vbapre.g4 @@ -0,0 +1,198 @@ +grammar vbapre; + +options { + caseInsensitive = true; +} + +// PARSER RULES +startRule + : document EOF + ; + +document + : documentLine* + ; + +documentLine + : compilerIfBlock + | anyOtherLine + | endOfLine + ; + +compilerIfBlock + : compilerIfStatement anyOtherLine* + (compilerElseIfStatement anyOtherLine*)? + (compilerElseStatement anyOtherLine*)? + compilerEndIfStatement + ; + +compilerIfStatement + : IF booleanExpression THEN endOfStatement + ; + +compilerElseIfStatement + : ELSEIF booleanExpression THEN endOfStatement + ; + +compilerElseStatement + : ELSE endOfStatement + ; + +compilerEndIfStatement + : ENDIF endOfStatement + ; + +// ************************* + +booleanExpression + : NOT? compilerConstant ((AND | OR | XOR | EQV | IMP | NOT)+ compilerConstant)* + ; + +compilerConstant + : VBA6 + | VBA7 + | WIN16 + | WIN32 + | WIN64 + | MAC + ; + +anyWord + : ANYCHARS + ; + +anyOtherLine + : anyWord+ endOfLine? + ; + +endOfLine + : (NEWLINE | commentBody | remStatement) + ; + +endOfLineNoWs + : (NEWLINE | commentBody | remStatement) + ; + +endOfStatement + : (endOfLine | COLON)+ + ; + +commentBody: COMMENT; +remStatement: REMCOMMENT; + +// wsc: (WS | LINE_CONTINUATION)+; + + + + +// LEXER RULES + +NEWLINE + : ([\r\n\u2028\u2029] WS?)+ + ; + +ELSE + : '#ELSE' + ; + +ELSEIF + : '#ELSE IF' + ; + +ENDIF + : '#END IF' + ; + +IF + : '#IF' + ; + +THEN + : 'THEN' + ; + +VBA6 + : 'VBA6' + ; + +VBA7 + : 'VBA7' + ; + +WIN16 + : 'WIN16' + ; + +WIN32 + : 'WIN32' + ; + +WIN64 + : 'WIN64' + ; + +MAC + : 'MAC' + ; + +REMCOMMENT + : COLON? REM WS (LINE_CONTINUATION | ~[\r\n\u2028\u2029])* + ; + +COMMENT + : SINGLEQUOTE (LINE_CONTINUATION | ~[\r\n\u2028\u2029])* + ; + +LINE_CONTINUATION + : WS UNDERSCORE WS? '\r'? '\n' -> channel(HIDDEN) + ; + +WS + : ([ \t\u0019\u3000])+ -> channel(HIDDEN) + ; + +UNDERSCORE + : '_' + ; + +COLON + : ':' + ; + +SINGLEQUOTE + : '\'' + ; + +REM + : 'REM' + ; + +EQV + : 'EQV' + ; + +IMP + : 'IMP' + ; + +AND + : 'AND' + ; + +OR + : 'OR' + ; + +XOR + : 'XOR' + ; + +NOT + : 'NOT' + ; + + +// Any non-whitespace or new line characters. +ANYCHARS + : ([^ \t\u0019\u3000\r\n\u2028\u2029])+ + ; \ No newline at end of file From 6e3373c4256ca09864d082bb9579a1d987bb8296 Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 8 Oct 2024 11:15:43 +0800 Subject: [PATCH 09/58] Removed cached --- client/tsconfig.tsbuildinfo | 1 - server/tsconfig.tsbuildinfo | 1 - 2 files changed, 2 deletions(-) delete mode 100644 client/tsconfig.tsbuildinfo delete mode 100644 server/tsconfig.tsbuildinfo diff --git a/client/tsconfig.tsbuildinfo b/client/tsconfig.tsbuildinfo deleted file mode 100644 index 9f52941..0000000 --- a/client/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/extension.ts","./src/test/completion.test.ts","./src/test/diagnostics.test.ts","./src/test/helper.ts","./src/test/index.ts","./src/test/runtest.ts"],"version":"5.6.2"} \ No newline at end of file diff --git a/server/tsconfig.tsbuildinfo b/server/tsconfig.tsbuildinfo deleted file mode 100644 index 2086dc1..0000000 --- a/server/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/antlr/out/vbaprelexer.ts","./src/antlr/out/vbaprelistener.ts","./src/antlr/out/vbapreparser.ts","./src/antlr/out/vbaprevisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/document.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.2"} \ No newline at end of file From 981237a2d07ef3bbd9b9ee9fef7f3bc812b493de Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 8 Oct 2024 11:18:02 +0800 Subject: [PATCH 10/58] Ignore tsbuildinfo --- .vscodeignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscodeignore b/.vscodeignore index 6528078..5af0b1c 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -23,6 +23,7 @@ contributing.md *.interp *.tokens *.vsix +*.tsbuildinfo # Samples and testing sample*/** From 0a752d64c3efe8f8622f621698009a1620e53f7d Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 8 Oct 2024 11:23:16 +0800 Subject: [PATCH 11/58] Cancellation already handled --- server/src/project/document.ts | 2 +- server/src/project/parser/vbaSyntaxParser.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 5db51a4..9574f53 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -154,7 +154,7 @@ export abstract class BaseProjectDocument { } // Parse the document. - await (new SyntaxParser()).parseAsync(this, token) + await (new SyntaxParser()).parseAsync(this) // Evaluate the diagnostics. this._hasDiagnosticElements.forEach(element => { diff --git a/server/src/project/parser/vbaSyntaxParser.ts b/server/src/project/parser/vbaSyntaxParser.ts index b25fccb..20d733b 100644 --- a/server/src/project/parser/vbaSyntaxParser.ts +++ b/server/src/project/parser/vbaSyntaxParser.ts @@ -5,14 +5,13 @@ import { ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredA import { vbaListener } from '../../antlr/out/vbaListener'; import { DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; -import { CancellationToken } from 'vscode-languageserver'; import { CharStream, CommonTokenStream, DefaultErrorStrategy, ErrorNode, ParseTreeWalker, Parser, RecognitionException } from 'antlr4ng'; import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; import { ConstDeclarationElement, DeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; import { WhileLoopElement } from '../elements/flow'; export class SyntaxParser { - async parseAsync(document: VbaClassDocument | VbaModuleDocument, token: CancellationToken): Promise { + async parseAsync(document: VbaClassDocument | VbaModuleDocument): Promise { console.debug(`Parse requested: ${document.textDocument.version}`); const listener = new VbaListener(document); await listener.ensureHasSettings(); From bcdc4fc12db8a740c5e6146b98ff2c6ca89ac48b Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 9 Oct 2024 17:11:45 +0800 Subject: [PATCH 12/58] remove tsbuildinfo --- client/tsconfig.tsbuildinfo | 1 - server/tsconfig.tsbuildinfo | 1 - 2 files changed, 2 deletions(-) delete mode 100644 client/tsconfig.tsbuildinfo delete mode 100644 server/tsconfig.tsbuildinfo diff --git a/client/tsconfig.tsbuildinfo b/client/tsconfig.tsbuildinfo deleted file mode 100644 index d5e29aa..0000000 --- a/client/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/extension.ts","./src/test/completion.test.ts","./src/test/diagnostics.test.ts","./src/test/helper.ts","./src/test/index.ts","./src/test/runtest.ts"],"version":"5.6.3"} \ No newline at end of file diff --git a/server/tsconfig.tsbuildinfo b/server/tsconfig.tsbuildinfo deleted file mode 100644 index ded02bc..0000000 --- a/server/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/server.ts","./src/antlr/out/vbalexer.ts","./src/antlr/out/vbalistener.ts","./src/antlr/out/vbaparser.ts","./src/antlr/out/vbavisitor.ts","./src/capabilities/diagnostics.ts","./src/capabilities/folding.ts","./src/capabilities/semantictokens.ts","./src/capabilities/symbolinformation.ts","./src/capabilities/workspacefolder.ts","./src/extensions/parserextensions.ts","./src/extensions/stringextensions.ts","./src/project/document.ts","./src/project/workspace.ts","./src/project/elements/base.ts","./src/project/elements/flow.ts","./src/project/elements/memory.ts","./src/project/elements/module.ts","./src/project/elements/operator.ts","./src/project/elements/special.ts","./src/project/parser/vbasyntaxparser.ts","./src/utils/helpers.ts"],"version":"5.6.3"} From d3d0565f73f4406eec7f413ee8aabd1ad5ac9f3a Mon Sep 17 00:00:00 2001 From: sslinky Date: Sat, 19 Oct 2024 23:13:46 +0800 Subject: [PATCH 13/58] Add environment settings --- package.json | 22 ++++++++++++++++++++++ server/src/project/document.ts | 8 ++++++++ 2 files changed, 30 insertions(+) diff --git a/package.json b/package.json index 64ec2b2..5203780 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,28 @@ "default": true, "description": "The language server should warn when Option Explicit is not present." }, + "vbaLanguageServer.environment.os": { + "scope": "resource", + "type": "string", + "enum": [ + "Win16", + "Win32", + "Win64", + "Mac" + ], + "default": "Win64", + "description": "Controls which compiler sections to display." + }, + "vbaLanguageServer.environment.version": { + "scope": "resource", + "type": "string", + "enum": [ + "Vba6", + "Vba7" + ], + "default": "Vba7", + "description": "Controls which compiler sections to display." + }, "vbaLanguageServer.trace.server": { "scope": "window", "type": "string", diff --git a/server/src/project/document.ts b/server/src/project/document.ts index e70cb9e..9d6f00f 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -14,6 +14,10 @@ export interface DocumentSettings { maxDocumentLines: number; maxNumberOfProblems: number; doWarnOptionExplicitMissing: boolean; + environment: { + os: string; + version: string; + } } export abstract class BaseProjectDocument { @@ -85,6 +89,10 @@ export abstract class BaseProjectDocument { maxDocumentLines: 1500, maxNumberOfProblems: 100, doWarnOptionExplicitMissing: true, + environment: { + os: "Win64", + version: "Vba7" + } }; return this._documentConfiguration; } From f11b1352b843828fc60ae020d2c95194df3e22cb Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 20 Oct 2024 00:12:36 +0800 Subject: [PATCH 14/58] Refactor parsing and add preparser --- server/src/antlr/vbapre.g4 | 63 ++-- server/src/project/parser/vbaAntlr.ts | 65 ++++ server/src/project/parser/vbaListener.ts | 210 ++++++++++++ server/src/project/parser/vbaParser.ts | 32 ++ server/src/project/parser/vbaSyntaxParser.ts | 316 ------------------- 5 files changed, 351 insertions(+), 335 deletions(-) create mode 100644 server/src/project/parser/vbaAntlr.ts create mode 100644 server/src/project/parser/vbaListener.ts create mode 100644 server/src/project/parser/vbaParser.ts delete mode 100644 server/src/project/parser/vbaSyntaxParser.ts diff --git a/server/src/antlr/vbapre.g4 b/server/src/antlr/vbapre.g4 index db5896b..b425dbf 100644 --- a/server/src/antlr/vbapre.g4 +++ b/server/src/antlr/vbapre.g4 @@ -7,31 +7,42 @@ options { // PARSER RULES startRule : document EOF + // : anyOtherLine EOF ; document - : documentLine* + : (documentLines | compilerIfBlock)* ; -documentLine - : compilerIfBlock - | anyOtherLine - | endOfLine - ; +documentLines + : (anyOtherLine | endOfLine)+ + ; compilerIfBlock - : compilerIfStatement anyOtherLine* - (compilerElseIfStatement anyOtherLine*)? - (compilerElseStatement anyOtherLine*)? + : compilerConditionalBlock+ + compilerDefaultBlock? compilerEndIfStatement ; +compilerConditionalBlock + : compilerConditionalStatement (anyOtherLine | endOfLine)* + ; + +compilerDefaultBlock + : compilerElseStatement anyOtherLine* + ; + +compilerConditionalStatement + : compilerIfStatement + | compilerElseIfStatement + ; + compilerIfStatement - : IF booleanExpression THEN endOfStatement + : IF WS? booleanExpression WS? THEN endOfStatement ; compilerElseIfStatement - : ELSEIF booleanExpression THEN endOfStatement + : ELSEIF WS? booleanExpression WS? THEN endOfStatement ; compilerElseStatement @@ -45,7 +56,11 @@ compilerEndIfStatement // ************************* booleanExpression - : NOT? compilerConstant ((AND | OR | XOR | EQV | IMP | NOT)+ compilerConstant)* + : booleanPart+ + ; + +booleanPart + : WS? (AND | OR | XOR | EQV | IMP)? WS? NOT? WS? compilerConstant ; compilerConstant @@ -58,15 +73,15 @@ compilerConstant ; anyWord - : ANYCHARS + : ANYCHARS+ ; anyOtherLine - : anyWord+ endOfLine? + : (WS* anyWord)+ //endOfLine? ; endOfLine - : (NEWLINE | commentBody | remStatement) + : (WS* (NEWLINE | commentBody | remStatement))+ ; endOfLineNoWs @@ -88,7 +103,9 @@ remStatement: REMCOMMENT; // LEXER RULES NEWLINE - : ([\r\n\u2028\u2029] WS?)+ + // Match at least one new line but then any number + // of blank lines, including white space. + : ([\r\n\u2028\u2029]) (WS* ([\r\n\u2028\u2029]))* ; ELSE @@ -148,10 +165,14 @@ LINE_CONTINUATION ; WS - : ([ \t\u0019\u3000])+ -> channel(HIDDEN) + : NBSP NBSP* ; -UNDERSCORE +fragment NBSP + : [ \t\u0019\u3000] + ; + +fragment UNDERSCORE : '_' ; @@ -194,5 +215,9 @@ NOT // Any non-whitespace or new line characters. ANYCHARS - : ([^ \t\u0019\u3000\r\n\u2028\u2029])+ + : ANYCHAR + ; + +fragment ANYCHAR + : . ; \ No newline at end of file diff --git a/server/src/project/parser/vbaAntlr.ts b/server/src/project/parser/vbaAntlr.ts new file mode 100644 index 0000000..11eeea5 --- /dev/null +++ b/server/src/project/parser/vbaAntlr.ts @@ -0,0 +1,65 @@ +import { vbaLexer } from '../../antlr/out/vbaLexer'; +import { vbaParser } from '../../antlr/out/vbaParser'; +import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; +import { DefaultErrorStrategy, Parser, RecognitionException } from 'antlr4ng'; +import { vbapreLexer } from '../../antlr/out/vbapreLexer'; +import { vbapreParser } from '../../antlr/out/vbapreParser'; + +export class VbaLexer extends vbaLexer { + constructor(input: CharStream) { + super(input); + } + + static create(doc: string): VbaLexer { + return new VbaLexer(CharStream.fromString(doc)) + } +} + +export class VbaParser extends vbaParser { + constructor(input: TokenStream) { + super(input); + + } + + static create(document: string): VbaParser { + const lexer = VbaLexer.create(document); + const parser = new VbaParser(new CommonTokenStream(lexer)); + parser.removeErrorListeners(); + parser.errorHandler = new VbaErrorHandler(); + return parser; + } +} + +export class VbaPreLexer extends vbapreLexer { + constructor(input: CharStream) { + super(input); + } + + static create(doc: string): VbaPreLexer { + return new VbaPreLexer(CharStream.fromString(doc)) + } +} + +export class VbaPreParser extends vbapreParser { + constructor(input: TokenStream) { + super(input); + } + + static create(document: string): VbaPreParser { + const lexer = VbaPreLexer.create(document); + const parser = new VbaPreParser(new CommonTokenStream(lexer)); + parser.removeErrorListeners(); + parser.errorHandler = new VbaErrorHandler(); + return parser; + } +} + +export class VbaErrorHandler extends DefaultErrorStrategy { + recover(recognizer: Parser, e: RecognitionException): void { + const inputStream = recognizer.inputStream; + // if (!recognizer.isMatchedEOF) { + inputStream.consume(); + // } + this.endErrorCondition(recognizer); + } +} \ No newline at end of file diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts new file mode 100644 index 0000000..d4a1590 --- /dev/null +++ b/server/src/project/parser/vbaListener.ts @@ -0,0 +1,210 @@ +import { ErrorNode } from 'antlr4ng'; +import { vbaListener } from '../../antlr/out/vbaListener'; +import { ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; + +import { DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; + +import { WhileLoopElement } from '../elements/flow'; +import { IgnoredAttributeElement } from '../elements/module'; +import { ConstDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; +import { vbapreListener } from '../../antlr/out/vbapreListener'; +import { CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; +import { CompilerIfBlockElement } from '../elements/special'; + + +class CommonParserCapability { + document: VbaClassDocument | VbaModuleDocument; + protected _documentSettings?: DocumentSettings; + protected _isAfterMethodDeclaration = false; + + get documentSettings(): DocumentSettings { + if (!this._documentSettings) { + throw new Error("Sad times"); + + } + return this._documentSettings; + } + + constructor(document: VbaClassDocument | VbaModuleDocument) { + this.document = document; + } + + async ensureHasSettingsAsync() { + this._documentSettings = await this.document.getDocumentConfiguration(); + } +} + +export class VbaListener extends vbaListener { + document: VbaClassDocument | VbaModuleDocument; + protected _documentSettings?: DocumentSettings; + protected _isAfterMethodDeclaration = false; + + constructor(document: VbaClassDocument | VbaModuleDocument) { + super(); + this.document = document; + } + + static async createAsync(document: VbaClassDocument | VbaModuleDocument): Promise { + const result = new VbaListener(document); + await result.ensureHasSettingsAsync(); + return result; + } + + async ensureHasSettingsAsync() { + this._documentSettings = await this.document.getDocumentConfiguration(); + } + + enterEnumDeclaration = (ctx: EnumDeclarationContext) => { + const element = new EnumDeclarationElement(ctx, this.document.textDocument, this._isAfterMethodDeclaration); + this.document.registerFoldableElement(element) + // .registerScopedElement(element) + .registerSemanticToken(element) + .registerSymbolInformation(element) + .registerDiagnosticElement(element); + element.declaredNames.forEach(names => + names.forEach(name => this.document + .registerSemanticToken(name) + .registerSymbolInformation(name)) + ); + }; + + // exitEnumDeclaration = (_: EnumDeclarationContext) => { + // this.document.deregisterScopedElement(); + // }; + + // enterClassModule = (ctx: ClassModuleContext) => { + // const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); + // this.document.registerSymbolInformation(element) + // .registerDiagnosticElement(element) + // .registerScopedElement(element); + // }; + + // exitClassModule = (ctx: ClassModuleContext) => { + // this.document.deregisterScopedElement(); + // }; + + enterConstItem = (ctx: ConstItemContext) => { + const element = new ConstDeclarationElement(ctx, this.document.textDocument); + this.document.registerSemanticToken(element) + .registerSymbolInformation(element); + }; + + enterIgnoredAttr = (ctx: IgnoredAttrContext) => { + const element = new IgnoredAttributeElement(ctx, this.document.textDocument); + this.document.registerDiagnosticElement(element); + }; + + // enterProceduralModule = (ctx: ProceduralModuleContext) => { + // const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); + // this.document.registerSymbolInformation(element) + // .registerDiagnosticElement(element) + // .registerScopedElement(element); + // }; + + // exitProceduralModule = (ctx: ProceduralModuleContext) => { + // this.document.deregisterScopedElement(); + // }; + + // enterProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { + // const element = DeclarationElement.create(ctx, this.document); + // this.document.registerSymbolInformation(element) + // .registerFoldableElement(element) + // .registerScopedElement(element); + + // if (element.isPropertyElement() && element.countDeclarations === 1) { + // this.document.registerDiagnosticElement(element) + // .registerNamedElement(element); + // } + // }; + + exitProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { + this._isAfterMethodDeclaration = true; + // this.document.deregisterScopedElement(); + }; + + enterUdtDeclaration = (ctx: UdtDeclarationContext) => { + const element = new TypeDeclarationElement(ctx, this.document.textDocument); + this.document.registerFoldableElement(element) + .registerSemanticToken(element) + .registerSymbolInformation(element); + element.declaredNames.forEach(names => + names.forEach(name => this.document + .registerSemanticToken(name) + .registerSymbolInformation(name)) + ); + }; + + enterWhileStatement = (ctx: WhileStatementContext) => { + const element = new WhileLoopElement(ctx, this.document.textDocument); + this.document.registerDiagnosticElement(element); + }; + + visitErrorNode(node: ErrorNode) { + console.log(node.getPayload()); + } + + // enterAttributeStmt = (ctx: AttributeStmtContext) => { + // this.document.activeAttributeElement?.processAttribute(ctx); + // }; + + // enterConstStmt = (ctx: ConstStmtContext) => { + // const element = new ConstDeclarationsElement(ctx, this.document.textDocument); + // element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); + // }; + + // enterOperatorsStmt = (ctx: OperatorsStmtContext) => { + // const element = new OperatorElement(ctx, this.document.textDocument); + // this.document.registerDiagnosticElement(element); + // enterModule = (ctx: ModuleContext) => { + // const element = new ModuleElement(ctx, this.document.textDocument, this.document.symbolKind); + // this.document.registerAttributeElement(element) + // .registerScopedElement(element); + // }; + + // enterTypeStmt = (ctx: TypeStmtContext) => { + // const element = new TypeDeclarationElement(ctx, this.document.textDocument); + // this.document.registerSymbolInformation(element) + // .registerSemanticToken(element); + // }; + + // enterVariableStmt = (ctx: VariableStmtContext) => { + // const element = new VariableDeclarationsElement(ctx, this.document.textDocument); + // element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); + // }; + + // enterWhileWendStmt = (ctx: WhileWendStmtContext) => { + // const element = new WhileWendLoopElement(ctx, this.document.textDocument); + // this.document.registerDiagnosticElement(element); + // }; +} + +export class VbaPreListener extends vbapreListener { + common: CommonParserCapability; + private _documentText: string; + + get text(): string { + return this._documentText; + } + + constructor(document: VbaClassDocument | VbaModuleDocument) { + super(); + this.common = new CommonParserCapability(document); + this._documentText = document.textDocument.getText(); + } + + static async createAsync(document: VbaClassDocument | VbaModuleDocument): Promise { + const result = new VbaPreListener(document); + await result.common.ensureHasSettingsAsync(); + return result; + } + + enterCompilerIfBlock = (ctx: CompilerIfBlockContext) => { + const doc = this.common.document; + const docprops = this.common.documentSettings; + const element = new CompilerIfBlockElement(ctx, doc.textDocument, docprops); + + element.inactiveChildren.forEach(e => doc.registerCommentBlock(e)); + // TODO: Semantic tokens don't appear to be able to go across lines + // so I'll need to add _each line_ separately! + } +} \ No newline at end of file diff --git a/server/src/project/parser/vbaParser.ts b/server/src/project/parser/vbaParser.ts new file mode 100644 index 0000000..9d99826 --- /dev/null +++ b/server/src/project/parser/vbaParser.ts @@ -0,0 +1,32 @@ +import { ParseTreeWalker } from 'antlr4ng'; + +import { VbaClassDocument, VbaModuleDocument } from '../document'; +import { VbaListener, VbaPreListener } from './vbaListener'; +import { VbaParser, VbaPreParser } from './vbaAntlr'; + +export class SyntaxParser { + async parseAsync(document: VbaClassDocument | VbaModuleDocument): Promise { + // Preparse the document if we find a precompiler statement. + const regexp = new RegExp(/^\s*#If/gmi) + let docText = document.textDocument.getText(); + if (regexp.test(docText)) { + const prelistener = await VbaPreListener.createAsync(document); + const preparser = VbaPreParser.create(docText); + await this._parseAsync(prelistener, preparser); + docText = prelistener.text; + } + + // Perform main document parse without compiler directives. + const listener = await VbaListener.createAsync(document); + const parser = VbaParser.create(docText); + await this._parseAsync(listener, parser); + return true; + } + + private async _parseAsync(listener: VbaListener | VbaPreListener, parser: VbaParser | VbaPreParser) { + ParseTreeWalker.DEFAULT.walk( + listener, + parser.startRule() + ); + } +} diff --git a/server/src/project/parser/vbaSyntaxParser.ts b/server/src/project/parser/vbaSyntaxParser.ts deleted file mode 100644 index 82b00cc..0000000 --- a/server/src/project/parser/vbaSyntaxParser.ts +++ /dev/null @@ -1,316 +0,0 @@ -import { TextDocument } from 'vscode-languageserver-textdocument'; - -import { vbaLexer } from '../../antlr/out/vbaLexer'; -import { ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext, vbaParser } from '../../antlr/out/vbaParser'; -import { vbaListener } from '../../antlr/out/vbaListener'; - -import { DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; -import { CharStream, CommonTokenStream, DefaultErrorStrategy, ErrorNode, ParseTreeWalker, Parser, RecognitionException } from 'antlr4ng'; -import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; -import { ConstDeclarationElement, ProcedureDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; -import { WhileLoopElement } from '../elements/flow'; - -export class SyntaxParser { - async parseAsync(document: VbaClassDocument | VbaModuleDocument): Promise { - console.debug(`Parse requested: ${document.textDocument.version}`); - const listener = new VbaListener(document); - await listener.ensureHasSettings(); - const parser = this.createParser(document.textDocument); - ParseTreeWalker.DEFAULT.walk( - listener, - parser.startRule() - ); - return true; - } - - private createParser(doc: TextDocument): VbaParser { - const lexer = new VbaLexer(CharStream.fromString(doc.getText())); - const parser = new VbaParser(new CommonTokenStream(lexer)); - - parser.removeErrorListeners(); - parser.errorHandler = new VbaErrorHandler(); - return parser; - } -} - -class VbaLexer extends vbaLexer { - constructor(input: CharStream) { - super(input); - } -} - -class VbaParser extends vbaParser { - -} - -class VbaListener extends vbaListener { - document: VbaClassDocument | VbaModuleDocument; - protected _documentSettings?: DocumentSettings; - protected _isAfterMethodDeclaration = false; - - constructor(document: VbaClassDocument | VbaModuleDocument) { - super(); - this.document = document; - } - - async ensureHasSettings() { - this._documentSettings = await this.document.getDocumentConfiguration(); - } - - enterEnumDeclaration = (ctx: EnumDeclarationContext) => { - const element = new EnumDeclarationElement(ctx, - this.document.textDocument, - this._isAfterMethodDeclaration, - ); - - // Element registrations. - this.document.registerFoldableElement(element) - .registerSemanticToken(element) - .registerSymbolInformation(element) - .registerDiagnosticElement(element); - - // this.document.registerScope() - element.declaredNames.forEach(names => - names.forEach(name => this.document - .registerSemanticToken(name) - .registerSymbolInformation(name)) - ); - }; - - // exitEnumDeclaration = (_: EnumDeclarationContext) => { - // this.document.deregisterScope(); - // }; - - enterClassModule = (ctx: ClassModuleContext) => { - const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? {doWarnOptionExplicitMissing: true}); - this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element); - this.document.registerScope(); - }; - - exitClassModule = (_: ClassModuleContext) => { - this.document.deregisterScope(); - }; - - enterConstItem = (ctx: ConstItemContext) => { - const element = new ConstDeclarationElement(ctx, this.document.textDocument); - this.document.registerSemanticToken(element) - .registerSymbolInformation(element) - .registerNamedElementDeclaration(element) - .registerDiagnosticElement(element); - }; - - enterIgnoredAttr = (ctx: IgnoredAttrContext) => { - const element = new IgnoredAttributeElement(ctx, this.document.textDocument); - this.document.registerDiagnosticElement(element); - }; - - enterProceduralModule = (ctx: ProceduralModuleContext) => { - const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? {doWarnOptionExplicitMissing: true}); - this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element); - this.document.registerScope(); - }; - - exitProceduralModule = (_: ProceduralModuleContext) => { - this.document.deregisterScope(); - }; - - enterProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { - const element = ProcedureDeclarationElement.create(ctx, this.document); - this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element) - .registerFoldableElement(element); - - if (element.isPropertyElement() && element.countDeclarations === 1) { - this.document.registerDiagnosticElement(element) - .registerNamedElement(element); - } else { - // TODO: Figure out how to do properties differently as it affects the way you access them. - // Maybe all need some `{ get-let: type, get-set: type, set: type, let: type }` types where functions will have get-let or get-set, - // variables will have a getter and a setter of the same type (set or let) and properties will have whatever they have. - this.document.registerNamedElementDeclaration(element); - } - - this.document.registerScope(); - }; - - exitProcedureDeclaration = (_: ProcedureDeclarationContext) => { - this._isAfterMethodDeclaration = true; - this.document.deregisterScope(); - }; - - enterUdtDeclaration = (ctx: UdtDeclarationContext) => { - const element = new TypeDeclarationElement(ctx, this.document.textDocument); - this.document.registerFoldableElement(element) - .registerSemanticToken(element) - .registerSymbolInformation(element); - element.declaredNames.forEach(names => - names.forEach(name => this.document - .registerSemanticToken(name) - .registerSymbolInformation(name)) - ); - }; - - enterWhileStatement = (ctx: WhileStatementContext) => { - const element = new WhileLoopElement(ctx, this.document.textDocument); - this.document.registerDiagnosticElement(element); - }; - - visitErrorNode(node: ErrorNode) { - console.log(node.getPayload()); - } - - // enterAttributeStmt = (ctx: AttributeStmtContext) => { - // this.document.activeAttributeElement?.processAttribute(ctx); - // }; - - // enterConstStmt = (ctx: ConstStmtContext) => { - // const element = new ConstDeclarationsElement(ctx, this.document.textDocument); - // element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); - // }; - - // enterOperatorsStmt = (ctx: OperatorsStmtContext) => { - // const element = new OperatorElement(ctx, this.document.textDocument); - // this.document.registerDiagnosticElement(element); - // enterModule = (ctx: ModuleContext) => { - // const element = new ModuleElement(ctx, this.document.textDocument, this.document.symbolKind); - // this.document.registerAttributeElement(element) - // .registerScopedElement(element); - // }; - - // enterTypeStmt = (ctx: TypeStmtContext) => { - // const element = new TypeDeclarationElement(ctx, this.document.textDocument); - // this.document.registerSymbolInformation(element) - // .registerSemanticToken(element); - // }; - - // enterVariableStmt = (ctx: VariableStmtContext) => { - // const element = new VariableDeclarationsElement(ctx, this.document.textDocument); - // element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); - // }; - - // enterWhileWendStmt = (ctx: WhileWendStmtContext) => { - // const element = new WhileWendLoopElement(ctx, this.document.textDocument); - // this.document.registerDiagnosticElement(element); - // }; -} - -class VbaErrorHandler extends DefaultErrorStrategy { - recover(recognizer: Parser, e: RecognitionException): void { - const inputStream = recognizer.inputStream; - // if (!recognizer.isMatchedEOF) { - inputStream.consume(); - // } - this.endErrorCondition(recognizer); - } -} - -// class VbaErrorListener extends ConsoleErrorListener { -// syntaxError(recognizer: Recognizer, offendingSymbol: T, line: number, charPositionInLine: number, msg: string, e: RecognitionException | undefined): void { -// super.syntaxError(recognizer, offendingSymbol, line, charPositionInLine, msg, e); -// console.error(e); -// if (e) { -// const y = recognizer.getErrorHeader(e); -// console.log(y); -// } -// } -// } - -// class VbaTreeWalkListener implements vbaListener { -// document: VbaClassDocument | VbaModuleDocument; - -// constructor(document: VbaClassDocument | VbaModuleDocument) { -// this.document = document; -// } - -// visitErrorNode(node: ErrorNode) { -// console.log(node.payload); -// } - -// enterAttributeStmt = (ctx: AttributeStmtContext) => { -// this.document.activeAttributeElement?.processAttribute(ctx); -// }; - -// enterConstStmt = (ctx: ConstStmtContext) => { -// const element = new ConstDeclarationsElement(ctx, this.document.textDocument); -// element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); -// }; - -// enterEnumerationStmt = (ctx: EnumerationStmtContext) => { -// const element = new EnumBlockDeclarationElement(ctx, this.document.textDocument); -// this.document.registerFoldableElement(element); -// this.document.registerSemanticToken(element); -// this.document.registerSymbolInformation(element); -// this.document.registerScopedElement(element); -// }; - -// exitEnumerationStmt = (_: EnumerationStmtContext) => { -// console.warn("Entered enum statement."); -// this.document.deregisterScopedElement(); -// }; - -// enterEnumerationStmt_Constant = (ctx: EnumerationStmt_ConstantContext) => { -// const element = new EnumMemberDeclarationElement(ctx, this.document.textDocument); -// this.document.registerSymbolInformation(element); -// this.document.registerSemanticToken(element); -// }; - -// enterFoldingBlockStmt = (ctx: FoldingBlockStmtContext) => { -// const element = new FoldableElement(ctx, this.document.textDocument); -// this.document.registerFoldableElement(element); -// }; - -// enterMethodStmt = (ctx: MethodStmtContext) => { -// const element = new MethodBlockDeclarationElement(ctx, this.document.textDocument); -// this.document.registerNamedElement(element); -// this.document.registerFoldableElement(element); -// this.document.registerSymbolInformation(element); -// this.document.registerScopedElement(element); -// }; - -// exitMethodStmt = (_: MethodStmtContext) => { -// this.document.deregisterScopedElement(); -// }; - -// enterModule = (ctx: ModuleContext) => { -// const element = new ModuleElement(ctx, this.document.textDocument, this.document.symbolKind); -// this.document.registerAttributeElement(element); -// this.document.registerScopedElement(element); -// }; - -// exitModule = (_: ModuleContext) => { -// const element = this.document.deregisterAttributeElement() as ModuleElement; -// this.document.registerSymbolInformation(element); -// this.document.deregisterScopedElement(); -// this.document.deregisterAttributeElement(); -// }; - -// enterModuleHeader = (ctx: ModuleHeaderContext) => { -// const element = new FoldableElement(ctx, this.document.textDocument); -// this.document.registerFoldableElement(element); -// }; - -// enterVariableStmt = (ctx: VariableStmtContext) => { -// console.warn("Entered value statement. " + ctx.text); -// const element = new VariableDeclarationsElement(ctx, this.document.textDocument); -// element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); -// }; - -// enterOperatorsStmt = (ctx: OperatorsStmtContext) => { -// const element = new OperatorElement(ctx, this.document.textDocument); -// this.document.registerDiagnosticElement(element); -// }; -// } - -// class VbaErrorListener extends ConsoleErrorListener { -// syntaxError(recognizer: Recognizer, offendingSymbol: T, line: number, charPositionInLine: number, msg: string, e: RecognitionException | undefined): void { -// super.syntaxError(recognizer, offendingSymbol, line, charPositionInLine, msg, e); -// console.error(e); -// if (e) { -// const y = recognizer.getErrorHeader(e); -// console.log(y); -// } -// recognizer.inputStream?.consume(); -// } -// } From b35d626901c26930e1f7813a04fcd1cb66153600 Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 19 Nov 2024 12:42:12 +0800 Subject: [PATCH 15/58] All the things --- server/src/capabilities/semanticTokens.ts | 46 +++++++++---- server/src/project/document.ts | 11 ++- server/src/project/elements/base.ts | 9 ++- server/src/project/elements/memory.ts | 6 +- server/src/project/elements/special.ts | 82 ++++++++++++++++++++++- 5 files changed, 132 insertions(+), 22 deletions(-) diff --git a/server/src/capabilities/semanticTokens.ts b/server/src/capabilities/semanticTokens.ts index 5725e33..74b1f54 100644 --- a/server/src/capabilities/semanticTokens.ts +++ b/server/src/capabilities/semanticTokens.ts @@ -1,5 +1,5 @@ import {InitializeResult, Range, SemanticTokenModifiers, SemanticTokenTypes, uinteger, _LanguagesImpl, SemanticTokens, SemanticTokensParams, SemanticTokensRangeParams} from 'vscode-languageserver'; -import { HasSemanticToken } from '../project/elements/base'; +import { BaseContextSyntaxElement, HasNamedSemanticToken, HasSemanticToken } from '../project/elements/base'; const registeredTokenTypes = new Map((Object.keys(SemanticTokenTypes) as (keyof typeof SemanticTokenTypes)[]).map((k, i) => ([k, i]))); const registeredTokenModifiers = new Map((Object.keys(SemanticTokenModifiers) as (keyof typeof SemanticTokenModifiers)[]).map((k, i) => ([k, 2**i]))); @@ -33,9 +33,9 @@ export class SemanticToken { length: uinteger; tokenType: uinteger; tokenModifiers: uinteger = 0; - element: HasSemanticToken; + element: HasNamedSemanticToken | HasSemanticToken; - constructor(element: HasSemanticToken, line: uinteger, startChar: uinteger, length: uinteger, tokenType: SemanticTokenTypes, tokenModifiers: SemanticTokenModifiers[]) { + constructor(element: HasNamedSemanticToken | HasSemanticToken, line: uinteger, startChar: uinteger, length: uinteger, tokenType: SemanticTokenTypes, tokenModifiers: SemanticTokenModifiers[]) { this.element = element; this.line = line; this.char = startChar; @@ -44,15 +44,31 @@ export class SemanticToken { tokenModifiers.forEach((x) => this.tokenModifiers += registeredTokenModifiers.get(x) ?? 0); } - static create(element: HasSemanticToken): SemanticToken { - return new SemanticToken( - element, - element.identifier.range.start.line, - element.identifier.range.start.character, - element.identifier.context.getText().length, - element.tokenType, - element.tokenModifiers - ); + static create(st: HasSemanticToken): SemanticToken; + static create(nst: HasNamedSemanticToken): SemanticToken; + static create(element: HasSemanticToken | HasNamedSemanticToken): SemanticToken { + if (((o: any): o is HasNamedSemanticToken => 'identifier' in o)(element)) { + return new SemanticToken( + element, + element.identifier.range.start.line, + element.identifier.range.start.character, + element.identifier.context.getText().length, + element.tokenType, + element.tokenModifiers + ); + } + if (((o: any): o is HasSemanticToken => 'tokenType' in o)(element)) { + return new SemanticToken( + element, + element.range.start.line, + element.range.start.character, + element.context.getText().length, + element.tokenType, + element.tokenModifiers + ); + } + + throw new Error("This will never be thrown but it appeases the linter."); } toNewRange(range: Range): SemanticToken { @@ -98,7 +114,11 @@ export class SemanticTokensManager { private _tokensInRange = (range: Range) => this._tokens.filter(token => token.element.isChildOf(range)); - add(element: HasSemanticToken) { + add(element: HasNamedSemanticToken) { + this._tokens.push(SemanticToken.create(element)); + } + + addComment(element: HasSemanticToken) { this._tokens.push(SemanticToken.create(element)); } diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 9d6f00f..2bb1c97 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -1,9 +1,9 @@ import { CancellationToken, Diagnostic, DocumentDiagnosticReport, DocumentDiagnosticReportKind, PublishDiagnosticsParams, SymbolInformation, SymbolKind } from 'vscode-languageserver'; import { Workspace } from './workspace'; import { FoldableElement, IdentifiableScopeElement } from './elements/special'; -import { DeclarationElement, HasDiagnosticCapability, HasSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement } from './elements/base'; +import { BaseContextSyntaxElement, DeclarationElement, HasDiagnosticCapability, HasNamedSemanticToken, HasSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement } from './elements/base'; import { Range, TextDocument } from 'vscode-languageserver-textdocument'; -import { SyntaxParser } from './parser/vbaSyntaxParser'; +import { SyntaxParser } from './parser/vbaParser'; import { FoldingRange } from '../capabilities/folding'; import { SemanticTokensManager } from '../capabilities/semanticTokens'; import { ParseCancellationException } from 'antlr4ng'; @@ -275,11 +275,16 @@ export abstract class BaseProjectDocument { * @param element element The element that has a semantic token. * @returns this for chaining. */ - registerSemanticToken = (element: HasSemanticToken) => { + registerSemanticToken = (element: HasNamedSemanticToken) => { this._semanticTokens.add(element); return this; }; + registerCommentBlock = (element: HasSemanticToken) => { + this._semanticTokens.addComment(element); + return this; + } + /** * Registers a SymbolInformation. * @param element The element that has symbol information. diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index 866650c..4c2b5c6 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -39,7 +39,14 @@ export interface HasSymbolInformation extends NamedSyntaxElement { get symbolInformation(): SymbolInformation; } -export interface HasSemanticToken extends NamedSyntaxElement, IdentifiableSyntaxElement { +export interface HasNamedSemanticToken extends NamedSyntaxElement, IdentifiableSyntaxElement { + tokenType: SemanticTokenTypes; + tokenModifiers: SemanticTokenModifiers[]; +} + +export interface HasSemanticToken extends SyntaxElement { + range: Range; + context: ParserRuleContext; tokenType: SemanticTokenTypes; tokenModifiers: SemanticTokenModifiers[]; } diff --git a/server/src/project/elements/memory.ts b/server/src/project/elements/memory.ts index 9f12bc8..078e8fa 100644 --- a/server/src/project/elements/memory.ts +++ b/server/src/project/elements/memory.ts @@ -2,7 +2,7 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, SemanticTokenModifiers, SemanticTokenTypes, SymbolInformation, SymbolKind } from 'vscode-languageserver'; import { AmbiguousIdentifierContext, ConstItemContext, EnumDeclarationContext, EnumMemberContext, FunctionDeclarationContext, ProcedureDeclarationContext, PropertyGetDeclarationContext, PropertySetDeclarationContext, PublicConstDeclarationContext, ReservedMemberNameContext, SubroutineDeclarationContext, UdtDeclarationContext, UdtElementContext, UntypedNameContext, VariableDclContext } from '../../antlr/out/vbaParser'; -import { BaseContextSyntaxElement, DeclarationElement, HasDiagnosticCapability, HasSemanticToken, HasSymbolInformation, NamedSyntaxElement } from './base'; +import { BaseContextSyntaxElement, DeclarationElement, HasDiagnosticCapability, HasNamedSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement, NamedSyntaxElement } from './base'; import { VbaClassDocument, VbaModuleDocument } from '../document'; import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; @@ -198,7 +198,7 @@ class PropertySetDeclarationElement extends ProcedureDeclarationElement { } } -abstract class BaseEnumDeclarationElement extends ScopeElement implements HasSemanticToken, HasSymbolInformation { +abstract class BaseEnumDeclarationElement extends ScopeElement implements HasNamedSemanticToken, HasSymbolInformation, NamedSyntaxElement, IdentifiableSyntaxElement { identifier: IdentifierElement; tokenModifiers: SemanticTokenModifiers[] = []; declaredNames: Map = new Map(); @@ -338,7 +338,7 @@ export class ConstDeclarationElement extends BaseVariableDeclarationStatementEle // } } -export class TypeDeclarationElement extends ScopeElement implements HasSemanticToken, HasSymbolInformation, NamedSyntaxElement { +export class TypeDeclarationElement extends ScopeElement implements HasNamedSemanticToken, HasSymbolInformation, NamedSyntaxElement, IdentifiableSyntaxElement { tokenType: SemanticTokenTypes; tokenModifiers: SemanticTokenModifiers[] = []; identifier: IdentifierElement; diff --git a/server/src/project/elements/special.ts b/server/src/project/elements/special.ts index 2166b59..9482344 100644 --- a/server/src/project/elements/special.ts +++ b/server/src/project/elements/special.ts @@ -1,9 +1,11 @@ +import * as ts from "typescript"; import { ParserRuleContext } from 'antlr4ng'; import { FoldingRangeKind } from '../../capabilities/folding'; -import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, IdentifiableSyntaxElement } from './base'; +import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, HasNamedSemanticToken, HasSemanticToken, IdentifiableSyntaxElement } from './base'; import { Range, TextDocument } from 'vscode-languageserver-textdocument'; import { IdentifierElement, PropertyDeclarationElement } from './memory'; -import { Diagnostic } from 'vscode-languageserver'; +import { Diagnostic, SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver'; +import { CompilerConditionalBlockContext, CompilerConditionalStatementContext, CompilerDefaultBlockContext, CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; // TODO: Reorganise this stuff as properties of more generic classes. @@ -50,4 +52,80 @@ export abstract class IdentifiableScopeElement extends BaseContextSyntaxElement get name(): string { return this.identifier.text; } +} + +export class CompilerIfBlockElement extends BaseContextSyntaxElement { + readonly inactiveChildren: InactiveConstantBlockElement[] = []; + readonly options: {environment: { os: string, version: string }} + readonly blocks: CompilerConditionalBlockContext[] = []; + readonly defaultBlock: CompilerDefaultBlockContext | null; + + constructor(ctx: CompilerIfBlockContext, doc: TextDocument, opts: {environment: { os: string, version: string }}) { + super(ctx, doc); + this.options = opts; + this.blocks = ctx.compilerConditionalBlock(); + this.defaultBlock = ctx.compilerDefaultBlock(); + + // Add the inactive condition blocks. + let hasTrueBlock = false; + for (let i = 0; i < this.blocks.length; i++) { + const element = this.blocks[i]; + const elementIsTrue = !hasTrueBlock && this.getConditionResult(element.compilerConditionalStatement()); + + if (elementIsTrue) { + hasTrueBlock = true; + continue; + } + + this.inactiveChildren.push(new InactiveConstantBlockElement(element, doc)); + } + // Add the default one if we have one and a condition evaluated true. + if (hasTrueBlock && !!this.defaultBlock) { + this.inactiveChildren.push(new InactiveConstantBlockElement(this.defaultBlock, doc)); + } + } + + getConditionResult(ctx: CompilerConditionalStatementContext): boolean { + const statement = ctx.compilerIfStatement() ?? ctx.compilerElseIfStatement()!; + const expression = statement.booleanExpression(); + + let expressionText = expression.getText(); + const boolText = (opt: string) => { + const isOs = this.options.environment.os == opt; + const isVer = this.options.environment.version == opt; + return isOs || isVer ? 'true' : 'false'; + } + + // Configure from options. + const constants = ['VBA6', 'Vba7', 'MAC', 'WIN16', 'WIN32', 'Win64'] + const replacements = new Map(constants.map(x => [x, boolText(x)])); + replacements.set('Or', '||'); + replacements.set('And', '&&'); + replacements.set('Not ', '!'); + + // Perform replacements. + replacements.forEach((v, k) => { + const regexp = RegExp(`${k}`, 'i') + if (regexp.test(expressionText)) { + expressionText = expressionText.replace(regexp, v); + } + }); + + // Evaluate the expression and return the result. + const result = eval(ts.transpile(expressionText)); + if (!(typeof result === "boolean")) { + throw new Error("Expected boolean result."); + } + return result; + } +} + +class InactiveConstantBlockElement extends BaseContextSyntaxElement implements HasSemanticToken { + tokenType: SemanticTokenTypes; + tokenModifiers: SemanticTokenModifiers[] = []; + + constructor(ctx: CompilerConditionalBlockContext | CompilerDefaultBlockContext, doc: TextDocument) { + super(ctx, doc) + this.tokenType = SemanticTokenTypes.comment; + } } \ No newline at end of file From e1b8aa0fa4e7f44809559c81ace7c3247c5f799d Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 13:28:45 +0800 Subject: [PATCH 16/58] Bug fixes --- server/src/antlr/vbapre.g4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/antlr/vbapre.g4 b/server/src/antlr/vbapre.g4 index b425dbf..5f96730 100644 --- a/server/src/antlr/vbapre.g4 +++ b/server/src/antlr/vbapre.g4 @@ -29,7 +29,7 @@ compilerConditionalBlock ; compilerDefaultBlock - : compilerElseStatement anyOtherLine* + : compilerElseStatement (anyOtherLine | endOfLine)* ; compilerConditionalStatement @@ -60,7 +60,7 @@ booleanExpression ; booleanPart - : WS? (AND | OR | XOR | EQV | IMP)? WS? NOT? WS? compilerConstant + : WS? (AND | OR | XOR | EQV | IMP)? WS? NOT? WS? (compilerConstant | anyWord) ; compilerConstant From 0155ef7191c8845389fb26b77129df871a94f482 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 13:30:43 +0800 Subject: [PATCH 17/58] Added functionality to subtract text so it is not considered during main parse. --- server/src/project/document.ts | 52 +++++++++++++++++++++++- server/src/project/elements/special.ts | 52 ++++++++++++++++++++++-- server/src/project/parser/vbaListener.ts | 32 ++++++++++----- 3 files changed, 121 insertions(+), 15 deletions(-) diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 2bb1c97..99064df 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -37,6 +37,7 @@ export abstract class BaseProjectDocument { protected _foldableElements: FoldingRange[] = []; protected _symbolInformations: SymbolInformation[] = []; protected _semanticTokens: SemanticTokensManager = new SemanticTokensManager(); + protected _redactedElements: BaseContextSyntaxElement[] = []; protected _isBusy = true; // protected _hasParseResult = false; @@ -57,6 +58,10 @@ export abstract class BaseProjectDocument { // return this._hasParseResult; // } + get redactedText() { + return this._subtractTextFromRanges(this._redactedElements.map(x => x.range)); + } + get currentScopeElement() { return this._elementParents.at(-1) ?? this.workspace.globalScope; } @@ -280,11 +285,16 @@ export abstract class BaseProjectDocument { return this; }; - registerCommentBlock = (element: HasSemanticToken) => { + registerCommentOutElement = (element: HasSemanticToken) => { this._semanticTokens.addComment(element); return this; } + registerSubtractElement = (element: BaseContextSyntaxElement) => { + this._redactedElements.push(element); + return this; + } + /** * Registers a SymbolInformation. * @param element The element that has symbol information. @@ -294,6 +304,46 @@ export abstract class BaseProjectDocument { this._symbolInformations.push(element.symbolInformation); return this; }; + + + private _subtractTextFromRanges(ranges: Range[]): string { + const text = this.textDocument.getText(); + return ranges.reduce((x, y) => this._subtractTextRange(x, y), text); + } + + /** + * Subtracts text by replacing it with white space. + * @param text the text to act on. + * @param range the range to subtract. + * @returns the original text with the range replaced by spaces. + */ + private _subtractTextRange(text: string, range: Range): string { + const docLines = text.split('\r\n'); + + if (range.start.line === range.end.line) { + // When the start and end lines are the same, subtract a substring. + const x = range.end.character; + const y = range.start.character; + const i = range.start.line - 1; + const line = docLines[i]; + const subtraction = ' '.repeat(x - y + 1); + docLines[i] = line.slice(0, y) + subtraction + line.slice(x + 1); + return docLines.join('\r\n'); + } else { + // When they aren't, subtract whole lines between start and end. + const x = range.end.line; + const y = range.start.line; + + // Replace the subtracted lines with spaces to maintain individual + // character positional integrity. + const result = docLines.map((line, i) => { + i >= y && i < x + ? ' '.repeat(line.length) + : line + }); + return result.join('\r\n') + } + } } diff --git a/server/src/project/elements/special.ts b/server/src/project/elements/special.ts index 9482344..ce7c431 100644 --- a/server/src/project/elements/special.ts +++ b/server/src/project/elements/special.ts @@ -1,10 +1,10 @@ import * as ts from "typescript"; import { ParserRuleContext } from 'antlr4ng'; import { FoldingRangeKind } from '../../capabilities/folding'; -import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, HasNamedSemanticToken, HasSemanticToken, IdentifiableSyntaxElement } from './base'; -import { Range, TextDocument } from 'vscode-languageserver-textdocument'; +import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, HasSemanticToken, IdentifiableSyntaxElement } from './base'; +import { TextDocument } from 'vscode-languageserver-textdocument'; import { IdentifierElement, PropertyDeclarationElement } from './memory'; -import { Diagnostic, SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver'; +import { Diagnostic, integer, Range, SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver'; import { CompilerConditionalBlockContext, CompilerConditionalStatementContext, CompilerDefaultBlockContext, CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; @@ -120,12 +120,56 @@ export class CompilerIfBlockElement extends BaseContextSyntaxElement { } } -class InactiveConstantBlockElement extends BaseContextSyntaxElement implements HasSemanticToken { +class InactiveConstantBlockElement extends BaseContextSyntaxElement { tokenType: SemanticTokenTypes; tokenModifiers: SemanticTokenModifiers[] = []; + lines: InactiveLineElement[]; constructor(ctx: CompilerConditionalBlockContext | CompilerDefaultBlockContext, doc: TextDocument) { super(ctx, doc) this.tokenType = SemanticTokenTypes.comment; + this.lines = this._createLines(); + } + + private _createLines(): InactiveLineElement[] { + const inactiveLines = this.text.split('\r\n'); + let stopIndex = (this.context?.start?.start ?? 0); + + // Generate the individual ranges. + const ranges: Range[] = []; + for (const line of inactiveLines) { + // Ignore blank lines. + if (line.length === 0) { + continue; + } + + // Create a range from the segment. + const startIndex = stopIndex; + stopIndex += line.length + 2; + ranges.push(Range.create( + this.document.positionAt(startIndex), + this.document.positionAt(stopIndex) + )); + } + + // Return InactiveLineElement objects. + return ranges.map(range => new InactiveLineElement(this.context, this.document, range)) + } +} + +export class InactiveLineElement extends BaseContextSyntaxElement implements HasSemanticToken { + tokenType: SemanticTokenTypes; + tokenModifiers: SemanticTokenModifiers[] = []; + + get text(): string { + return this.document.getText(this.range); + } + + constructor(ctx: ParserRuleContext, doc: TextDocument, range?: Range) { + super(ctx, doc) + this.tokenType = SemanticTokenTypes.comment; + if (range) { + this.range = range; + } } } \ No newline at end of file diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index d4a1590..8f6f4a4 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -1,15 +1,15 @@ -import { ErrorNode } from 'antlr4ng'; +import { ErrorNode, ParserRuleContext } from 'antlr4ng'; import { vbaListener } from '../../antlr/out/vbaListener'; import { ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; -import { DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; +import { BaseProjectDocument, DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; import { WhileLoopElement } from '../elements/flow'; import { IgnoredAttributeElement } from '../elements/module'; import { ConstDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; import { vbapreListener } from '../../antlr/out/vbapreListener'; -import { CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; -import { CompilerIfBlockElement } from '../elements/special'; +import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext} from '../../antlr/out/vbapreParser'; +import { CompilerIfBlockElement, InactiveLineElement } from '../elements/special'; class CommonParserCapability { @@ -180,16 +180,16 @@ export class VbaListener extends vbaListener { export class VbaPreListener extends vbapreListener { common: CommonParserCapability; - private _documentText: string; + private _document: BaseProjectDocument; get text(): string { - return this._documentText; + return this._document.redactedText; } constructor(document: VbaClassDocument | VbaModuleDocument) { super(); this.common = new CommonParserCapability(document); - this._documentText = document.textDocument.getText(); + this._document = document; } static async createAsync(document: VbaClassDocument | VbaModuleDocument): Promise { @@ -203,8 +203,20 @@ export class VbaPreListener extends vbapreListener { const docprops = this.common.documentSettings; const element = new CompilerIfBlockElement(ctx, doc.textDocument, docprops); - element.inactiveChildren.forEach(e => doc.registerCommentBlock(e)); - // TODO: Semantic tokens don't appear to be able to go across lines - // so I'll need to add _each line_ separately! + element.inactiveChildren.forEach(e => { + doc.registerSubtractElement(e); + e.lines.forEach(c => doc.registerCommentOutElement(c)); + }); + } + + enterCompilerElseStatement = (ctx: CompilerElseStatementContext) => this._registerInactiveLine(ctx); + enterCompilerEndIfStatement = (ctx: CompilerEndIfStatementContext) => this._registerInactiveLine(ctx); + enterCompilerConditionalStatement = (ctx: CompilerConditionalStatementContext) => this._registerInactiveLine(ctx); + + private _registerInactiveLine(ctx: ParserRuleContext) { + const doc = this.common.document; + doc.registerSubtractElement( + new InactiveLineElement(ctx, doc.textDocument) + ); } } \ No newline at end of file From 537a064d9b5fcc76e0b26323a1726577b9c3f71d Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 14:05:19 +0800 Subject: [PATCH 18/58] Update packages --- client/package-lock.json | 8 +- client/package.json | 2 +- package-lock.json | 520 +++++++++++++++++++++++++++------------ package.json | 15 +- 4 files changed, 381 insertions(+), 164 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index f2a7edd..4bfa372 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -12,7 +12,7 @@ "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@types/vscode": "^1.94.0", + "@types/vscode": "^1.95.0", "@vscode/test-electron": "^2.4.1" }, "engines": { @@ -20,9 +20,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.94.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz", - "integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==", + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", + "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", "dev": true, "license": "MIT" }, diff --git a/client/package.json b/client/package.json index db42369..a895ef0 100644 --- a/client/package.json +++ b/client/package.json @@ -16,7 +16,7 @@ "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@types/vscode": "^1.94.0", + "@types/vscode": "^1.95.0", "@vscode/test-electron": "^2.4.1" } } diff --git a/package-lock.json b/package-lock.json index d1c61f4..9838628 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,43 +10,47 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "antlr4ng": "^3.0.7" + "antlr4ng": "^3.0.8" }, "devDependencies": { "@types/mocha": "^10.0.9", - "@types/node": "^22.7.5", - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "@types/node": "^22.9.1", + "@typescript-eslint/eslint-plugin": "^8.15.0", + "@typescript-eslint/parser": "^8.15.0", "antlr4ng-cli": "^2.0.0", - "eslint": "^9.12.0", + "eslint": "^9.15.0", "js-yaml": "^4.1.0", - "mocha": "^10.7.3", - "typescript": "^5.6.3" + "mocha": "^10.8.2", + "typescript": "^5.6.3", + "vscode-tmgrammar-test": "^0.1.3" }, "engines": { "vscode": "^1.63.0" } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { @@ -54,9 +58,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -93,9 +97,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", "dev": true, "license": "Apache-2.0", "engines": { @@ -103,9 +107,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "license": "MIT", "dependencies": { @@ -151,9 +155,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", + "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", "dev": true, "license": "MIT", "engines": { @@ -171,9 +175,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -184,9 +188,9 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -194,19 +198,33 @@ } }, "node_modules/@humanfs/node": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanfs/core": "^0.19.0", + "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -222,9 +240,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -295,27 +313,27 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "version": "22.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", + "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz", - "integrity": "sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.15.0.tgz", + "integrity": "sha512-+zkm9AR1Ds9uLWN3fkoeXgFppaQ+uEVtfOV62dDmsy9QCNqlRHWNEck4yarvRNrvRcHQLGfqBNui3cimoz8XAg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/type-utils": "8.8.1", - "@typescript-eslint/utils": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.15.0", + "@typescript-eslint/type-utils": "8.15.0", + "@typescript-eslint/utils": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -339,16 +357,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", - "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.15.0.tgz", + "integrity": "sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.15.0", + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/typescript-estree": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0", "debug": "^4.3.4" }, "engines": { @@ -368,14 +386,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", - "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.15.0.tgz", + "integrity": "sha512-QRGy8ADi4J7ii95xz4UoiymmmMd/zuy9azCaamnZ3FM8T5fZcex8UfJcjkiEZjJSztKfEBe3dZ5T/5RHAmw2mA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1" + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -386,14 +404,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz", - "integrity": "sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.15.0.tgz", + "integrity": "sha512-UU6uwXDoI3JGSXmcdnP5d8Fffa2KayOhUUqr/AiBnG1Gl7+7ut/oyagVeSkh7bxQ0zSXV9ptRh/4N15nkCqnpw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/utils": "8.8.1", + "@typescript-eslint/typescript-estree": "8.15.0", + "@typescript-eslint/utils": "8.15.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -404,6 +422,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -411,9 +432,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", - "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.15.0.tgz", + "integrity": "sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ==", "dev": true, "license": "MIT", "engines": { @@ -425,14 +446,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", - "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.15.0.tgz", + "integrity": "sha512-1eMp2JgNec/niZsR7ioFBlsh/Fk0oJbhaqO0jRyQBMgkz7RrFfkqF9lYYmBoGBaSiLnu8TAPQTwoTUiSTUW9dg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/visitor-keys": "8.15.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -454,16 +475,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz", - "integrity": "sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.15.0.tgz", + "integrity": "sha512-k82RI9yGhr0QM3Dnq+egEpz9qB6Un+WLYhmoNcvl8ltMEededhh7otBVVIDDsEEttauwdY/hQoSsOv13lxrFzQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1" + "@typescript-eslint/scope-manager": "8.15.0", + "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/typescript-estree": "8.15.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -474,17 +495,22 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", - "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz", + "integrity": "sha512-h8vYOulWec9LhpwfAdZf2bjr8xIp0KNKnpgqSz0qqYYKAW/QZKw3ktRndbiAtUz4acH4QLQavwZBYCc0wulA/Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.15.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -494,10 +520,23 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", "bin": { @@ -571,9 +610,9 @@ } }, "node_modules/antlr4ng": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.7.tgz", - "integrity": "sha512-e9VzrS6fErCUTmkZX2eKEMCsmYY87gVhmHkzmOXtUDgvwGhivUvtiHqlOByDx4Nd1PIQ0lMlhflOWEz6cGXqKA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.8.tgz", + "integrity": "sha512-3xlyk8+lUFY1d3V/tFMVaejvMvqxpw+u527JJKjyzsm2ZzdZXlQ0oUQva3OQ4kJ05vTPAkvkGuIOeLjh8LMMhA==", "license": "BSD-3-Clause", "peerDependencies": { "antlr4ng-cli": "^2.0.0" @@ -629,6 +668,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dev": true, + "license": "MIT" + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -769,6 +815,16 @@ "dev": true, "license": "MIT" }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -777,9 +833,9 @@ "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { @@ -870,32 +926,32 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", + "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", - "@eslint/plugin-kit": "^0.2.0", - "@humanfs/node": "^0.16.5", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.15.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.1", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.1.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -909,8 +965,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -931,9 +986,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -972,9 +1027,9 @@ } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -998,15 +1053,15 @@ } }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1016,9 +1071,9 @@ } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1203,9 +1258,9 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true, "license": "ISC" }, @@ -1440,16 +1495,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -1619,9 +1664,9 @@ } }, "node_modules/mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "license": "MIT", "dependencies": { @@ -1790,6 +1835,16 @@ "node": ">=8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -2053,13 +2108,6 @@ "node": ">=8" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2074,9 +2122,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz", + "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==", "dev": true, "license": "MIT", "engines": { @@ -2130,6 +2178,174 @@ "punycode": "^2.1.0" } }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-textmate": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-7.0.4.tgz", + "integrity": "sha512-9hJp0xL7HW1Q5OgGe03NACo7yiCTMEk3WU/rtKXUbncLtdg6rVVNJnHwD88UhbIYU2KoxY0Dih0x+kIsmUKn2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-tmgrammar-test": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/vscode-tmgrammar-test/-/vscode-tmgrammar-test-0.1.3.tgz", + "integrity": "sha512-Wg6Pz+ePAT1O+F/A1Fc4wS5vY2X+HNtgN4qMdL+65NLQYd1/zdDWH4fhwsLjX8wTzeXkMy49Cr4ZqWTJ7VnVxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bottleneck": "^2.19.5", + "chalk": "^2.4.2", + "commander": "^9.2.0", + "diff": "^4.0.2", + "glob": "^7.1.6", + "vscode-oniguruma": "^1.5.1", + "vscode-textmate": "^7.0.1" + }, + "bin": { + "vscode-tmgrammar-snap": "dist/snapshot.js", + "vscode-tmgrammar-test": "dist/unit.js" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vscode-tmgrammar-test/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/vscode-tmgrammar-test/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 5203780..1b4d0e3 100644 --- a/package.json +++ b/package.json @@ -130,17 +130,18 @@ "antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/" }, "dependencies": { - "antlr4ng": "^3.0.7" + "antlr4ng": "^3.0.8" }, "devDependencies": { "@types/mocha": "^10.0.9", - "@types/node": "^22.7.5", - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "@types/node": "^22.9.1", + "@typescript-eslint/eslint-plugin": "^8.15.0", + "@typescript-eslint/parser": "^8.15.0", "antlr4ng-cli": "^2.0.0", - "eslint": "^9.12.0", + "eslint": "^9.15.0", "js-yaml": "^4.1.0", - "mocha": "^10.7.3", - "typescript": "^5.6.3" + "mocha": "^10.8.2", + "typescript": "^5.6.3", + "vscode-tmgrammar-test": "^0.1.3" } } From 88fe07bdae84c5b67488df8a275233bfdec40260 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 22:12:54 +0800 Subject: [PATCH 19/58] Corrected class copyright name. --- snippets/vba.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/vba.json b/snippets/vba.json index 61f5556..ec4e546 100644 --- a/snippets/vba.json +++ b/snippets/vba.json @@ -208,7 +208,7 @@ "Attribute VB_Creatable = False", "Attribute VB_PredeclaredId = False", "Attribute VB_Exposed = False", - "' Copyright 2024 ${2:Name}", + "' Copyright 2024 ${3:Name}", "' ", "' Permission is hereby granted, free of charge, to any person obtaining a copy ", "' of this software and associated documentation files (the \"Software\"), to deal ", From 39e813eddd1cc1effe3523ae9b426465a423337a Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 22:42:42 +0800 Subject: [PATCH 20/58] operators now recognised in header --- client/src/syntaxes/vba.tmLanguage.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/syntaxes/vba.tmLanguage.yaml b/client/src/syntaxes/vba.tmLanguage.yaml index 94a0499..5c0ae06 100644 --- a/client/src/syntaxes/vba.tmLanguage.yaml +++ b/client/src/syntaxes/vba.tmLanguage.yaml @@ -428,7 +428,7 @@ repository: patterns: - include: "#lineContinuation" apostropheComments: - name: comment.line.apostropheXX.vba + name: comment.line.apostrophe.vba match: (?i)\s*'.* remarkComments: name: comment.line.remark.vba @@ -460,6 +460,7 @@ repository: patterns: - include: "#comments" - include: "#literals" + - include: "#operators" moduleOption: name: keyword.control.vba From 1e6105f62931bfa97353edbc28c569aad9ee3be4 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 22:52:40 +0800 Subject: [PATCH 21/58] Reorganise scripts --- package.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1b4d0e3..58e578a 100644 --- a/package.json +++ b/package.json @@ -123,11 +123,15 @@ "watch": "tsc -b -w", "lint": "eslint ./client/src ./server/src --ext .ts,.tsx", "postinstall": "cd client && npm install && cd ../server && npm install && cd ..", - "test": "sh ./scripts/e2e.sh", - "testps": "powershell ./scripts/e2e.ps1", "textMate": "npx js-yaml client/src/syntaxes/vba.tmLanguage.yaml > client/out/vba.tmLanguage.json", "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/", - "antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/" + "antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/", + "test": "npm run tmSnapTest && npm run tmUnitTest && npm run testps", + "testsh": "sh ./scripts/e2e.sh", + "testps": "powershell ./scripts/e2e.ps1", + "tmUnitTest": "vscode-tmgrammar-test ./test/textmate/**/*.vba", + "tmSnapTest": "vscode-tmgrammar-snap ./test/textmate/snapshot/*.??s", + "tmSnapUpdate": "vscode-tmgrammar-snap --updateSnapshot ./test/textmate/snapshot/*.??s" }, "dependencies": { "antlr4ng": "^3.0.8" From c70cce0fe3733aaf965476b8243126c4b62a3bb3 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 22:52:58 +0800 Subject: [PATCH 22/58] New snapshot tests --- test/textmate/snapshot/class.cls | 12 ++++++ test/textmate/snapshot/class.cls.snap | 55 ++++++++++++++++++++++++++ test/textmate/snapshot/module.bas | 3 ++ test/textmate/snapshot/module.bas.snap | 10 +++++ 4 files changed, 80 insertions(+) create mode 100644 test/textmate/snapshot/class.cls create mode 100644 test/textmate/snapshot/class.cls.snap create mode 100644 test/textmate/snapshot/module.bas create mode 100644 test/textmate/snapshot/module.bas.snap diff --git a/test/textmate/snapshot/class.cls b/test/textmate/snapshot/class.cls new file mode 100644 index 0000000..dfce942 --- /dev/null +++ b/test/textmate/snapshot/class.cls @@ -0,0 +1,12 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "ClassName" +Attribute VB_Description = "Class description goes here" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = False +Attribute VB_Exposed = False + +Option Explicit diff --git a/test/textmate/snapshot/class.cls.snap b/test/textmate/snapshot/class.cls.snap new file mode 100644 index 0000000..31d0110 --- /dev/null +++ b/test/textmate/snapshot/class.cls.snap @@ -0,0 +1,55 @@ +>VERSION 1.0 CLASS +#^^^^^^^ source.vba entity.other.attribute-name.block.vba +# ^ source.vba entity.other.attribute-name.block.vba +# ^^^ source.vba entity.other.attribute-name.block.vba constant.numeric.vba +# ^^^^^^^ source.vba entity.other.attribute-name.block.vba +>BEGIN +#^^^^^^ source.vba entity.other.attribute-name.block.vba +> MultiUse = -1 'True +#^^^^^^^^^^^ source.vba entity.other.attribute-name.block.vba +# ^ source.vba entity.other.attribute-name.block.vba keyword.operator.comparison.vba +# ^ source.vba entity.other.attribute-name.block.vba +# ^^ source.vba entity.other.attribute-name.block.vba constant.numeric.vba +# ^^^^^^^ source.vba entity.other.attribute-name.block.vba comment.line.apostrophe.vba +>END +#^^^ source.vba entity.other.attribute-name.block.vba +>Attribute VB_Name = "ClassName" +#^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^^^^^^^ source.vba meta.attribute.vba string.quoted.double.vba +>Attribute VB_Description = "Class description goes here" +#^^^^^^^^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba string.quoted.double.vba +>Attribute VB_GlobalNameSpace = False +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^ source.vba meta.attribute.vba constant.language.boolean.vba +>Attribute VB_Creatable = False +#^^^^^^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^ source.vba meta.attribute.vba constant.language.boolean.vba +>Attribute VB_PredeclaredId = False +#^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^ source.vba meta.attribute.vba constant.language.boolean.vba +>Attribute VB_Exposed = False +#^^^^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^ source.vba meta.attribute.vba constant.language.boolean.vba +> +>Option Explicit +#^^^^^^^^^^^^^^^ source.vba keyword.control.vba +> \ No newline at end of file diff --git a/test/textmate/snapshot/module.bas b/test/textmate/snapshot/module.bas new file mode 100644 index 0000000..ae87803 --- /dev/null +++ b/test/textmate/snapshot/module.bas @@ -0,0 +1,3 @@ +Attribute VB_Name = "ModuleName" + +Option Explicit diff --git a/test/textmate/snapshot/module.bas.snap b/test/textmate/snapshot/module.bas.snap new file mode 100644 index 0000000..05a4dde --- /dev/null +++ b/test/textmate/snapshot/module.bas.snap @@ -0,0 +1,10 @@ +>Attribute VB_Name = "ModuleName" +#^^^^^^^^^^^^^^^^^ source.vba meta.attribute.vba entity.other.attribute-name.vba +# ^ source.vba meta.attribute.vba +# ^ source.vba meta.attribute.vba keyword.operator.comparison.vba +# ^ source.vba meta.attribute.vba +# ^^^^^^^^^^^^ source.vba meta.attribute.vba string.quoted.double.vba +> +>Option Explicit +#^^^^^^^^^^^^^^^ source.vba keyword.control.vba +> \ No newline at end of file From 18b7376247d67b95bbe65d2aa48173b63c130998 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 20 Nov 2024 22:53:10 +0800 Subject: [PATCH 23/58] New textMate tests --- test/textmate/unit/module/classHeaders.vba | 57 +++++++++++++++++++++ test/textmate/unit/module/moduleHeaders.vba | 10 ++++ 2 files changed, 67 insertions(+) create mode 100644 test/textmate/unit/module/classHeaders.vba create mode 100644 test/textmate/unit/module/moduleHeaders.vba diff --git a/test/textmate/unit/module/classHeaders.vba b/test/textmate/unit/module/classHeaders.vba new file mode 100644 index 0000000..563ccb0 --- /dev/null +++ b/test/textmate/unit/module/classHeaders.vba @@ -0,0 +1,57 @@ +// SYNTAX TEST "source.vba" "class headers" + + +VERSION 1.0 CLASS +// <---------------- entity.other.attribute-name.block.vba +// ^^^ constant.numeric.vba + +BEGIN +// <----- entity.other.attribute-name.block.vba + + MultiUse = -1 'True +// ^^^^^^^^^^^^^^^^^^^^ entity.other.attribute-name.block.vba +// ^ keyword.operator.comparison.vba +// ^^ constant.numeric.vba +// ^^^^^ comment.line.apostrophe.vba + +END +// <--- entity.other.attribute-name.block.vba + +Attribute VB_Name = "ClassName" +// <------------------------------ meta.attribute.vba +// <---------------- entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^^^^^^^ string.quoted.double.vba + +Attribute VB_Description = "Class description goes here" +// <------------------------------------------------------- meta.attribute.vba +// <-------------------- entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.vba + +Attribute VB_GlobalNameSpace = False +// <----------------------------------- meta.attribute.vba +// <------------------------ entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^ constant.language.boolean.vba + +Attribute VB_Creatable = False +// <----------------------------- meta.attribute.vba +// <------------------ entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^ constant.language.boolean.vba + +Attribute VB_PredeclaredId = False +// <--------------------------------- meta.attribute.vba +// <------------------------- entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^ constant.language.boolean.vba + +Attribute VB_Exposed = False +// <--------------------------- meta.attribute.vba +// <------------------- entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^ constant.language.boolean.vba + +Option Explicit +// <--------------- keyword.control.vba \ No newline at end of file diff --git a/test/textmate/unit/module/moduleHeaders.vba b/test/textmate/unit/module/moduleHeaders.vba new file mode 100644 index 0000000..40b04d3 --- /dev/null +++ b/test/textmate/unit/module/moduleHeaders.vba @@ -0,0 +1,10 @@ +// SYNTAX TEST "source.vba" "module headers" + +Attribute VB_Name = "ModuleName" +// <------------------------------- meta.attribute.vba +// <----------------- entity.other.attribute-name.vba +// ^ keyword.operator.comparison.vba +// ^^^^^^^^^^^^ string.quoted.double.vba + +Option Explicit +// <--------------- keyword.control.vba \ No newline at end of file From 58e41799fa163a3409a25589a7f128f867ce8626 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 16:37:26 +0800 Subject: [PATCH 24/58] Update packages --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9838628..613304d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -306,9 +306,9 @@ "license": "MIT" }, "node_modules/@types/mocha": { - "version": "10.0.9", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.9.tgz", - "integrity": "sha512-sicdRoWtYevwxjOHNMPTl3vSfJM6oyW8o1wXeI7uww6b6xHg8eBznQDNSGBCDJmsE8UMxP05JgZRtsKbTqt//Q==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true, "license": "MIT" }, @@ -610,9 +610,9 @@ } }, "node_modules/antlr4ng": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.8.tgz", - "integrity": "sha512-3xlyk8+lUFY1d3V/tFMVaejvMvqxpw+u527JJKjyzsm2ZzdZXlQ0oUQva3OQ4kJ05vTPAkvkGuIOeLjh8LMMhA==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.9.tgz", + "integrity": "sha512-xRl3RNanvJwKdBDHrqOcESJGO/0vraqtPuJPkaO3RH1zME3+2jkjMtZJjVSFR2Nt4oh9tW7U6/iX4EBSxaiUBw==", "license": "BSD-3-Clause", "peerDependencies": { "antlr4ng-cli": "^2.0.0" From 6b4096140e2fb24f8b6f56c2bb459baf3cdb706b Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:25:32 +0800 Subject: [PATCH 25/58] Configure test fixtures --- client/testFixture/Diagnostics.bas | 11 +++++++++++ client/testFixture/EmptyClass.cls | 29 +++++++++++++++++++++++++++++ client/testFixture/EmptyModule.bas | 21 +++++++++++++++++++++ client/testFixture/completion.txt | 0 client/testFixture/diagnostics.txt | 1 - 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 client/testFixture/Diagnostics.bas create mode 100644 client/testFixture/EmptyClass.cls create mode 100644 client/testFixture/EmptyModule.bas delete mode 100644 client/testFixture/completion.txt delete mode 100644 client/testFixture/diagnostics.txt diff --git a/client/testFixture/Diagnostics.bas b/client/testFixture/Diagnostics.bas new file mode 100644 index 0000000..76d571e --- /dev/null +++ b/client/testFixture/Diagnostics.bas @@ -0,0 +1,11 @@ +Attribute VB_Name = "Diagnostics" + +Option Explicit + +Public Sub Foo() + Dim i As Long + While True + i = i ++ 1 + i = i <> 1 + Wend +End Sub \ No newline at end of file diff --git a/client/testFixture/EmptyClass.cls b/client/testFixture/EmptyClass.cls new file mode 100644 index 0000000..0f2affe --- /dev/null +++ b/client/testFixture/EmptyClass.cls @@ -0,0 +1,29 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "EmptyClass" +Attribute VB_Description = "Class description goes here" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = False +Attribute VB_Exposed = False +' Copyright 2024 Class description goes here +' +' Permission is hereby granted, free of charge, to any person obtaining a copy +' of this software and associated documentation files (the "Software"), to deal +' in the Software without restriction, including without limitation the rights +' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +' copies of the Software, and to permit persons to whom the Software is +' furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in +' all copies or substantial portions of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +' IN THE SOFTWARE. diff --git a/client/testFixture/EmptyModule.bas b/client/testFixture/EmptyModule.bas new file mode 100644 index 0000000..e720881 --- /dev/null +++ b/client/testFixture/EmptyModule.bas @@ -0,0 +1,21 @@ +Attribute VB_Name = "EmptyModule" +' Copyright 2024 Sam Vanderslink +' +' Permission is hereby granted, free of charge, to any person obtaining a copy +' of this software and associated documentation files (the "Software"), to deal +' in the Software without restriction, including without limitation the rights +' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +' copies of the Software, and to permit persons to whom the Software is +' furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in +' all copies or substantial portions of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +' IN THE SOFTWARE. + diff --git a/client/testFixture/completion.txt b/client/testFixture/completion.txt deleted file mode 100644 index e69de29..0000000 diff --git a/client/testFixture/diagnostics.txt b/client/testFixture/diagnostics.txt deleted file mode 100644 index d910cfb..0000000 --- a/client/testFixture/diagnostics.txt +++ /dev/null @@ -1 +0,0 @@ -ANY browsers, ANY OS. \ No newline at end of file From 29557aaea1963d82cb73533cef8bb22d9ec20696 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:26:27 +0800 Subject: [PATCH 26/58] Configure test environment --- .vscode-test.mjs | 10 + .vscode/launch.json | 11 + package-lock.json | 1208 ++++++++++++++++++++++++++++++++++++++++++- package.json | 7 +- 4 files changed, 1206 insertions(+), 30 deletions(-) create mode 100644 .vscode-test.mjs diff --git a/.vscode-test.mjs b/.vscode-test.mjs new file mode 100644 index 0000000..d30c53a --- /dev/null +++ b/.vscode-test.mjs @@ -0,0 +1,10 @@ +// .vscode-test.mjs +import { defineConfig } from '@vscode/test-cli'; + +export default defineConfig({ + files: 'client/out/test/**/*.test.js', + mocha: { + ui: 'tdd', + timeout: 4000 + } +}); diff --git a/.vscode/launch.json b/.vscode/launch.json index d82d603..6bbcd08 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -56,6 +56,17 @@ "startRule": "startRule", "printParseTree": true, "visualParseTree": true + }, + { + "name": "Extension Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/client/out/test/index" + ], + "outFiles": ["${workspaceFolder}/client/out/test/**/*.test.js"] } ], "compounds": [ diff --git a/package-lock.json b/package-lock.json index 613304d..e2bedd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,8 @@ "@types/node": "^22.9.1", "@typescript-eslint/eslint-plugin": "^8.15.0", "@typescript-eslint/parser": "^8.15.0", + "@vscode/test-cli": "^0.0.10", + "@vscode/test-electron": "^2.4.1", "antlr4ng-cli": "^2.0.0", "eslint": "^9.15.0", "js-yaml": "^4.1.0", @@ -28,6 +30,13 @@ "vscode": "^1.63.0" } }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", @@ -253,6 +262,147 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -291,6 +441,17 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -298,6 +459,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -533,6 +701,125 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@vscode/test-cli": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@vscode/test-cli/-/test-cli-0.0.10.tgz", + "integrity": "sha512-B0mMH4ia+MOOtwNiLi79XhA+MLmUItIC8FckEuKrVAVriIuSWjt7vv4+bF8qVFiNFe4QRfzPaIZk39FZGWEwHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mocha": "^10.0.2", + "c8": "^9.1.0", + "chokidar": "^3.5.3", + "enhanced-resolve": "^5.15.0", + "glob": "^10.3.10", + "minimatch": "^9.0.3", + "mocha": "^10.2.0", + "supports-color": "^9.4.0", + "yargs": "^17.7.2" + }, + "bin": { + "vscode-test": "out/bin.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@vscode/test-cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@vscode/test-cli/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-cli/node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@vscode/test-cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@vscode/test-cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/@vscode/test-electron": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.1.tgz", + "integrity": "sha512-Gc6EdaLANdktQ1t+zozoBVRynfIsMKMc94Svu1QreOBC8y76x4tvaK32TljrLi1LI2+PK58sDVbL7ALdqf3VRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "jszip": "^3.10.1", + "ora": "^7.0.1", + "semver": "^7.6.2" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", @@ -556,6 +843,19 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -655,6 +955,27 @@ "dev": true, "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -668,6 +989,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", @@ -705,48 +1053,143 @@ "dev": true, "license": "ISC" }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "license": "MIT", - "engines": { - "node": ">=6" + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/c8": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-9.1.0.tgz", + "integrity": "sha512-mBWcT5iqNir1zIkzSPyI3NCR9EZCVI3WUD+AVO17MVWTSFNyUueXE82qTeampNtTr+ilN/5Ua3j24LgbCKjDVg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" + "license": "ISC", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=14.14.0" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/c8/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=12" } }, - "node_modules/chokidar": { - "version": "3.6.0", + "node_modules/c8/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/c8/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, @@ -783,6 +1226,35 @@ "node": ">= 6" } }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -832,6 +1304,20 @@ "dev": true, "license": "MIT" }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -895,6 +1381,13 @@ "node": ">=0.3.1" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -902,6 +1395,20 @@ "dev": true, "license": "MIT" }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -1264,6 +1771,23 @@ "dev": true, "license": "ISC" }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1356,6 +1880,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -1383,6 +1914,62 @@ "he": "bin/he" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -1393,6 +1980,13 @@ "node": ">= 4" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true, + "license": "MIT" + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -1485,6 +2079,19 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1518,6 +2125,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1525,6 +2139,61 @@ "dev": true, "license": "ISC" }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1559,6 +2228,19 @@ "dev": true, "license": "MIT" }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -1583,6 +2265,16 @@ "node": ">= 0.8.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1623,6 +2315,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1647,6 +2362,16 @@ "node": ">=8.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -1663,6 +2388,16 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mocha": { "version": "10.8.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", @@ -1762,6 +2497,22 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -1780,6 +2531,127 @@ "node": ">= 0.8.0" } }, + "node_modules/ora": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.9.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.3.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "string-width": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1812,6 +2684,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true, + "license": "(MIT AND Zlib)" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -1855,6 +2741,23 @@ "node": ">=8" } }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -1878,6 +2781,13 @@ "node": ">= 0.8.0" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -1919,6 +2829,29 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1952,6 +2885,30 @@ "node": ">=4" } }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -2031,6 +2988,13 @@ "randombytes": "^2.1.0" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "license": "MIT" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2054,6 +3018,52 @@ "node": ">=8" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2069,6 +3079,22 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2082,6 +3108,20 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2108,6 +3148,77 @@ "node": ">=8" } }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2178,6 +3289,28 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/vscode-oniguruma": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", @@ -2397,6 +3530,25 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 58e578a..f70adb2 100644 --- a/package.json +++ b/package.json @@ -126,12 +126,13 @@ "textMate": "npx js-yaml client/src/syntaxes/vba.tmLanguage.yaml > client/out/vba.tmLanguage.json", "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/", "antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/", - "test": "npm run tmSnapTest && npm run tmUnitTest && npm run testps", + "test": "npm run tmSnapTest && npm run tmUnitTest && npm run vsctest", "testsh": "sh ./scripts/e2e.sh", "testps": "powershell ./scripts/e2e.ps1", "tmUnitTest": "vscode-tmgrammar-test ./test/textmate/**/*.vba", "tmSnapTest": "vscode-tmgrammar-snap ./test/textmate/snapshot/*.??s", - "tmSnapUpdate": "vscode-tmgrammar-snap --updateSnapshot ./test/textmate/snapshot/*.??s" + "tmSnapUpdate": "vscode-tmgrammar-snap --updateSnapshot ./test/textmate/snapshot/*.??s", + "vsctest": "vscode-test" }, "dependencies": { "antlr4ng": "^3.0.8" @@ -141,6 +142,8 @@ "@types/node": "^22.9.1", "@typescript-eslint/eslint-plugin": "^8.15.0", "@typescript-eslint/parser": "^8.15.0", + "@vscode/test-cli": "^0.0.10", + "@vscode/test-electron": "^2.4.1", "antlr4ng-cli": "^2.0.0", "eslint": "^9.15.0", "js-yaml": "^4.1.0", From 0716044ea86e27b99ce1241c456dae249d6d7843 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:27:03 +0800 Subject: [PATCH 27/58] Initial unit tests --- client/src/test/completion.test.ts | 18 +++++------ client/src/test/diagnostics.test.ts | 46 ++++++++++++++++++++++++----- client/src/test/helper.ts | 2 +- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/client/src/test/completion.test.ts b/client/src/test/completion.test.ts index f355078..0b2f610 100644 --- a/client/src/test/completion.test.ts +++ b/client/src/test/completion.test.ts @@ -8,16 +8,16 @@ import * as assert from 'assert'; import { getDocUri, activate } from './helper'; suite('Should do completion', () => { - const docUri = getDocUri('completion.txt'); + // const docUri = getDocUri('completion.txt'); - test('Completes JS/TS in txt file', async () => { - await testCompletion(docUri, new vscode.Position(0, 0), { - items: [ - { label: 'JavaScript', kind: vscode.CompletionItemKind.Text }, - { label: 'TypeScript', kind: vscode.CompletionItemKind.Text } - ] - }); - }); + // test('Completes JS/TS in txt file', async () => { + // await testCompletion(docUri, new vscode.Position(0, 0), { + // items: [ + // { label: 'JavaScript', kind: vscode.CompletionItemKind.Text }, + // { label: 'TypeScript', kind: vscode.CompletionItemKind.Text } + // ] + // }); + // }); }); async function testCompletion( diff --git a/client/src/test/diagnostics.test.ts b/client/src/test/diagnostics.test.ts index 1aa8a36..41ec639 100644 --- a/client/src/test/diagnostics.test.ts +++ b/client/src/test/diagnostics.test.ts @@ -8,20 +8,50 @@ import * as assert from 'assert'; import { getDocUri, activate } from './helper'; suite('Should get diagnostics', () => { - const docUri = getDocUri('diagnostics.txt'); + test('diagnostics.class.noOptionExplicitWarning', async () => { + await testDiagnostics(getDocUri('EmptyClass.cls'), [ + { + message: 'Option Explicit is missing from module header.', + range: toRange(11, 1, 11, 1), + severity: vscode.DiagnosticSeverity.Warning, + source: 'ex' + } + ]); + }); + + test('diagnostics.module.noOptionExplicitWarning', async () => { + await testDiagnostics(getDocUri('EmptyModule.bas'), [ + { + message: 'Option Explicit is missing from module header.', + range: toRange(2, 1, 2, 1), + severity: vscode.DiagnosticSeverity.Warning, + source: 'ex' + } + ]); + }); - test('Diagnoses uppercase texts', async () => { - await testDiagnostics(docUri, [ - { message: 'ANY is all uppercase.', range: toRange(0, 0, 0, 3), severity: vscode.DiagnosticSeverity.Warning, source: 'ex' }, - { message: 'ANY is all uppercase.', range: toRange(0, 14, 0, 17), severity: vscode.DiagnosticSeverity.Warning, source: 'ex' }, - { message: 'OS is all uppercase.', range: toRange(0, 18, 0, 20), severity: vscode.DiagnosticSeverity.Warning, source: 'ex' } + test('diagnostics.module.generalDiagnostics', async () => { + // Diagnostics are sorted by severity! + await testDiagnostics(getDocUri('Diagnostics.bas'), [ + { + message: 'The Do...Loop statement provides a more structured and flexible way to perform looping.', + range: toRange(7, 4, 7, 8), + severity: vscode.DiagnosticSeverity.Information, + source: 'ex' + }, + { + message: 'Unexpected duplicate operator.', + range: toRange(8, 15, 8, 16), + severity: vscode.DiagnosticSeverity.Information, + source: 'ex' + } ]); }); }); function toRange(sLine: number, sChar: number, eLine: number, eChar: number) { - const start = new vscode.Position(sLine, sChar); - const end = new vscode.Position(eLine, eChar); + const start = new vscode.Position(sLine - 1, sChar); + const end = new vscode.Position(eLine - 1, eChar); return new vscode.Range(start, end); } diff --git a/client/src/test/helper.ts b/client/src/test/helper.ts index 6e6724d..50a5e88 100644 --- a/client/src/test/helper.ts +++ b/client/src/test/helper.ts @@ -16,7 +16,7 @@ export let platformEol: string; */ export async function activate(docUri: vscode.Uri) { // The extensionId is `publisher.name` from package.json - const ext = vscode.extensions.getExtension('vscode-samples.lsp-sample')!; + const ext = vscode.extensions.getExtension('NotisDataAnalytics.vba-lsp')!; await ext.activate(); try { doc = await vscode.workspace.openTextDocument(docUri); From 3e70015ab912cf040f8d3c999ff4265481b33113 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:27:31 +0800 Subject: [PATCH 28/58] Parse duplicate operators --- server/src/antlr/vba.g4 | 194 ++++++++++++++++++++++++++++++++-------- 1 file changed, 159 insertions(+), 35 deletions(-) diff --git a/server/src/antlr/vba.g4 b/server/src/antlr/vba.g4 index a012b8a..0ecbc2c 100644 --- a/server/src/antlr/vba.g4 +++ b/server/src/antlr/vba.g4 @@ -42,7 +42,7 @@ classBeginBlock ; beginBlockConfigElement - : endOfLine+ (OBJECT '.')? '_'? ambiguousIdentifier WS? EQ WS? (('-'? literalExpression) | FILEOFFSET) + : endOfLine+ (OBJECT '.')? '_'? ambiguousIdentifier WS? eqOperator WS? (('-'? literalExpression) | FILEOFFSET) | formBeginBlock | beginPropertyBlock ; @@ -56,7 +56,7 @@ formVersionIdentification : VERSION WS FLOATLITERAL ; formObjectAssign - : endOfLine+ OBJECT WS? EQ WS? STRINGLITERAL (';' WS? STRINGLITERAL)? + : endOfLine+ OBJECT WS? eqOperator WS? STRINGLITERAL (';' WS? STRINGLITERAL)? ; formBeginBlock : endOfLine+ BEGIN WS (GUID | (ambiguousIdentifier '.' ambiguousIdentifier)) WS ambiguousIdentifier beginBlockConfigElement+ endOfLine+ END @@ -82,20 +82,20 @@ classModuleHeader: (endOfLine+ (classAttr | nameAttr | ignoredAttr))* WS?; // VBA Library Projects are allowed to have GoobalNamespace and creatable as true. classAttr - : ATTRIBUTE WS? VB_DESCRIPTION WS? EQ WS? STRINGLITERAL - | ATTRIBUTE WS? VB_GLOBALNAMESPACE WS? EQ WS? booleanLiteralIdentifier - | ATTRIBUTE WS? VB_CREATABLE WS? EQ WS? booleanLiteralIdentifier - | ATTRIBUTE WS? VB_PREDECLAREDID WS? EQ WS? booleanLiteralIdentifier - | ATTRIBUTE WS? VB_EXPOSED WS? EQ WS? booleanLiteralIdentifier - | ATTRIBUTE WS? VB_CUSTOMIZABLE WS? EQ WS? booleanLiteralIdentifier + : ATTRIBUTE WS? VB_DESCRIPTION WS? eqOperator WS? STRINGLITERAL + | ATTRIBUTE WS? VB_GLOBALNAMESPACE WS? eqOperator WS? booleanLiteralIdentifier + | ATTRIBUTE WS? VB_CREATABLE WS? eqOperator WS? booleanLiteralIdentifier + | ATTRIBUTE WS? VB_PREDECLAREDID WS? eqOperator WS? booleanLiteralIdentifier + | ATTRIBUTE WS? VB_EXPOSED WS? eqOperator WS? booleanLiteralIdentifier + | ATTRIBUTE WS? VB_CUSTOMIZABLE WS? eqOperator WS? booleanLiteralIdentifier ; ignoredAttr - : ATTRIBUTE WS? ambiguousIdentifier WS? EQ WS? expression + : ATTRIBUTE WS? ambiguousIdentifier WS? eqOperator WS? expression ; nameAttr - : ATTRIBUTE WS? VB_NAME WS? EQ WS? STRINGLITERAL + : ATTRIBUTE WS? VB_NAME WS? eqOperator WS? STRINGLITERAL ; //--------------------------------------------------------------------------------------- @@ -281,8 +281,8 @@ constItem : typedNameConstItem | untypedNameConstItem ; -typedNameConstItem: typedName wsc? EQ wsc? constantExpression; -untypedNameConstItem: ambiguousIdentifier (wsc constAsClause)? wsc? EQ wsc? constantExpression; +typedNameConstItem: typedName wsc? eqOperator wsc? constantExpression; +untypedNameConstItem: ambiguousIdentifier (wsc constAsClause)? wsc? eqOperator wsc? constantExpression; constAsClause: AS wsc builtinType; // 5.2.3.3 User Defined Type Declarations @@ -323,7 +323,7 @@ enumElement : remStatement | enumMember ; -enumMember: untypedName (wsc? EQ wsc? constantExpression)?; +enumMember: untypedName (wsc? eqOperator wsc? constantExpression)?; // 5.2.3.5 External Procedure Declaration publicExternalProcedureDeclaration: (PUBLIC wsc)? externalProcDcl; @@ -598,7 +598,7 @@ nestedForStatement | explicitForEachStatement ; forClause - : FOR wsc boundVariableExpression wsc? EQ wsc? startValue wsc TO wsc endValue (wsc stepClause)?; + : FOR wsc boundVariableExpression wsc? eqOperator wsc? startValue wsc TO wsc endValue (wsc stepClause)?; startValue: expression; endValue: expression; stepClause: STEP wsc stepIncrement; @@ -686,12 +686,12 @@ rangeClause | IS? wsc comparisonOperator wsc? expression; selectExpression: expression; comparisonOperator - : EQ + : eqOperator | NEW - | LT - | GT - | LEQ - | GEQ + | ltOperator + | gtOperator + | leqOperator + | geqOperator ; // 5.4.2.11 Stop Statement @@ -785,7 +785,7 @@ eraseList: eraseElement (wsc? ',' wsc? eraseElement)*; eraseElement: lExpression; // 5.4.3.5 Mid/MidB/Mid$/MidB$ Statement -midStatement: modeSpecifier wsc? '(' wsc? stringArgument wsc? ',' wsc? startMid wsc? (',' wsc? length)? ')' wsc? EQ wsc? expression; +midStatement: modeSpecifier wsc? '(' wsc? stringArgument wsc? ',' wsc? startMid wsc? (',' wsc? length)? ')' wsc? eqOperator wsc? expression; modeSpecifier : MID | MIDB @@ -798,16 +798,16 @@ startMid: integerExpression; length: integerExpression; // 5.4.3.6 LSet Statement -lsetStatement: LSET wsc? boundVariableExpression wsc? EQ wsc? expression; +lsetStatement: LSET wsc? boundVariableExpression wsc? eqOperator wsc? expression; // 5.4.3.7 RSet Statement -rsetStatement: RSET wsc? boundVariableExpression wsc? EQ wsc? expression; +rsetStatement: RSET wsc? boundVariableExpression wsc? eqOperator wsc? expression; // 5.4.3.8 Let Statement -letStatement: (LET wsc)? lExpression wsc? EQ wsc? expression; +letStatement: (LET wsc)? lExpression wsc? eqOperator wsc? expression; // 5.4.3.9 Set Statement -setStatement: SET wsc lExpression wsc? EQ wsc? expression; +setStatement: SET wsc lExpression wsc? eqOperator wsc? expression; // 5.4.4 Error Handling Statements errorHandlingStatement @@ -871,7 +871,7 @@ lock | LOCK wsc WRITE | LOCK wsc READ wsc WRITE ; -lenClause: LEN wsc EQ wsc recLength; +lenClause: LEN wsc eqOperator wsc recLength; recLength: expression; // 5.4.5.1.1 File Numbers @@ -948,9 +948,9 @@ variable: variableExpression; // Attribute Statement attributeStatement - : ATTRIBUTE WS ambiguousIdentifier '.' attributeDescName WS? EQ WS? STRINGLITERAL - | ATTRIBUTE WS ambiguousIdentifier '.' attributeUsrName WS? EQ WS? '-'? INTEGERLITERAL - | ATTRIBUTE WS ambiguousIdentifier '.' VB_PROCDATA '.' VB_INVOKE_FUNC WS EQ WS STRINGLITERAL + : ATTRIBUTE WS ambiguousIdentifier '.' attributeDescName WS? eqOperator WS? STRINGLITERAL + | ATTRIBUTE WS ambiguousIdentifier '.' attributeUsrName WS? eqOperator WS? '-'? INTEGERLITERAL + | ATTRIBUTE WS ambiguousIdentifier '.' VB_PROCDATA '.' VB_INVOKE_FUNC WS eqOperator WS STRINGLITERAL ; attributeDescName @@ -990,15 +990,30 @@ expression | parenthesizedExpression | typeofIsExpression | newExpress - | expression wsc? POW wsc? expression + | expression wsc? powOperator wsc? expression | unaryMinusExpression - | expression wsc? (DIV | MULT) wsc? expression - | expression wsc? MOD wsc? expression - | expression wsc? (PLUS | MINUS) wsc? expression - | expression wsc? AMPERSAND wsc? expression - | expression wsc? (IS | LIKE | GEQ | LEQ | GT | LT | NEQ | EQ) wsc? expression + | expression wsc? (divOperator | multOperator) wsc? expression + | expression wsc? modOperator wsc? expression + | expression wsc? (plusOperator | minusOperator) wsc? expression + | expression wsc? ampOperator wsc? expression + | expression wsc? ( + IS + | LIKE + | geqOperator + | leqOperator + | gtOperator + | ltOperator + | neqOperator + | eqOperator + ) wsc? expression | notOperatorExpression - | expression wsc? (AND | OR | XOR | EQV | IMP) wsc? expression + | expression wsc? ( + andOperator + | orOperator + | xorOperator + | eqvOperator + | impOperator + ) wsc? expression | lExpression ; @@ -1509,6 +1524,115 @@ ambiguousKeyword | WIDTH ; +//--------------------------------------------------------------------------------------- +// Helpers + +// Operators rolled up like this allows parsing of multiple operators +// so that they can be detected and reported as a diagnostic. +anyOperator + : powOperator + | divOperator + | multOperator + | modOperator + | plusOperator + | minusOperator + | ampOperator + | isOperator + | likeOperator + | leqOperator + | gtOperator + | ltOperator + | neqOperator + | eqOperator + | andOperator + | orOperator + | orOperator + | xorOperator + | eqvOperator + | impOperator + ; + +powOperator + : POW (wsc? anyOperator)* + ; + +divOperator + : DIV (wsc? anyOperator)* + ; + +multOperator + : MULT (wsc? anyOperator)* + ; + +modOperator + : MOD (wsc? anyOperator)* + ; + +plusOperator + : PLUS (wsc? anyOperator)* + ; + +minusOperator + : MINUS (wsc? anyOperator)* + ; + +ampOperator + : AMPERSAND (wsc? anyOperator)* + ; + +isOperator + : IS (wsc? anyOperator)* + ; + +likeOperator + : LIKE (wsc? anyOperator)* + ; + +geqOperator + : GEQ (wsc? anyOperator)* + ; + +leqOperator + : LEQ (wsc? anyOperator)* + ; + +gtOperator + : GT (wsc? anyOperator)* + ; + +ltOperator + : LT (wsc? anyOperator)* + ; + +neqOperator + : NEQ (wsc? anyOperator)* + ; + +eqOperator + : EQ (wsc? anyOperator)* + ; + +andOperator + : AND (wsc? anyOperator)* + ; + +orOperator + : OR (wsc? anyOperator)* + ; + +xorOperator + : XOR (wsc? anyOperator)* + ; + +eqvOperator + : EQV (wsc? anyOperator)* + ; + +impOperator + : IMP (wsc? anyOperator)* + ; + + // keywords ABS : 'ABS' From 9c63ef0f477054589f42bc81b7d9580e584028c4 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:30:34 +0800 Subject: [PATCH 29/58] Enable module element listening --- server/src/project/parser/vbaListener.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 8f6f4a4..d01a0d1 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -94,12 +94,12 @@ export class VbaListener extends vbaListener { this.document.registerDiagnosticElement(element); }; - // enterProceduralModule = (ctx: ProceduralModuleContext) => { - // const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); - // this.document.registerSymbolInformation(element) - // .registerDiagnosticElement(element) - // .registerScopedElement(element); - // }; + enterProceduralModule = (ctx: ProceduralModuleContext) => { + const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); + this.document.registerSymbolInformation(element) + .registerDiagnosticElement(element) + // .registerScopedElement(element); + }; // exitProceduralModule = (ctx: ProceduralModuleContext) => { // this.document.deregisterScopedElement(); From 2cc5307b991b7a5e8779f1112311db47863c72cb Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:31:03 +0800 Subject: [PATCH 30/58] Enable class element listening --- server/src/project/parser/vbaListener.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index d01a0d1..39de833 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -72,12 +72,12 @@ export class VbaListener extends vbaListener { // this.document.deregisterScopedElement(); // }; - // enterClassModule = (ctx: ClassModuleContext) => { - // const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); - // this.document.registerSymbolInformation(element) - // .registerDiagnosticElement(element) - // .registerScopedElement(element); - // }; + enterClassModule = (ctx: ClassModuleContext) => { + const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); + this.document.registerSymbolInformation(element) + .registerDiagnosticElement(element) + // .registerScopedElement(element); + }; // exitClassModule = (ctx: ClassModuleContext) => { // this.document.deregisterScopedElement(); From 5e77ca0cd5ee4430176deef82dcbe9673ca478ca Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:31:22 +0800 Subject: [PATCH 31/58] Listen for any operator (multiples) --- server/src/project/parser/vbaListener.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 39de833..0ef931c 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -54,6 +54,11 @@ export class VbaListener extends vbaListener { this._documentSettings = await this.document.getDocumentConfiguration(); } + enterAnyOperator = (ctx: AnyOperatorContext) => { + const element = new DuplicateOperatorElement(ctx, this.document.textDocument); + this.document.registerDiagnosticElement(element); + } + enterEnumDeclaration = (ctx: EnumDeclarationContext) => { const element = new EnumDeclarationElement(ctx, this.document.textDocument, this._isAfterMethodDeclaration); this.document.registerFoldableElement(element) From e5dfa97de331077490861427e12bdeb6fb4b6a06 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:31:49 +0800 Subject: [PATCH 32/58] Update imports --- server/src/project/parser/vbaListener.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 0ef931c..391dda1 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -1,11 +1,11 @@ import { ErrorNode, ParserRuleContext } from 'antlr4ng'; import { vbaListener } from '../../antlr/out/vbaListener'; -import { ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; +import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; import { BaseProjectDocument, DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; -import { WhileLoopElement } from '../elements/flow'; -import { IgnoredAttributeElement } from '../elements/module'; +import { DuplicateOperatorElement, WhileLoopElement } from '../elements/flow'; +import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; import { ConstDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; import { vbapreListener } from '../../antlr/out/vbapreListener'; import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext} from '../../antlr/out/vbapreParser'; From 78bb64ace8052ba383cd9c6fdb12c75892e55c15 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:32:51 +0800 Subject: [PATCH 33/58] add DuplicateOperatorElement class --- server/src/project/elements/flow.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/src/project/elements/flow.ts b/server/src/project/elements/flow.ts index 0afd9a5..4cfb8ed 100644 --- a/server/src/project/elements/flow.ts +++ b/server/src/project/elements/flow.ts @@ -18,3 +18,16 @@ export class WhileLoopElement extends BaseContextSyntaxElement implements HasDia this.diagnostics.push(new WhileWendDeprecatedDiagnostic(this.range)) } } + +export class DuplicateOperatorElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { + diagnostics: Diagnostic[] = []; + + constructor(context: AnyOperatorContext, document: TextDocument) { + super(context, document); + } + + evaluateDiagnostics() { + this.diagnostics.push(new MultipleOperatorsDiagnostic(this.range)) + return this.diagnostics; + } +} \ No newline at end of file From d4796918c2f61b8def76fbd2cbfcfeba366515d9 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:33:03 +0800 Subject: [PATCH 34/58] Refactor and tidy --- server/src/capabilities/diagnostics.ts | 36 ++++++++++++-------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/server/src/capabilities/diagnostics.ts b/server/src/capabilities/diagnostics.ts index 3ab5659..97059a1 100644 --- a/server/src/capabilities/diagnostics.ts +++ b/server/src/capabilities/diagnostics.ts @@ -7,23 +7,26 @@ function hasDiagnosticRelatedInformationCapability(x: TextDocumentClientCapabili abstract class BaseDiagnostic implements Diagnostic { range: Range; + message: string severity?: DiagnosticSeverity | undefined; code?: string | number | undefined; codeDescription?: CodeDescription | undefined; source?: string | undefined; - abstract message: string; tags?: DiagnosticTag[] | undefined; relatedInformation?: DiagnosticRelatedInformation[] | undefined; data?: unknown; - constructor(range: Range) { + constructor(range: Range) + constructor(range: Range, message: string) + constructor(range: Range, message?: string) { this.range = range; + this.message = message ?? 'Generic diagnostic.'; } } export class MultipleOperatorsDiagnostic extends BaseDiagnostic { - message = "Unexpected duplicate operator"; + message = "Unexpected duplicate operator."; constructor(range: Range) { super(range); } @@ -33,41 +36,36 @@ export class WhileWendDeprecatedDiagnostic extends BaseDiagnostic { message = "The Do...Loop statement provides a more structured and flexible way to perform looping."; severity = DiagnosticSeverity.Information; constructor(range: Range) { - super(Range.create( - range.start, - Position.create(range.start.line, range.start.character + 4) - )); + super(Range.create(range.start, Position.create(range.start.line, range.start.character + 4))); } } +// test export class MissingAttributeDiagnostic extends BaseDiagnostic { - message: string; severity = DiagnosticSeverity.Error; - constructor(range: Range, attributeName: string) { - super(range); - this.message = `Module missing attribute ${attributeName}.`; + super(range, `Module missing attribute ${attributeName}.`); } } +// test export class DuplicateAttributeDiagnostic extends BaseDiagnostic { - message: string; severity = DiagnosticSeverity.Error; - constructor(range: Range, attributeName: string) { - super(range); - this.message = `Module duplicate attribute ${attributeName}.`; + super(range, `Module duplicate attribute ${attributeName}.`); } } +// test export class DuplicateDeclarationDiagnostic extends BaseDiagnostic { - message = "Duplicate declaration in current scope"; + message = "Duplicate declaration in current scope."; severity = DiagnosticSeverity.Error; constructor(range: Range) { super(range); } } +// test export class ShadowDeclarationDiagnostic extends BaseDiagnostic { message = "Declaration is shadowed in the local scope."; severity = DiagnosticSeverity.Error; @@ -76,6 +74,7 @@ export class ShadowDeclarationDiagnostic extends BaseDiagnostic { } } +// test export class IgnoredAttributeDiagnostic extends BaseDiagnostic { message = "This attribute will be ignored."; severity = DiagnosticSeverity.Information; @@ -92,11 +91,10 @@ export class MissingOptionExplicitDiagnostic extends BaseDiagnostic { } } +// test export class ElementOutOfPlaceDiagnostic extends BaseDiagnostic { - message: string; severity = DiagnosticSeverity.Error; constructor(range: Range, elementName: string) { - super(range); - this.message = `${elementName}s cannot appear below a Sub, Function, or Property declaration.` + super(range, `${elementName}s cannot appear below a Sub, Function, or Property declaration.`); } } \ No newline at end of file From 7d60164cb7af22027304b3f9569987178cda8a69 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:35:35 +0800 Subject: [PATCH 35/58] evaluateDiagnostics now returns the diagnostics for cleaner resolution --- server/src/project/document.ts | 8 ++++---- server/src/project/elements/base.ts | 2 +- server/src/project/elements/flow.ts | 8 ++++---- server/src/project/elements/memory.ts | 23 ++++++++++++++++------- server/src/project/elements/module.ts | 11 +++++++---- server/src/project/elements/special.ts | 4 ++-- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 99064df..6cdf69a 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -179,10 +179,10 @@ export abstract class BaseProjectDocument { await (new SyntaxParser()).parseAsync(this) // Evaluate the diagnostics. - this._hasDiagnosticElements.forEach(element => { - element.evaluateDiagnostics; - this._diagnostics.concat(element.diagnostics); - }); + this._diagnostics = this._hasDiagnosticElements + .map(e => e.evaluateDiagnostics()) + .flat(); + this._isBusy = false; }; diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index 4c2b5c6..f52f913 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -23,7 +23,7 @@ interface SyntaxElement extends ContextOptionalSyntaxElement { export interface HasDiagnosticCapability { diagnostics: Diagnostic[]; - evaluateDiagnostics(): void; + evaluateDiagnostics(): Diagnostic[]; } export interface NamedSyntaxElement extends SyntaxElement { diff --git a/server/src/project/elements/flow.ts b/server/src/project/elements/flow.ts index 4cfb8ed..d1cac94 100644 --- a/server/src/project/elements/flow.ts +++ b/server/src/project/elements/flow.ts @@ -1,9 +1,9 @@ import { Diagnostic } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; -import { WhileStatementContext } from '../../antlr/out/vbaParser'; +import { AnyOperatorContext, WhileStatementContext } from '../../antlr/out/vbaParser'; import { BaseContextSyntaxElement, HasDiagnosticCapability } from './base'; -import { WhileWendDeprecatedDiagnostic } from '../../capabilities/diagnostics'; +import { MultipleOperatorsDiagnostic, WhileWendDeprecatedDiagnostic } from '../../capabilities/diagnostics'; export class WhileLoopElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { @@ -11,11 +11,11 @@ export class WhileLoopElement extends BaseContextSyntaxElement implements HasDia constructor(context: WhileStatementContext, document: TextDocument) { super(context, document); - } - evaluateDiagnostics(): void { + evaluateDiagnostics() { this.diagnostics.push(new WhileWendDeprecatedDiagnostic(this.range)) + return this.diagnostics; } } diff --git a/server/src/project/elements/memory.ts b/server/src/project/elements/memory.ts index 078e8fa..c5460da 100644 --- a/server/src/project/elements/memory.ts +++ b/server/src/project/elements/memory.ts @@ -28,8 +28,8 @@ export abstract class ProcedureDeclarationElement extends ScopeElement { super(context, document); } - evaluateDiagnostics(): void { - return; + evaluateDiagnostics(): Diagnostic[] { + return []; } get name(): string { @@ -132,8 +132,9 @@ export class PropertyDeclarationElement extends ProcedureDeclarationElement impl ); } - evaluateDiagnostics(): void { + evaluateDiagnostics() { this._evaluateDuplicateDeclarationsDiagnostics(); + return this.diagnostics; } addPropertyDeclaration(context: ProcedureDeclarationContext, document: TextDocument) { @@ -238,10 +239,11 @@ export class EnumDeclarationElement extends BaseEnumDeclarationElement implement this.enumMembers = context.enumMemberList().enumElement().map(e => new EnumMemberDeclarationElement(e.enumMember()!, document)) } - evaluateDiagnostics(): void { + evaluateDiagnostics() { if (this.isDeclaredAfterMethod) { this.diagnostics.push(new ElementOutOfPlaceDiagnostic(this.range, 'Enum declaration')); } + return this.diagnostics } } @@ -260,7 +262,9 @@ class EnumMemberDeclarationElement extends BaseEnumDeclarationElement { this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); } - evaluateDiagnostics(): void { } + evaluateDiagnostics(): Diagnostic[] { + return []; + } } abstract class BaseVariableDeclarationStatementElement extends BaseContextSyntaxElement implements DeclarationElement { @@ -291,7 +295,9 @@ abstract class BaseVariableDeclarationStatementElement extends BaseContextSyntax } // Empty method so that implementation is optional. - evaluateDiagnostics(): void { } + evaluateDiagnostics(): Diagnostic[] { + return []; + } isPropertyElement(): this is PropertyDeclarationElement { return false; @@ -369,7 +375,10 @@ export class TypeDeclarationElement extends ScopeElement implements HasNamedSem this.declaredNames.get(e.identifier.text)?.push(e); } } - evaluateDiagnostics(): void { } + + evaluateDiagnostics(): Diagnostic[] { + return []; + } } export class TypeMemberDeclarationElement extends BaseVariableDeclarationStatementElement { diff --git a/server/src/project/elements/module.ts b/server/src/project/elements/module.ts index a608eed..5c94660 100644 --- a/server/src/project/elements/module.ts +++ b/server/src/project/elements/module.ts @@ -35,7 +35,7 @@ abstract class BaseModuleElement extends ScopeElement implements HasSymbolInform ); } - abstract evaluateDiagnostics(): void; + abstract evaluateDiagnostics(): Diagnostic[]; protected get _hasOptionExplicit(): boolean { const getCodeElements = () => { @@ -74,7 +74,7 @@ export class ModuleElement extends BaseModuleElement { this._name = this._getName(context); } - evaluateDiagnostics(): void { + evaluateDiagnostics() { if (this.settings.doWarnOptionExplicitMissing && !this._hasOptionExplicit) { const header = this.context.proceduralModuleHeader(); const startLine = header.stop?.line ?? 0 + 1; @@ -85,6 +85,7 @@ export class ModuleElement extends BaseModuleElement { ) )); } + return this.diagnostics; } private _getName(context: ProceduralModuleContext) { @@ -112,7 +113,7 @@ export class ClassElement extends BaseModuleElement { this._name = this._getName(context); } - evaluateDiagnostics(): void { + evaluateDiagnostics() { if (this.settings.doWarnOptionExplicitMissing && !this._hasOptionExplicit) { const header = this.context.classModuleHeader(); const startLine = header.stop?.line ?? 0 + 1; @@ -123,6 +124,7 @@ export class ClassElement extends BaseModuleElement { ) )); } + return this.diagnostics } private _getName(context: ClassModuleContext) { @@ -148,10 +150,11 @@ export class IgnoredAttributeElement extends BaseContextSyntaxElement implements super(context, document); } - evaluateDiagnostics(): void { + evaluateDiagnostics() { this.diagnostics.push( new IgnoredAttributeDiagnostic(this.range) ); + return this.diagnostics } } diff --git a/server/src/project/elements/special.ts b/server/src/project/elements/special.ts index ce7c431..3ebfe8c 100644 --- a/server/src/project/elements/special.ts +++ b/server/src/project/elements/special.ts @@ -32,7 +32,7 @@ export abstract class ScopeElement extends FoldableElement implements Declaratio super(ctx, doc, foldingRangeKind); } - abstract evaluateDiagnostics(): void; + abstract evaluateDiagnostics(): Diagnostic[]; abstract get name(): string; } @@ -48,7 +48,7 @@ export abstract class IdentifiableScopeElement extends BaseContextSyntaxElement isPropertyElement(): this is PropertyDeclarationElement { return 'getDeclarations' in this; } - abstract evaluateDiagnostics(): void; + abstract evaluateDiagnostics(): Diagnostic[]; get name(): string { return this.identifier.text; } From 50437fc9f21f4ef4c9b8233728795a0dce3b5362 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:36:07 +0800 Subject: [PATCH 36/58] Bug fix causing preparser to redact entire document --- server/src/project/document.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 6cdf69a..ead1a42 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -336,11 +336,9 @@ export abstract class BaseProjectDocument { // Replace the subtracted lines with spaces to maintain individual // character positional integrity. - const result = docLines.map((line, i) => { - i >= y && i < x - ? ' '.repeat(line.length) - : line - }); + const result = docLines.map((line, i) => + i >= y && i < x ? ' '.repeat(line.length) : line + ); return result.join('\r\n') } } From 7929e6650193f1b0726323d605eeda57ffe13822 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 17:36:35 +0800 Subject: [PATCH 37/58] Enable unit testing in workflow --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a17c200..6dae351 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -32,4 +32,4 @@ jobs: - name: npm run antlr4ng run: npm run antlr4ng && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out - run: npm run compile - # - run: npm test + - run: npm test From 76982ca5793666a7ad32c2f4041f226b6b88deb7 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 19:56:04 +0800 Subject: [PATCH 38/58] Added missing attribute diagnostic tests --- client/src/test/diagnostics.test.ts | 22 +++++++++++++++++++ client/testFixture/MissingAttributeClass.cls | 1 + client/testFixture/MissingAttributeModule.bas | 1 + server/src/capabilities/diagnostics.ts | 1 - server/src/project/elements/module.ts | 1 + 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 client/testFixture/MissingAttributeClass.cls create mode 100644 client/testFixture/MissingAttributeModule.bas diff --git a/client/src/test/diagnostics.test.ts b/client/src/test/diagnostics.test.ts index 41ec639..4c33c55 100644 --- a/client/src/test/diagnostics.test.ts +++ b/client/src/test/diagnostics.test.ts @@ -8,6 +8,28 @@ import * as assert from 'assert'; import { getDocUri, activate } from './helper'; suite('Should get diagnostics', () => { + test('diagnostics.class.missingNameAttributeError', async () => { + await testDiagnostics(getDocUri('MissingAttributeClass.cls'), [ + { + message: 'Module missing attribute VB_NAME.', + range: toRange(1, 0, 1, 0), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + } + ]); + }); + + test('diagnostics.module.missingNameAttributeError', async () => { + await testDiagnostics(getDocUri('MissingAttributeModule.bas'), [ + { + message: 'Module missing attribute VB_NAME.', + range: toRange(1, 0, 1, 0), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + } + ]); + }); + test('diagnostics.class.noOptionExplicitWarning', async () => { await testDiagnostics(getDocUri('EmptyClass.cls'), [ { diff --git a/client/testFixture/MissingAttributeClass.cls b/client/testFixture/MissingAttributeClass.cls new file mode 100644 index 0000000..4f97aa8 --- /dev/null +++ b/client/testFixture/MissingAttributeClass.cls @@ -0,0 +1 @@ +Option Explicit diff --git a/client/testFixture/MissingAttributeModule.bas b/client/testFixture/MissingAttributeModule.bas new file mode 100644 index 0000000..4f97aa8 --- /dev/null +++ b/client/testFixture/MissingAttributeModule.bas @@ -0,0 +1 @@ +Option Explicit diff --git a/server/src/capabilities/diagnostics.ts b/server/src/capabilities/diagnostics.ts index 97059a1..ed55641 100644 --- a/server/src/capabilities/diagnostics.ts +++ b/server/src/capabilities/diagnostics.ts @@ -40,7 +40,6 @@ export class WhileWendDeprecatedDiagnostic extends BaseDiagnostic { } } -// test export class MissingAttributeDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Error; constructor(range: Range, attributeName: string) { diff --git a/server/src/project/elements/module.ts b/server/src/project/elements/module.ts index 5c94660..c2aa789 100644 --- a/server/src/project/elements/module.ts +++ b/server/src/project/elements/module.ts @@ -130,6 +130,7 @@ export class ClassElement extends BaseModuleElement { private _getName(context: ClassModuleContext) { const nameAttributes = context.classModuleHeader().nameAttr(); + // TODO: Check if other attributes are required and validate them. if (nameAttributes.length === 0) { this.diagnostics.push(new MissingAttributeDiagnostic( Range.create(this.range.start, this.range.start), From e0216759b2eecbfb362a56bfac11bcf6f414880f Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 22 Nov 2024 19:56:17 +0800 Subject: [PATCH 39/58] Bug fixed unit tests --- client/src/test/diagnostics.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/test/diagnostics.test.ts b/client/src/test/diagnostics.test.ts index 4c33c55..fa4b5a8 100644 --- a/client/src/test/diagnostics.test.ts +++ b/client/src/test/diagnostics.test.ts @@ -64,7 +64,7 @@ suite('Should get diagnostics', () => { { message: 'Unexpected duplicate operator.', range: toRange(8, 15, 8, 16), - severity: vscode.DiagnosticSeverity.Information, + severity: vscode.DiagnosticSeverity.Error, source: 'ex' } ]); @@ -82,12 +82,12 @@ async function testDiagnostics(docUri: vscode.Uri, expectedDiagnostics: vscode.D const actualDiagnostics = vscode.languages.getDiagnostics(docUri); - assert.equal(actualDiagnostics.length, expectedDiagnostics.length); + assert.equal(actualDiagnostics.length, expectedDiagnostics.length, "Count"); expectedDiagnostics.forEach((expectedDiagnostic, i) => { const actualDiagnostic = actualDiagnostics[i]; - assert.equal(actualDiagnostic.message, expectedDiagnostic.message); - assert.deepEqual(actualDiagnostic.range, expectedDiagnostic.range); - assert.equal(actualDiagnostic.severity, expectedDiagnostic.severity); + assert.equal(actualDiagnostic.message, expectedDiagnostic.message, "Message"); + assert.deepEqual(actualDiagnostic.range, expectedDiagnostic.range, "Range"); + assert.equal(actualDiagnostic.severity, expectedDiagnostic.severity, "Severity"); }); } \ No newline at end of file From beabb85eda9619f2fc052b961be3785e54cbd648 Mon Sep 17 00:00:00 2001 From: sslinky Date: Sat, 23 Nov 2024 09:21:51 +0800 Subject: [PATCH 40/58] Refactor unknown attributes and move ctxToRange to helpers --- client/src/test/diagnostics.test.ts | 22 +++++++++++++-- client/testFixture/Diagnostics.bas | 16 ++++++++++- server/src/antlr/vba.g4 | 19 +++++++++++-- server/src/capabilities/diagnostics.ts | 7 +++-- server/src/project/elements/base.ts | 14 +++------- server/src/project/elements/module.ts | 34 ++++++++++++++++++------ server/src/project/parser/vbaListener.ts | 11 ++++---- server/src/utils/helpers.ts | 17 ++++++++++++ 8 files changed, 107 insertions(+), 33 deletions(-) diff --git a/client/src/test/diagnostics.test.ts b/client/src/test/diagnostics.test.ts index fa4b5a8..01037db 100644 --- a/client/src/test/diagnostics.test.ts +++ b/client/src/test/diagnostics.test.ts @@ -55,15 +55,33 @@ suite('Should get diagnostics', () => { test('diagnostics.module.generalDiagnostics', async () => { // Diagnostics are sorted by severity! await testDiagnostics(getDocUri('Diagnostics.bas'), [ + { + message: 'Module duplicate attribute VB_Name.', + range: toRange(2, 0, 2, 33), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + }, + { + message: 'Unknown attribute \'VB_Creatable\' will be ignored.', + range: toRange(3, 0, 3, 30), + severity: vscode.DiagnosticSeverity.Warning, + source: 'ex' + }, + { + message: 'Unknown attribute \'VB_Foo\' will be ignored.', + range: toRange(4, 0, 4, 24), + severity: vscode.DiagnosticSeverity.Warning, + source: 'ex' + }, { message: 'The Do...Loop statement provides a more structured and flexible way to perform looping.', - range: toRange(7, 4, 7, 8), + range: toRange(10, 4, 10, 8), severity: vscode.DiagnosticSeverity.Information, source: 'ex' }, { message: 'Unexpected duplicate operator.', - range: toRange(8, 15, 8, 16), + range: toRange(11, 15, 11, 16), severity: vscode.DiagnosticSeverity.Error, source: 'ex' } diff --git a/client/testFixture/Diagnostics.bas b/client/testFixture/Diagnostics.bas index 76d571e..74d3ee7 100644 --- a/client/testFixture/Diagnostics.bas +++ b/client/testFixture/Diagnostics.bas @@ -1,4 +1,7 @@ Attribute VB_Name = "Diagnostics" +Attribute VB_Name = "Diagnostics" +Attribute VB_Creatable = False +Attribute VB_Foo = False Option Explicit @@ -8,4 +11,15 @@ Public Sub Foo() i = i ++ 1 i = i <> 1 Wend -End Sub \ No newline at end of file +End Sub + +Sub Identifier() +Attribute Identifier.VB_Description = "Dosctring." +Attribute Identifier.VB_Description = "Dosctring." +' Dosctring. +' +' Args: +' param1: +' +' Raises: +' diff --git a/server/src/antlr/vba.g4 b/server/src/antlr/vba.g4 index 0ecbc2c..c29d248 100644 --- a/server/src/antlr/vba.g4 +++ b/server/src/antlr/vba.g4 @@ -76,9 +76,20 @@ classModule // Compare STRINGLITERAL to quoted-identifier proceduralModuleHeader - : endOfLine* nameAttr? + : (endOfLine* proceduralModuleAttr)* ; -classModuleHeader: (endOfLine+ (classAttr | nameAttr | ignoredAttr))* WS?; + +proceduralModuleAttr + : nameAttr + | ignoredProceduralAttr + ; + +ignoredProceduralAttr + : classAttr + | ignoredAttr + ; + +classModuleHeader: (endOfLine+ (classAttr | nameAttr | ignoredClassAttr))* WS?; // VBA Library Projects are allowed to have GoobalNamespace and creatable as true. classAttr @@ -90,6 +101,10 @@ classAttr | ATTRIBUTE WS? VB_CUSTOMIZABLE WS? eqOperator WS? booleanLiteralIdentifier ; +ignoredClassAttr + : ignoredAttr + ; + ignoredAttr : ATTRIBUTE WS? ambiguousIdentifier WS? eqOperator WS? expression ; diff --git a/server/src/capabilities/diagnostics.ts b/server/src/capabilities/diagnostics.ts index ed55641..c23ca95 100644 --- a/server/src/capabilities/diagnostics.ts +++ b/server/src/capabilities/diagnostics.ts @@ -75,10 +75,9 @@ export class ShadowDeclarationDiagnostic extends BaseDiagnostic { // test export class IgnoredAttributeDiagnostic extends BaseDiagnostic { - message = "This attribute will be ignored."; - severity = DiagnosticSeverity.Information; - constructor(range: Range) { - super(range); + severity = DiagnosticSeverity.Warning; + constructor(range: Range, attributeName: string) { + super(range, `Unknown attribute '${attributeName}' will be ignored.`); } } diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index f52f913..e2af10e 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -5,6 +5,7 @@ import { FoldingRangeKind } from '../../capabilities/folding'; import { IdentifierElement, PropertyDeclarationElement } from './memory'; import '../../extensions/parserExtensions'; import { IdentifiableScopeElement } from './special'; +import { contextToRange } from '../../utils/helpers'; export interface ContextOptionalSyntaxElement { range?: Range; @@ -95,17 +96,8 @@ export abstract class BaseSyntaxElement implements ContextOptionalSyntaxElement && isPositionBefore(this.range.end, range.end); }; - private _contextToRange(): Range | undefined { - if (!this.context) { - return; - } - - const startIndex = this.context?.start?.start ?? 0; - const stopIndex = this.context.stop?.stop ?? startIndex; - return Range.create( - this.document.positionAt(startIndex), - this.document.positionAt(stopIndex + 1) - ); + protected _contextToRange(): Range | undefined { + return contextToRange(this.document, this.context); } } diff --git a/server/src/project/elements/module.ts b/server/src/project/elements/module.ts index c2aa789..4f27efd 100644 --- a/server/src/project/elements/module.ts +++ b/server/src/project/elements/module.ts @@ -1,11 +1,12 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, Range, SymbolInformation, SymbolKind } from 'vscode-languageserver'; -import { ClassModuleContext, IgnoredAttrContext, ProceduralModuleContext } from '../../antlr/out/vbaParser'; +import { ClassModuleContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, NameAttrContext, ProceduralModuleAttrContext, ProceduralModuleContext } from '../../antlr/out/vbaParser'; import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSymbolInformation } from './base'; import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; -import { IgnoredAttributeDiagnostic, MissingAttributeDiagnostic, MissingOptionExplicitDiagnostic } from '../../capabilities/diagnostics'; +import { DuplicateAttributeDiagnostic, IgnoredAttributeDiagnostic, MissingAttributeDiagnostic, MissingOptionExplicitDiagnostic } from '../../capabilities/diagnostics'; import '../../extensions/stringExtensions'; import { ScopeElement } from './special'; +import { contextToRange } from '../../utils/helpers'; interface DocumentSettings { doWarnOptionExplicitMissing: boolean; @@ -89,17 +90,31 @@ export class ModuleElement extends BaseModuleElement { } private _getName(context: ProceduralModuleContext) { - const nameAttribute = context.proceduralModuleHeader()?.nameAttr(); - const name = nameAttribute?.STRINGLITERAL().getText(); + const attributes = context.proceduralModuleHeader().proceduralModuleAttr(); + const nameAttributes = attributes.map(x => x.nameAttr()).filter(x => !!x) - if (!name) { + // If we don't have any name attributes... + if (nameAttributes.length === 0) { this.diagnostics.push(new MissingAttributeDiagnostic( Range.create(this.range.start, this.range.start), 'VB_NAME' )); + return 'Unknown Module'; } - return name?.stripQuotes() ?? 'Unknown Module'; + // Shift the first name attribute to use as the name. + const name = nameAttributes.shift()!.STRINGLITERAL().getText(); + + // Handle remaining name attributes, pushing each one to + // diagnostics because concat doesn't work here for some reason. + nameAttributes.map(e => + new DuplicateAttributeDiagnostic( + contextToRange(this.document, e)!, + e.getText().split(' ')[1] + )).forEach(d => this.diagnostics.push(d)); + + // Return the name of the module. + return name.stripQuotes(); } } @@ -147,13 +162,16 @@ export class ClassElement extends BaseModuleElement { export class IgnoredAttributeElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { diagnostics: Diagnostic[] = []; - constructor(context: IgnoredAttrContext, document: TextDocument) { + constructor(context: IgnoredClassAttrContext | IgnoredProceduralAttrContext, document: TextDocument) { super(context, document); } evaluateDiagnostics() { this.diagnostics.push( - new IgnoredAttributeDiagnostic(this.range) + new IgnoredAttributeDiagnostic( + this.range, + this.context.getText().split(' ')[1] + ) ); return this.diagnostics } diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 391dda1..148e95b 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -1,6 +1,6 @@ import { ErrorNode, ParserRuleContext } from 'antlr4ng'; import { vbaListener } from '../../antlr/out/vbaListener'; -import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; +import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; import { BaseProjectDocument, DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; @@ -94,10 +94,11 @@ export class VbaListener extends vbaListener { .registerSymbolInformation(element); }; - enterIgnoredAttr = (ctx: IgnoredAttrContext) => { - const element = new IgnoredAttributeElement(ctx, this.document.textDocument); - this.document.registerDiagnosticElement(element); - }; + enterIgnoredClassAttr = (ctx: IgnoredClassAttrContext) => this.registerIgnoredAttribute(ctx); + enterIgnoredProceduralAttr = (ctx: IgnoredProceduralAttrContext) => this.registerIgnoredAttribute(ctx); + private registerIgnoredAttribute(ctx: IgnoredClassAttrContext | IgnoredProceduralAttrContext) { + this.document.registerDiagnosticElement(new IgnoredAttributeElement(ctx, this.document.textDocument)) + } enterProceduralModule = (ctx: ProceduralModuleContext) => { const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); diff --git a/server/src/utils/helpers.ts b/server/src/utils/helpers.ts index 7e27081..b989b98 100644 --- a/server/src/utils/helpers.ts +++ b/server/src/utils/helpers.ts @@ -1,3 +1,20 @@ +import { ParserRuleContext } from 'antlr4ng'; +import { Range } from 'vscode-languageserver'; +import { TextDocument } from 'vscode-languageserver-textdocument'; + export function sleep(ms: number): Promise { return new Promise(resolve => setTimeout(resolve, ms) ); } + +export function contextToRange(doc: TextDocument, ctx?: ParserRuleContext): Range | undefined { + if (!ctx) { + return; + } + + const startIndex = ctx.start?.start ?? 0; + const stopIndex = ctx.stop?.stop ?? startIndex; + return Range.create( + doc.positionAt(startIndex), + doc.positionAt(stopIndex + 1) + ); +} \ No newline at end of file From 3c2ceb04a36b9fb4c3f9505a5f5047ea78b403ce Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 24 Nov 2024 23:14:24 +0800 Subject: [PATCH 41/58] Supports duplicate attribute diagnostics --- server/src/capabilities/diagnostics.ts | 3 -- server/src/project/elements/module.ts | 62 ++++++++++++++++++++------ 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/server/src/capabilities/diagnostics.ts b/server/src/capabilities/diagnostics.ts index c23ca95..5a3ac2f 100644 --- a/server/src/capabilities/diagnostics.ts +++ b/server/src/capabilities/diagnostics.ts @@ -47,7 +47,6 @@ export class MissingAttributeDiagnostic extends BaseDiagnostic { } } -// test export class DuplicateAttributeDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Error; constructor(range: Range, attributeName: string) { @@ -73,7 +72,6 @@ export class ShadowDeclarationDiagnostic extends BaseDiagnostic { } } -// test export class IgnoredAttributeDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Warning; constructor(range: Range, attributeName: string) { @@ -89,7 +87,6 @@ export class MissingOptionExplicitDiagnostic extends BaseDiagnostic { } } -// test export class ElementOutOfPlaceDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Error; constructor(range: Range, elementName: string) { diff --git a/server/src/project/elements/module.ts b/server/src/project/elements/module.ts index 4f27efd..5ada674 100644 --- a/server/src/project/elements/module.ts +++ b/server/src/project/elements/module.ts @@ -1,12 +1,13 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, Range, SymbolInformation, SymbolKind } from 'vscode-languageserver'; -import { ClassModuleContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, NameAttrContext, ProceduralModuleAttrContext, ProceduralModuleContext } from '../../antlr/out/vbaParser'; +import { ClassModuleContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext } from '../../antlr/out/vbaParser'; import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSymbolInformation } from './base'; import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; import { DuplicateAttributeDiagnostic, IgnoredAttributeDiagnostic, MissingAttributeDiagnostic, MissingOptionExplicitDiagnostic } from '../../capabilities/diagnostics'; import '../../extensions/stringExtensions'; import { ScopeElement } from './special'; import { contextToRange } from '../../utils/helpers'; +import { ParserRuleContext } from 'antlr4ng'; interface DocumentSettings { doWarnOptionExplicitMissing: boolean; @@ -60,6 +61,20 @@ abstract class BaseModuleElement extends ScopeElement implements HasSymbolInform return false; } + protected _duplicateAttributes(attrs: ParserRuleContext[]) { + const catalogue = new Map(); + const result: ParserRuleContext[] = []; + attrs.forEach(attr => { + const attrName = getAttributeName(attr); + if (catalogue.has(attrName)) { + result.push(attr) + } else { + catalogue.set(attrName, null); + } + }) + return result; + } + private _isClassModule(context: ProceduralModuleContext | ClassModuleContext): context is ClassModuleContext { return 'classModuleHeader' in context; } @@ -67,15 +82,26 @@ abstract class BaseModuleElement extends ScopeElement implements HasSymbolInform export class ModuleElement extends BaseModuleElement { context: ProceduralModuleContext; + attrubutes: ParserRuleContext[]; protected _name: string; constructor(context: ProceduralModuleContext, document: TextDocument, documentSettings: DocumentSettings) { super(context, document, SymbolKind.File, documentSettings); this.context = context; + this.attrubutes = context.proceduralModuleHeader().proceduralModuleAttr(); this._name = this._getName(context); } evaluateDiagnostics() { + // Diagnose duplicate attributes. + this._duplicateAttributes(this.attrubutes).forEach(attr => + this.diagnostics.push(new DuplicateAttributeDiagnostic( + contextToRange(this.document, attr)!, + getAttributeName(attr) + )) + ); + + // Diagnose option explicit is missing. if (this.settings.doWarnOptionExplicitMissing && !this._hasOptionExplicit) { const header = this.context.proceduralModuleHeader(); const startLine = header.stop?.line ?? 0 + 1; @@ -86,6 +112,7 @@ export class ModuleElement extends BaseModuleElement { ) )); } + return this.diagnostics; } @@ -102,33 +129,38 @@ export class ModuleElement extends BaseModuleElement { return 'Unknown Module'; } - // Shift the first name attribute to use as the name. - const name = nameAttributes.shift()!.STRINGLITERAL().getText(); - - // Handle remaining name attributes, pushing each one to - // diagnostics because concat doesn't work here for some reason. - nameAttributes.map(e => - new DuplicateAttributeDiagnostic( - contextToRange(this.document, e)!, - e.getText().split(' ')[1] - )).forEach(d => this.diagnostics.push(d)); - - // Return the name of the module. + // Get the name from the name attribute. + const name = nameAttributes[0].STRINGLITERAL().getText(); return name.stripQuotes(); } } export class ClassElement extends BaseModuleElement { context: ClassModuleContext; + attrubutes: ParserRuleContext[]; protected _name: string; constructor(context: ClassModuleContext, document: TextDocument, documentSettings: DocumentSettings) { super(context, document, SymbolKind.Class, documentSettings); this.context = context; + this.attrubutes = [ + context.classModuleHeader().nameAttr(), + context.classModuleHeader().classAttr(), + context.classModuleHeader().ignoredClassAttr() + ].flat(); this._name = this._getName(context); } evaluateDiagnostics() { + // Diagnose duplicate attributes. + this._duplicateAttributes(this.attrubutes).forEach(attr => + this.diagnostics.push(new DuplicateAttributeDiagnostic( + contextToRange(this.document, attr)!, + getAttributeName(attr) + )) + ); + + // Diagnose option explicit is missing. if (this.settings.doWarnOptionExplicitMissing && !this._hasOptionExplicit) { const header = this.context.classModuleHeader(); const startLine = header.stop?.line ?? 0 + 1; @@ -178,6 +210,10 @@ export class IgnoredAttributeElement extends BaseContextSyntaxElement implements } +function getAttributeName(e: ParserRuleContext): string { + return e.getText().split(' ')[1] +} + // export class ModuleElement2 extends BaseContextSyntaxElement implements HasSymbolInformation, HasAttribute, HasDiagnosticCapability { // private _hasName = false; From 991ae87284a18f35b7499e16b8c4cf123fa931e5 Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 24 Nov 2024 23:15:29 +0800 Subject: [PATCH 42/58] Added enum diagnostic test and wrote class general tests --- client/src/test/diagnostics.test.ts | 56 ++++++++++++++++++++++++++++- client/testFixture/Diagnostics.bas | 7 ++++ client/testFixture/Diagnostics.cls | 41 +++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 client/testFixture/Diagnostics.cls diff --git a/client/src/test/diagnostics.test.ts b/client/src/test/diagnostics.test.ts index 01037db..41469f9 100644 --- a/client/src/test/diagnostics.test.ts +++ b/client/src/test/diagnostics.test.ts @@ -53,7 +53,7 @@ suite('Should get diagnostics', () => { }); test('diagnostics.module.generalDiagnostics', async () => { - // Diagnostics are sorted by severity! + // Don't seem to be able to sort these. Good luck! await testDiagnostics(getDocUri('Diagnostics.bas'), [ { message: 'Module duplicate attribute VB_Name.', @@ -84,6 +84,60 @@ suite('Should get diagnostics', () => { range: toRange(11, 15, 11, 16), severity: vscode.DiagnosticSeverity.Error, source: 'ex' + }, + { + message: 'Enum declarations cannot appear below a Sub, Function, or Property declaration.', + range: toRange(28, 7, 32, 8), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + } + ]); + }); + + test('diagnostics.class.generalDiagnostics', async () => { + // Don't seem to be able to sort these. Good luck! + await testDiagnostics(getDocUri('Diagnostics.cls'), [ + { + message: 'Module duplicate attribute VB_GlobalNameSpace.', + range: toRange(8, 0, 8, 36), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + }, + { + message: 'Module duplicate attribute VB_Exxposed.', + range: toRange(13, 0, 13, 29), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + }, + { + message: 'Unknown attribute \'VB_Exxposed\' will be ignored.', + range: toRange(12, 0, 12, 29), + severity: vscode.DiagnosticSeverity.Warning, + source: 'ex' + }, + { + message: 'Unknown attribute \'VB_Exxposed\' will be ignored.', + range: toRange(13, 0, 13, 29), + severity: vscode.DiagnosticSeverity.Warning, + source: 'ex' + }, + { + message: 'The Do...Loop statement provides a more structured and flexible way to perform looping.', + range: toRange(19, 4, 19, 8), + severity: vscode.DiagnosticSeverity.Information, + source: 'ex' + }, + { + message: 'Unexpected duplicate operator.', + range: toRange(20, 15, 20, 16), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' + }, + { + message: 'Enum declarations cannot appear below a Sub, Function, or Property declaration.', + range: toRange(37, 7, 41, 8), + severity: vscode.DiagnosticSeverity.Error, + source: 'ex' } ]); }); diff --git a/client/testFixture/Diagnostics.bas b/client/testFixture/Diagnostics.bas index 74d3ee7..eedef31 100644 --- a/client/testFixture/Diagnostics.bas +++ b/client/testFixture/Diagnostics.bas @@ -23,3 +23,10 @@ Attribute Identifier.VB_Description = "Dosctring." ' ' Raises: ' +End Sub + +Public Enum EnumFoo + Enum1 + Enum2 + Enum3 +End Enum diff --git a/client/testFixture/Diagnostics.cls b/client/testFixture/Diagnostics.cls new file mode 100644 index 0000000..70ec3a7 --- /dev/null +++ b/client/testFixture/Diagnostics.cls @@ -0,0 +1,41 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True +END +Attribute VB_Name = "Diagnostics" +Attribute VB_Description = "Class description goes here" +Attribute VB_GlobalNameSpace = False +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = False +Attribute VB_Exposed = False +Attribute VB_Exxposed = False +Attribute VB_Exxposed = False + +Option Explicit + +Public Sub Foo() + Dim i As Long + While True + i = i ++ 1 + i = i <> 1 + Wend +End Sub + +Sub Identifier() +Attribute Identifier.VB_Description = "Dosctring." +Attribute Identifier.VB_Description = "Dosctring." +' Dosctring. +' +' Args: +' param1: +' +' Raises: +' +End Sub + +Public Enum EnumFoo + Enum1 + Enum2 + Enum3 +End Enum From 276046d02d74b39fd0f8d53583905adb54d63823 Mon Sep 17 00:00:00 2001 From: sslinky Date: Mon, 25 Nov 2024 12:15:39 +0800 Subject: [PATCH 43/58] New getOrCreate extension for Map --- server/src/extensions/mapExtensions.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 server/src/extensions/mapExtensions.ts diff --git a/server/src/extensions/mapExtensions.ts b/server/src/extensions/mapExtensions.ts new file mode 100644 index 0000000..83c3ff2 --- /dev/null +++ b/server/src/extensions/mapExtensions.ts @@ -0,0 +1,15 @@ +interface Map { + /** + * Returns a specified element from the Map object. If the value that is associated to the provided key is an object, + * then you will get a reference to that object and any change made to that object will effectively modify it inside the Map. + * @returns Returns the element associated with the specified key. If no element is associated with the specified key, it is created first. + */ + getOrCreate(key: K, factory: () => V): V; +} + +Map.prototype.getOrCreate = function (this: Map, key: K, factory: () => V): V { + if (!this.has(key)) { + this.set(key, factory()); + } + return this.get(key)!; +}; From ff80eb6f9a6489d3a4f615087f92633baaff8ba2 Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 29 Nov 2024 15:12:21 +0800 Subject: [PATCH 44/58] Fix extensions --- server/src/extensions/mapExtensions.ts | 15 ---------- server/src/extensions/parserExtensions.ts | 35 ++++++++++++----------- 2 files changed, 18 insertions(+), 32 deletions(-) delete mode 100644 server/src/extensions/mapExtensions.ts diff --git a/server/src/extensions/mapExtensions.ts b/server/src/extensions/mapExtensions.ts deleted file mode 100644 index 83c3ff2..0000000 --- a/server/src/extensions/mapExtensions.ts +++ /dev/null @@ -1,15 +0,0 @@ -interface Map { - /** - * Returns a specified element from the Map object. If the value that is associated to the provided key is an object, - * then you will get a reference to that object and any change made to that object will effectively modify it inside the Map. - * @returns Returns the element associated with the specified key. If no element is associated with the specified key, it is created first. - */ - getOrCreate(key: K, factory: () => V): V; -} - -Map.prototype.getOrCreate = function (this: Map, key: K, factory: () => V): V { - if (!this.has(key)) { - this.set(key, factory()); - } - return this.get(key)!; -}; diff --git a/server/src/extensions/parserExtensions.ts b/server/src/extensions/parserExtensions.ts index 1f6052e..e41272e 100644 --- a/server/src/extensions/parserExtensions.ts +++ b/server/src/extensions/parserExtensions.ts @@ -1,24 +1,25 @@ -import { Range, SymbolKind } from 'vscode-languageserver'; +import { ParserRuleContext } from 'antlr4ng'; +import { Range } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; -// import { ParserRuleContext } from 'antlr4ts'; -// This extension throws a compiler error TS2693: 'ParserRuleContext' only refers to a type, but is being used as a value here. -// Can maybe review later down the track, but for now have just made it a private method on BaseSyntaxElement. -// declare module 'antlr4ts' { -// export interface ParserRuleContext { -// toRange(document: TextDocument): Range; -// } -// } +declare module 'antlr4ng' { + interface ParserRuleContext { + toRange(doc: TextDocument): Range; + } +} -// ParserRuleContext.prototype.toRange = function (document: TextDocument): Range { -// const startIndex = this.start.startIndex; -// const stopIndex = this.stop?.stopIndex ?? startIndex; -// return Range.create( -// document.positionAt(startIndex), -// document.positionAt(stopIndex) -// ); -// }; +/** + * Convert the context to a range. + */ +ParserRuleContext.prototype.toRange = function (doc: TextDocument): Range { + const startIndex = this.start?.start ?? 0; + const stopIndex = this.stop?.stop ?? startIndex; + return Range.create( + doc.positionAt(startIndex), + doc.positionAt(stopIndex + 1) + ); +}; // declare module '../antlr/out/vbaParser' { // export interface BaseTypeContext { From a20cf56fc73d53453012e2ec3a4264561d7c4ebb Mon Sep 17 00:00:00 2001 From: sslinky Date: Fri, 29 Nov 2024 15:14:10 +0800 Subject: [PATCH 45/58] Refactor simplified scope --- server/src/project/document.ts | 95 ++++-------------------- server/src/project/elements/base.ts | 4 +- server/src/project/elements/memory.ts | 24 +++--- server/src/project/elements/module.ts | 13 +++- server/src/project/elements/operator.ts | 19 ----- server/src/project/parser/vbaListener.ts | 58 ++++++--------- server/src/project/scope.ts | 82 ++++++++++---------- server/src/project/workspace.ts | 10 +-- 8 files changed, 108 insertions(+), 197 deletions(-) delete mode 100644 server/src/project/elements/operator.ts diff --git a/server/src/project/document.ts b/server/src/project/document.ts index ead1a42..ad5a7a3 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -1,14 +1,12 @@ -import { CancellationToken, Diagnostic, DocumentDiagnosticReport, DocumentDiagnosticReportKind, PublishDiagnosticsParams, SymbolInformation, SymbolKind } from 'vscode-languageserver'; +import { CancellationToken, Diagnostic, DocumentDiagnosticReport, DocumentDiagnosticReportKind, SymbolInformation, SymbolKind } from 'vscode-languageserver'; import { Workspace } from './workspace'; -import { FoldableElement, IdentifiableScopeElement } from './elements/special'; -import { BaseContextSyntaxElement, DeclarationElement, HasDiagnosticCapability, HasNamedSemanticToken, HasSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement } from './elements/base'; +import { FoldableElement } from './elements/special'; +import { BaseContextSyntaxElement, HasDiagnosticCapability, HasNamedSemanticToken, HasSemanticToken, HasSymbolInformation, NamedSyntaxElement } from './elements/base'; import { Range, TextDocument } from 'vscode-languageserver-textdocument'; import { SyntaxParser } from './parser/vbaParser'; import { FoldingRange } from '../capabilities/folding'; import { SemanticTokensManager } from '../capabilities/semanticTokens'; import { ParseCancellationException } from 'antlr4ng'; -import { Scope } from './scope'; -import { DuplicateDeclarationDiagnostic, ShadowDeclarationDiagnostic } from '../capabilities/diagnostics'; export interface DocumentSettings { maxDocumentLines: number; @@ -28,19 +26,15 @@ export abstract class BaseProjectDocument { protected _hasDiagnosticElements: HasDiagnosticCapability[] = []; protected _unhandledNamedElements: [] = []; - // protected _publicScopeDeclarations: Map = new Map(); protected _documentScopeDeclarations: Map> = new Map(); protected _diagnostics: Diagnostic[] = []; - protected _elementParents: Scope[] = []; - // protected _attributeElements: HasAttribute[] = []; protected _foldableElements: FoldingRange[] = []; protected _symbolInformations: SymbolInformation[] = []; protected _semanticTokens: SemanticTokensManager = new SemanticTokensManager(); protected _redactedElements: BaseContextSyntaxElement[] = []; protected _isBusy = true; - // protected _hasParseResult = false; abstract symbolKind: SymbolKind get isBusy() { @@ -54,27 +48,10 @@ export abstract class BaseProjectDocument { )(); } - // get hasParseResult() { - // return this._hasParseResult; - // } - get redactedText() { return this._subtractTextFromRanges(this._redactedElements.map(x => x.range)); } - get currentScopeElement() { - return this._elementParents.at(-1) ?? this.workspace.globalScope; - } - - get moduleScope() { - const scope = this._elementParents.at(0); - if (!scope) { - throw new Error("Expected module scope!"); - } - - return scope; - } - async getDocumentConfiguration(): Promise { // Get the stored configuration. if (this._documentConfiguration) { @@ -103,10 +80,6 @@ export abstract class BaseProjectDocument { } clearDocumentConfiguration = () => this._documentConfiguration = undefined; - - // get activeAttributeElement() { - // return this._attributeElements?.at(-1); - // } constructor(workspace: Workspace, name: string, document: TextDocument) { this.textDocument = document; @@ -186,23 +159,18 @@ export abstract class BaseProjectDocument { this._isBusy = false; }; - registerNamedElementDeclaration(element: IdentifiableScopeElement) { - const scope = element.isPublic ? this.workspace.globalScope : this.currentScopeElement; + registerNamedElementDeclaration(element: NamedSyntaxElement) { + this.workspace.namespaceManager.addNameItem(element); + return this; + } - // Check for duplicate declarations - if (!!scope.declaredNames.has(element.name)) { - element.diagnostics.push(new DuplicateDeclarationDiagnostic(element.identifier.range)) - } + registerNamespaceElement(element: NamedSyntaxElement) { + this.workspace.namespaceManager.addNamespace(element); + return this; + } - // Check for variable shadowing. - // TODO: This doesn't work for vars declared at a higher level AFTER the lower level. - // e.g.: Private Const FOO - // Public Const FOO - if (!!scope.parentScope?.findDeclaration(element.name)) { - element.diagnostics.push(new ShadowDeclarationDiagnostic(element.identifier.range)) - } - - scope.pushDeclaredName(element); + deregisterScopedElement() { + this.workspace.namespaceManager.popNamespace(); return this; } @@ -238,43 +206,6 @@ export abstract class BaseProjectDocument { return this; }; - registerPublicNamedElement(element: DeclarationElement) { - this.workspace.globalScope.pushDeclaredName(element); - return this; - } - - registerNamedElement(element: DeclarationElement) { - this.currentScopeElement?.pushDeclaredName(element); - return this; - } - - /** - * Registers scope as a parent to be attached to subsequent elemements. - * Should be called when the parser context is entered and matched with - * deregisterScope when the context exits. - * @param scope the element to register. - * @returns the registered scope. - */ - registerScope(): Scope { - const parent = this.currentScopeElement; - const scope = new Scope(parent); - - parent.children.push(scope) - this._elementParents.push(scope); - return scope; - } - - /** - * Deregisters a scope as a parent so it isn't attached to subsequent elemements. - * Should be called when the parser context is exited and matched with - * registerScope when the context is entered. - * @returns this for chaining. - */ - deregisterScope = () => { - this._elementParents.pop(); - return this; - }; - /** * Registers a semantic token element for tracking with the SemanticTokenManager. * @param element element The element that has a semantic token. diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index e2af10e..0c12473 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -4,7 +4,6 @@ import { Position, TextDocument } from 'vscode-languageserver-textdocument'; import { FoldingRangeKind } from '../../capabilities/folding'; import { IdentifierElement, PropertyDeclarationElement } from './memory'; import '../../extensions/parserExtensions'; -import { IdentifiableScopeElement } from './special'; import { contextToRange } from '../../utils/helpers'; export interface ContextOptionalSyntaxElement { @@ -27,8 +26,9 @@ export interface HasDiagnosticCapability { evaluateDiagnostics(): Diagnostic[]; } -export interface NamedSyntaxElement extends SyntaxElement { +export interface NamedSyntaxElement extends SyntaxElement, HasDiagnosticCapability { get name(): string; + get isPublic(): boolean; } export interface IdentifiableSyntaxElement extends NamedSyntaxElement { diff --git a/server/src/project/elements/memory.ts b/server/src/project/elements/memory.ts index c5460da..a7b6196 100644 --- a/server/src/project/elements/memory.ts +++ b/server/src/project/elements/memory.ts @@ -9,7 +9,6 @@ import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; import '../../extensions/parserExtensions'; import { DuplicateDeclarationDiagnostic, ElementOutOfPlaceDiagnostic } from '../../capabilities/diagnostics'; import { ScopeElement } from './special'; -import { Scope } from '../scope'; import { ParserRuleContext } from 'antlr4ng'; @@ -54,15 +53,15 @@ export abstract class ProcedureDeclarationElement extends ScopeElement { // Check if we already have a property with this name. const propertyDeclaration = new PropertyDeclarationElement(context, document.textDocument); const identifierText = propertyDeclaration.identifier.text; - const predeclaredElements = document.currentScopeElement?.declaredNames.get(identifierText) ?? []; + // const predeclaredElements = document.currentScopeElement?.declaredNames.get(identifierText) ?? []; // Add to an existing property rather than creating. - for (const element of predeclaredElements) { - if (element.isPropertyElement() && element.identifier.text === identifierText) { - element.addPropertyDeclaration(context, document.textDocument); - return element; - } - } + // for (const element of predeclaredElements) { + // if (element.isPropertyElement() && element.identifier.text === identifierText) { + // element.addPropertyDeclaration(context, document.textDocument); + // return element; + // } + // } // Return a new property. return propertyDeclaration; @@ -230,13 +229,16 @@ export class EnumDeclarationElement extends BaseEnumDeclarationElement implement ); } - constructor(context: EnumDeclarationContext, document: TextDocument, isDeclaredAfterMethod: boolean, scope?: Scope) { + constructor(context: EnumDeclarationContext, document: TextDocument, isDeclaredAfterMethod: boolean) { super(context, document); // this.scope = scope; this.tokenType = SemanticTokenTypes.enum; this.isDeclaredAfterMethod = isDeclaredAfterMethod; this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); - this.enumMembers = context.enumMemberList().enumElement().map(e => new EnumMemberDeclarationElement(e.enumMember()!, document)) + this.enumMembers = context.enumMemberList().enumElement().map(e => { + const member = e.enumMember()!; + return new EnumMemberDeclarationElement(member, document); + } ) } evaluateDiagnostics() { @@ -263,7 +265,7 @@ class EnumMemberDeclarationElement extends BaseEnumDeclarationElement { } evaluateDiagnostics(): Diagnostic[] { - return []; + return this.diagnostics } } diff --git a/server/src/project/elements/module.ts b/server/src/project/elements/module.ts index 5ada674..a203857 100644 --- a/server/src/project/elements/module.ts +++ b/server/src/project/elements/module.ts @@ -1,13 +1,17 @@ -import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, Range, SymbolInformation, SymbolKind } from 'vscode-languageserver'; +import { TextDocument } from 'vscode-languageserver-textdocument'; + +import { ParserRuleContext } from 'antlr4ng'; import { ClassModuleContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext } from '../../antlr/out/vbaParser'; + import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSymbolInformation } from './base'; +import { ScopeElement } from './special'; + import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; import { DuplicateAttributeDiagnostic, IgnoredAttributeDiagnostic, MissingAttributeDiagnostic, MissingOptionExplicitDiagnostic } from '../../capabilities/diagnostics'; + import '../../extensions/stringExtensions'; -import { ScopeElement } from './special'; import { contextToRange } from '../../utils/helpers'; -import { ParserRuleContext } from 'antlr4ng'; interface DocumentSettings { doWarnOptionExplicitMissing: boolean; @@ -19,6 +23,7 @@ abstract class BaseModuleElement extends ScopeElement implements HasSymbolInform diagnostics: Diagnostic[] = []; context: ProceduralModuleContext | ClassModuleContext; settings: DocumentSettings; + isPublic = true; constructor(context: ProceduralModuleContext | ClassModuleContext, document: TextDocument, symbolKind: SymbolKind, documentSettings: DocumentSettings) { super(context, document); @@ -155,7 +160,7 @@ export class ClassElement extends BaseModuleElement { // Diagnose duplicate attributes. this._duplicateAttributes(this.attrubutes).forEach(attr => this.diagnostics.push(new DuplicateAttributeDiagnostic( - contextToRange(this.document, attr)!, + attr.toRange(this.document), getAttributeName(attr) )) ); diff --git a/server/src/project/elements/operator.ts b/server/src/project/elements/operator.ts deleted file mode 100644 index 31e542c..0000000 --- a/server/src/project/elements/operator.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { BaseContextSyntaxElement, HasDiagnosticCapability } from './base'; -import { TextDocument } from 'vscode-languageserver-textdocument'; -import { Diagnostic } from 'vscode-languageserver'; -import { MultipleOperatorsDiagnostic } from '../../capabilities/diagnostics'; - - -// export class OperatorElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { -// diagnostics: Diagnostic[] = []; - -// constructor(context: OperatorsStmtContext, document: TextDocument) { -// super(context, document); -// } - -// evaluateDiagnostics(): void { -// if (this.context.childCount > 1) { -// this.diagnostics.push(new MultipleOperatorsDiagnostic(this.range)); -// } -// } -// } diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 148e95b..05d3412 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -1,14 +1,14 @@ import { ErrorNode, ParserRuleContext } from 'antlr4ng'; import { vbaListener } from '../../antlr/out/vbaListener'; -import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredAttrContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; +import { vbapreListener } from '../../antlr/out/vbapreListener'; +import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; +import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext} from '../../antlr/out/vbapreParser'; import { BaseProjectDocument, DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; import { DuplicateOperatorElement, WhileLoopElement } from '../elements/flow'; -import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; import { ConstDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; -import { vbapreListener } from '../../antlr/out/vbapreListener'; -import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext} from '../../antlr/out/vbapreParser'; +import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; import { CompilerIfBlockElement, InactiveLineElement } from '../elements/special'; @@ -62,36 +62,38 @@ export class VbaListener extends vbaListener { enterEnumDeclaration = (ctx: EnumDeclarationContext) => { const element = new EnumDeclarationElement(ctx, this.document.textDocument, this._isAfterMethodDeclaration); this.document.registerFoldableElement(element) - // .registerScopedElement(element) .registerSemanticToken(element) + .registerNamespaceElement(element) .registerSymbolInformation(element) .registerDiagnosticElement(element); - element.declaredNames.forEach(names => - names.forEach(name => this.document - .registerSemanticToken(name) - .registerSymbolInformation(name)) + element.enumMembers.forEach(member => this.document + .registerSemanticToken(member) + .registerSymbolInformation(member) + .registerDiagnosticElement(member) + .registerNamedElementDeclaration(member) ); }; - // exitEnumDeclaration = (_: EnumDeclarationContext) => { - // this.document.deregisterScopedElement(); - // }; + exitEnumDeclaration = (_: EnumDeclarationContext) => + this.document.deregisterScopedElement(); enterClassModule = (ctx: ClassModuleContext) => { const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); this.document.registerSymbolInformation(element) .registerDiagnosticElement(element) - // .registerScopedElement(element); + .registerNamespaceElement(element) + .registerFoldableElement(element); }; - // exitClassModule = (ctx: ClassModuleContext) => { - // this.document.deregisterScopedElement(); - // }; + exitClassModule = (ctx: ClassModuleContext) => { + this.document.deregisterScopedElement(); + }; enterConstItem = (ctx: ConstItemContext) => { const element = new ConstDeclarationElement(ctx, this.document.textDocument); this.document.registerSemanticToken(element) - .registerSymbolInformation(element); + .registerSymbolInformation(element) + .registerNamedElementDeclaration(element); }; enterIgnoredClassAttr = (ctx: IgnoredClassAttrContext) => this.registerIgnoredAttribute(ctx); @@ -103,25 +105,13 @@ export class VbaListener extends vbaListener { enterProceduralModule = (ctx: ProceduralModuleContext) => { const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element) - // .registerScopedElement(element); + .registerFoldableElement(element) + .registerNamespaceElement(element) }; - // exitProceduralModule = (ctx: ProceduralModuleContext) => { - // this.document.deregisterScopedElement(); - // }; - - // enterProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { - // const element = DeclarationElement.create(ctx, this.document); - // this.document.registerSymbolInformation(element) - // .registerFoldableElement(element) - // .registerScopedElement(element); - - // if (element.isPropertyElement() && element.countDeclarations === 1) { - // this.document.registerDiagnosticElement(element) - // .registerNamedElement(element); - // } - // }; + exitProceduralModule = (ctx: ProceduralModuleContext) => { + this.document.deregisterScopedElement(); + }; exitProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { this._isAfterMethodDeclaration = true; diff --git a/server/src/project/scope.ts b/server/src/project/scope.ts index c7b386e..d79c33f 100644 --- a/server/src/project/scope.ts +++ b/server/src/project/scope.ts @@ -1,50 +1,54 @@ -import { DeclarationElement } from './elements/base'; +import { DuplicateDeclarationDiagnostic, ShadowDeclarationDiagnostic } from '../capabilities/diagnostics'; +import { NamedSyntaxElement } from './elements/base'; -interface IScope { - children: IScope[]; - declaredNames: Map; - pushDeclaredName(element: DeclarationElement): void - findDeclaration(identifier: string): DeclarationElement | undefined; -} - -abstract class BaseScope implements IScope { - children: IScope[] = []; - parentScope?: IScope; - declaredNames: Map = new Map(); - - abstract findDeclaration(identifier: string): DeclarationElement | undefined; +export class NamespaceManager { + private _names: Map = new Map(); + private _scopeStack: {namespace: NamedSyntaxElement, names: Map }[] = []; - pushDeclaredName(element: DeclarationElement): void { - const name = element.name; - const names: DeclarationElement[] = this.declaredNames.get(name) ?? []; - names.push(element); - this.declaredNames.set(name, names); + /** + * Begins tracking a namespace item against a namespace. + * @returns A diagnostic if the item has already been declared in this space. + */ + addNameItem = (item: NamedSyntaxElement): void => { + // Check current scope for duplicate declaration. + if (this._scopeStack.at(-1)?.names.has(item.name)) { + item.diagnostics.push(new DuplicateDeclarationDiagnostic(item.range)); + return; + } + this._scopeStack.at(-1)?.names.set(item.name, item); + + // Check higher scopes for shadowed declarations + if (this._names.has(item.name)) { + item.diagnostics.push(new ShadowDeclarationDiagnostic(item.range)); + return; + } + this._names.set(item.name, item); } -} -export class Scope extends BaseScope { - parentScope: Scope | GlobalScope; - - constructor(parent: Scope | GlobalScope) { - super(); - this.parentScope = parent; + /** + * Adds a namespace to the stack and tracks names. + * @param scope The namespace to add. + */ + addNamespace = (scope: NamedSyntaxElement) => { + this.addNameItem(scope); // a namespace is also a name + this._scopeStack.push({namespace: scope, names: new Map()}); } /** - * Recursively searches for the related declaration. - * @param identifier the name of the identifiable element. - * @returns a declaration element if found. + * Removes the namespace and all names associated with it. */ - findDeclaration = (identifier: string): DeclarationElement | undefined => - this.declaredNames.get(identifier)?.at(0) ?? this.parentScope?.findDeclaration(identifier); -} - -export class GlobalScope extends BaseScope { - constructor() { - super(); + popNamespace = (): void => { + const ns = this._scopeStack.pop(); + + // Remove the items in the current scope if they are not public. + ns?.names.forEach((_, x) => { + if (!(this._names.get(x)?.isPublic ?? true)) { this._names.delete(x); } + }); + + // Remove the current scope. + if (ns && !ns.namespace.isPublic && this._names.has(ns.namespace.name)) { + this._names.delete(ns.namespace.name); + } } - - findDeclaration = (identifier: string) => - this.declaredNames.get(identifier)?.at(0); } diff --git a/server/src/project/workspace.ts b/server/src/project/workspace.ts index e2f3e0b..126e1ed 100644 --- a/server/src/project/workspace.ts +++ b/server/src/project/workspace.ts @@ -4,7 +4,7 @@ import { LanguageServerConfiguration } from '../server'; import { hasConfigurationCapability } from '../capabilities/workspaceFolder'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { sleep } from '../utils/helpers'; -import { GlobalScope } from './scope'; +import { NamespaceManager } from './scope'; /** @@ -13,10 +13,9 @@ import { GlobalScope } from './scope'; */ export class Workspace { private _events: WorkspaceEvents; - private _globalScope: GlobalScope; + private _nsManager: NamespaceManager = new NamespaceManager(); private _documents: BaseProjectDocument[] = []; private _activeDocument?: BaseProjectDocument; - private _publicScopeDeclarations: Map = new Map(); private _parseCancellationTokenSource?: CancellationTokenSource; private readonly _hasConfigurationCapability: boolean; @@ -30,12 +29,11 @@ export class Workspace { return this._activeDocument; } - get globalScope() { - return this._globalScope; + get namespaceManager() { + return this._nsManager; } constructor(params: {connection: _Connection, capabilities: LanguageServerConfiguration}) { - this._globalScope = new GlobalScope(); this.connection = params.connection; this._hasConfigurationCapability = hasConfigurationCapability(params.capabilities); this._events = new WorkspaceEvents({ From 3f7301efc625e4f9df806549e34129a4c56fa38e Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 1 Dec 2024 12:41:52 +0800 Subject: [PATCH 46/58] Add equality check for elements --- server/src/project/elements/base.ts | 6 ++++++ server/src/project/scope.ts | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index 0c12473..ac1a3f5 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -29,6 +29,7 @@ export interface HasDiagnosticCapability { export interface NamedSyntaxElement extends SyntaxElement, HasDiagnosticCapability { get name(): string; get isPublic(): boolean; + equals(element: any): boolean; } export interface IdentifiableSyntaxElement extends NamedSyntaxElement { @@ -96,6 +97,11 @@ export abstract class BaseSyntaxElement implements ContextOptionalSyntaxElement && isPositionBefore(this.range.end, range.end); }; + equals = (element: BaseSyntaxElement): boolean => + this.document.uri === element.document.uri + && this.range === element.range + && this.text === element.text; + protected _contextToRange(): Range | undefined { return contextToRange(this.document, this.context); } diff --git a/server/src/project/scope.ts b/server/src/project/scope.ts index d79c33f..5809c2f 100644 --- a/server/src/project/scope.ts +++ b/server/src/project/scope.ts @@ -12,14 +12,16 @@ export class NamespaceManager { */ addNameItem = (item: NamedSyntaxElement): void => { // Check current scope for duplicate declaration. - if (this._scopeStack.at(-1)?.names.has(item.name)) { + let checkItem = this._scopeStack.at(-1)?.names.get(item.name); + if (!!checkItem && !checkItem.equals(item)) { item.diagnostics.push(new DuplicateDeclarationDiagnostic(item.range)); return; } this._scopeStack.at(-1)?.names.set(item.name, item); // Check higher scopes for shadowed declarations - if (this._names.has(item.name)) { + checkItem = this._names.get(item.name) + if (!!checkItem && !checkItem.equals(item)) { item.diagnostics.push(new ShadowDeclarationDiagnostic(item.range)); return; } From a08131e6ef163413c6f38be960a2ca6075bf8051 Mon Sep 17 00:00:00 2001 From: sslinky Date: Sun, 1 Dec 2024 12:42:50 +0800 Subject: [PATCH 47/58] Implement new property elements --- server/src/project/document.ts | 22 +++++++ server/src/project/elements/memory.ts | 81 ++++++++++++++++++++++++ server/src/project/elements/special.ts | 2 +- server/src/project/parser/vbaListener.ts | 35 +++++++++- 4 files changed, 137 insertions(+), 3 deletions(-) diff --git a/server/src/project/document.ts b/server/src/project/document.ts index ad5a7a3..7eefeab 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -7,6 +7,7 @@ import { SyntaxParser } from './parser/vbaParser'; import { FoldingRange } from '../capabilities/folding'; import { SemanticTokensManager } from '../capabilities/semanticTokens'; import { ParseCancellationException } from 'antlr4ng'; +import { NewPropertyDeclarationElement, NewPropertyGetDeclarationElement, NewPropertyLetDeclarationElement, NewPropertySetDeclarationElement } from './elements/memory'; export interface DocumentSettings { maxDocumentLines: number; @@ -18,6 +19,17 @@ export interface DocumentSettings { } } + +// TODO --------------------------------------------- +// * Create a special register property that registers the name +// normally and tracks to avoid readding duplicates (unless we have two gets). +// Consider making all variables get/set/let for simplicity in assignment. +// Obviously Const will only have a get. +// * Fix the rest of the scope and variable bits. +// * Write tests for it all. +// -------------------------------------------------- + + export abstract class BaseProjectDocument { readonly name: string; readonly workspace: Workspace; @@ -33,6 +45,7 @@ export abstract class BaseProjectDocument { protected _symbolInformations: SymbolInformation[] = []; protected _semanticTokens: SemanticTokensManager = new SemanticTokensManager(); protected _redactedElements: BaseContextSyntaxElement[] = []; + protected _properties: Map = new Map(); protected _isBusy = true; abstract symbolKind: SymbolKind @@ -159,6 +172,15 @@ export abstract class BaseProjectDocument { this._isBusy = false; }; + registerPropertyElementDeclaration(element: NewPropertyGetDeclarationElement | NewPropertySetDeclarationElement | NewPropertyLetDeclarationElement) { + if (this._properties.has(element.name)) { + this._properties.get(element.name)!.addPropertyDeclaration(element); + return this; + } + this._properties.set(element.name, new NewPropertyDeclarationElement(element)); + return this; + } + registerNamedElementDeclaration(element: NamedSyntaxElement) { this.workspace.namespaceManager.addNameItem(element); return this; diff --git a/server/src/project/elements/memory.ts b/server/src/project/elements/memory.ts index a7b6196..0d00cb4 100644 --- a/server/src/project/elements/memory.ts +++ b/server/src/project/elements/memory.ts @@ -168,6 +168,87 @@ export class PropertyDeclarationElement extends ProcedureDeclarationElement impl } } +export class NewPropertyDeclarationElement implements HasDiagnosticCapability { + identifier: IdentifierElement; + diagnostics: Diagnostic[] = []; + + getters: PropertyGetDeclarationElement[] = []; + setters: PropertySetDeclarationElement[] = []; + letters: PropertyLetDeclarationElement[] = []; + + constructor(property: PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement) { + this.identifier = property.identifier; + this.addPropertyDeclaration(property); + } + + addPropertyDeclaration(property: PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement) { + if (property instanceof PropertyGetDeclarationElement) { + this.getters.push(property); + } else if (property instanceof PropertySetDeclarationElement) { + this.setters.push(property); + } else { + this.letters.push(property); + } + } + + evaluateDiagnostics(): Diagnostic[] { + [this.getters, this.setters, this.letters].forEach(x => this._evaluateDuplicatesFor(x)); + return this.diagnostics; + } + + private _evaluateDuplicatesFor(props: (PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement)[]) { + if (props.length <= 1) return; + const duplicateProperties = props.slice(1); + duplicateProperties.forEach(x => this.diagnostics.push(new DuplicateDeclarationDiagnostic(x.range))); + } +} + + +abstract class BaseNewPropertyDeclarationElement extends ScopeElement { + abstract identifier: IdentifierElement; + diagnostics: Diagnostic[] = []; + + get name(): string { + return this.identifier.text; + } + + constructor(context: PropertyGetDeclarationContext | PropertySetDeclarationContext, document: TextDocument) { + super(context, document); + } + + evaluateDiagnostics(): Diagnostic[] { + return this.diagnostics; + } +} + + +export class NewPropertyGetDeclarationElement extends BaseNewPropertyDeclarationElement { + identifier: IdentifierElement; + + constructor(context: PropertyGetDeclarationContext, document: TextDocument) { + super(context, document); + this.identifier = new IdentifierElement(context.functionName()!.ambiguousIdentifier()!, document); + } +} + + +export class NewPropertySetDeclarationElement extends BaseNewPropertyDeclarationElement { + identifier: IdentifierElement; + + constructor(context: PropertySetDeclarationContext, document: TextDocument) { + super(context, document); + this.identifier = new IdentifierElement(context.subroutineName()!.ambiguousIdentifier()!, document); + } +} + + +export class NewPropertyLetDeclarationElement extends NewPropertySetDeclarationElement { + constructor(context: PropertySetDeclarationContext, document: TextDocument) { + super(context, document); + } +} + + class PropertyGetDeclarationElement extends ProcedureDeclarationElement { identifier: IdentifierElement; diagnostics: Diagnostic[] = []; diff --git a/server/src/project/elements/special.ts b/server/src/project/elements/special.ts index 3ebfe8c..a58ba38 100644 --- a/server/src/project/elements/special.ts +++ b/server/src/project/elements/special.ts @@ -1,7 +1,7 @@ import * as ts from "typescript"; import { ParserRuleContext } from 'antlr4ng'; import { FoldingRangeKind } from '../../capabilities/folding'; -import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, HasSemanticToken, IdentifiableSyntaxElement } from './base'; +import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, HasSemanticToken, IdentifiableSyntaxElement, NamedSyntaxElement } from './base'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { IdentifierElement, PropertyDeclarationElement } from './memory'; import { Diagnostic, integer, Range, SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver'; diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 05d3412..9960c50 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -1,13 +1,13 @@ import { ErrorNode, ParserRuleContext } from 'antlr4ng'; import { vbaListener } from '../../antlr/out/vbaListener'; import { vbapreListener } from '../../antlr/out/vbapreListener'; -import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; +import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, PropertyGetDeclarationContext, PropertySetDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext} from '../../antlr/out/vbapreParser'; import { BaseProjectDocument, DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; import { DuplicateOperatorElement, WhileLoopElement } from '../elements/flow'; -import { ConstDeclarationElement, EnumDeclarationElement, TypeDeclarationElement } from '../elements/memory'; +import { ConstDeclarationElement, EnumDeclarationElement, NewPropertyGetDeclarationElement, NewPropertyLetDeclarationElement, NewPropertySetDeclarationElement, TypeDeclarationElement } from '../elements/memory'; import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; import { CompilerIfBlockElement, InactiveLineElement } from '../elements/special'; @@ -118,6 +118,37 @@ export class VbaListener extends vbaListener { // this.document.deregisterScopedElement(); }; + enterPropertyGetDeclaration = (ctx: PropertyGetDeclarationContext) => { + const element = new NewPropertyGetDeclarationElement(ctx, this.document.textDocument); + this.document.registerNamespaceElement(element) + .registerPropertyElementDeclaration(element) + .registerDiagnosticElement(element); + }; + + enterPropertySetDeclaration = (ctx: PropertySetDeclarationContext) => { + const element = new NewPropertySetDeclarationElement(ctx, this.document.textDocument); + this.document.registerNamespaceElement(element) + .registerPropertyElementDeclaration(element) + .registerDiagnosticElement(element); + }; + + enterPropertyLetDeclaration = (ctx: PropertySetDeclarationContext) => { + const element = new NewPropertyLetDeclarationElement(ctx, this.document.textDocument); + this.document.registerNamespaceElement(element) + .registerPropertyElementDeclaration(element) + .registerDiagnosticElement(element); + }; + + exitPropertyGetDeclaration = (_: PropertyGetDeclarationContext) => + this.document.deregisterScopedElement(); + + exitPropertySetDeclaration = (_: PropertySetDeclarationContext) => + this.document.deregisterScopedElement(); + + exitPropertyLetDeclaration = (_: PropertySetDeclarationContext) => + this.document.deregisterScopedElement(); + + enterUdtDeclaration = (ctx: UdtDeclarationContext) => { const element = new TypeDeclarationElement(ctx, this.document.textDocument); this.document.registerFoldableElement(element) From b8aa49d6e20db30cc2faf407ce1ab57f6e736465 Mon Sep 17 00:00:00 2001 From: sslinky Date: Mon, 16 Dec 2024 23:38:53 +0800 Subject: [PATCH 48/58] Fix Global accessor and add type hints --- client/src/syntaxes/vba.tmLanguage.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/client/src/syntaxes/vba.tmLanguage.yaml b/client/src/syntaxes/vba.tmLanguage.yaml index 5c0ae06..a2e8a88 100644 --- a/client/src/syntaxes/vba.tmLanguage.yaml +++ b/client/src/syntaxes/vba.tmLanguage.yaml @@ -674,7 +674,7 @@ repository: repository: variableDeclaration: name: storage.var-declaration.vba - match: (?i)^\s*(Dim|Public|Private)\s+([a-z][a-z0-9_]*)(\(.*\))?(\s+As(?:\s+New)?\s+[A-Z][A-Z0-9_]*)? + match: (?i)^\s*(Dim|Public|Private|Global)\s+([a-z][a-z0-9_]*)([&%#!@$^])?(\(.*\))?(\s+As(?:\s+New)?\s+[A-Z][A-Z0-9_]*)? captures: 1: # Dim|Private @@ -683,28 +683,34 @@ repository: # varName name: variable.other.readwrite.vba 3: + # Type hint? + name: support.type.primitive.vba + 4: # Array bounds? patterns: - include: "#language" - 4: + 5: # As Type patterns: - include: "#types" constDeclaration: name: storage.const-declaration.vba - match: "^\\s*((?i)(?:(?:Public|Private)\\s+)?Const)\\s+([A-Z][A-Z0-9_]*)((?i)\\s+As\\s+[A-Z][A-Z0-9_]*)?(.*)" + match: ^\s*((?i)(?:(?:Public|Private)\s+)?Const)\s+([A-Z][A-Z0-9_]*)([&%#!@$^])?((?i)\s+As\s+[A-Z][A-Z0-9_]*)?(.*) captures: 1: # Public|Private Const - name: constant.language.vba + name: storage.type.vba 2: # CONSTNAME - name: variable.other.constant.property + name: variable.other.constant.vba 3: + # Type hint? + name: support.type.primitive.vba + 4: # As Type patterns: - include: "#types" - 4: + 5: # = "some value" patterns: - include: "#language" From 867b27336a1213efb44acd32c8d3e8a529ddad1c Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 17 Dec 2024 16:18:10 +0800 Subject: [PATCH 49/58] Typos and bug fixes --- server/src/antlr/vba.g4 | 12 ++++++++++-- server/src/antlr/vbapre.g4 | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/server/src/antlr/vba.g4 b/server/src/antlr/vba.g4 index c29d248..4ec4a2e 100644 --- a/server/src/antlr/vba.g4 +++ b/server/src/antlr/vba.g4 @@ -234,7 +234,7 @@ commonModuleDeclarationElement // 5.2.3.1 Module Variable Declaration Lists // Added variableHelpAttribute, not in MS-VBAL moduleVariableDeclaration - : publicVariableDecalation + : publicVariableDeclaration | privateVariableDeclaration | variableHelpAttribute ; @@ -242,8 +242,15 @@ moduleVariableDeclaration variableHelpAttribute : ATTRIBUTE WS ambiguousIdentifier '.' VB_VARHELPID WS? '=' WS? '-'? INTEGERLITERAL ; + +// ---------------------------- +// TODO!! Global, as well as staticVariableDeclaration and localVariableDeclaration should parse +// with the more flexible moduleVariableDeclarationList but should raise diagnostic if not done right. +// Similarly, WithEvents shoudn't require a type but should raise diag if one isn't provided. +// ---------------------------- + globalVariableDeclaration: GLOBAL WS variableDeclarationList; -publicVariableDecalation: PUBLIC (WS SHARED)? WS moduleVariableDeclarationList; +publicVariableDeclaration: PUBLIC (WS SHARED)? WS moduleVariableDeclarationList; privateVariableDeclaration: ((PRIVATE | DIM) wsc) (SHARED wsc)? moduleVariableDeclarationList; moduleVariableDeclarationList: (witheventsVariableDcl | variableDcl) (wsc? ',' wsc? (witheventsVariableDcl | variableDcl))*; variableDeclarationList: variableDcl (wsc? ',' wsc? variableDcl)*; @@ -766,6 +773,7 @@ dataManipulationStatement ; // 5.4.3.1 Local Variable Declarations +// TODO: Shared is not listed as a keyword in VBA and the IDE removes it. localVariableDeclaration: DIM wsc? SHARED? wsc? variableDeclarationList; staticVariableDeclaration: STATIC wsc variableDeclarationList; diff --git a/server/src/antlr/vbapre.g4 b/server/src/antlr/vbapre.g4 index 5f96730..d8a4a53 100644 --- a/server/src/antlr/vbapre.g4 +++ b/server/src/antlr/vbapre.g4 @@ -50,7 +50,7 @@ compilerElseStatement ; compilerEndIfStatement - : ENDIF endOfStatement + : ENDIF endOfStatement? ; // ************************* From 41d4cf55ab2461acfab19331a35b276d7d0821e2 Mon Sep 17 00:00:00 2001 From: sslinky Date: Tue, 17 Dec 2024 16:18:35 +0800 Subject: [PATCH 50/58] Set up path aliases --- server/tsconfig.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/tsconfig.json b/server/tsconfig.json index ca2be50..b2cf88c 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -7,7 +7,13 @@ "sourceMap": true, "strict": true, "outDir": "out", - "rootDir": "src" + "rootDir": "src", + "baseUrl": ".", + "paths": { + "@antlr/*": ["src/antlr/out/*"], + "@project/*": ["src/project/*"], + "@capabilities/*": ["src/capabilities/*"], + } }, "include": ["src"], "exclude": ["node_modules", ".vscode-test"] From 8a36bb06aa2830473634a07ec91b4ac87f38b2c1 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:03:00 +0800 Subject: [PATCH 51/58] Not ready for testing --- client/src/test/completion.test.ts | 74 +++++++++++++++--------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/client/src/test/completion.test.ts b/client/src/test/completion.test.ts index 0b2f610..4d7470b 100644 --- a/client/src/test/completion.test.ts +++ b/client/src/test/completion.test.ts @@ -1,43 +1,43 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ +// /* -------------------------------------------------------------------------------------------- +// * Copyright (c) Microsoft Corporation. All rights reserved. +// * Licensed under the MIT License. See License.txt in the project root for license information. +// * ------------------------------------------------------------------------------------------ */ -import * as vscode from 'vscode'; -import * as assert from 'assert'; -import { getDocUri, activate } from './helper'; +// import * as vscode from 'vscode'; +// import * as assert from 'assert'; +// import { getDocUri, activate } from './helper'; -suite('Should do completion', () => { - // const docUri = getDocUri('completion.txt'); +// suite('Should do completion', () => { +// const docUri = getDocUri('completion.txt'); - // test('Completes JS/TS in txt file', async () => { - // await testCompletion(docUri, new vscode.Position(0, 0), { - // items: [ - // { label: 'JavaScript', kind: vscode.CompletionItemKind.Text }, - // { label: 'TypeScript', kind: vscode.CompletionItemKind.Text } - // ] - // }); - // }); -}); +// test('Completes JS/TS in txt file', async () => { +// await testCompletion(docUri, new vscode.Position(0, 0), { +// items: [ +// { label: 'JavaScript', kind: vscode.CompletionItemKind.Text }, +// { label: 'TypeScript', kind: vscode.CompletionItemKind.Text } +// ] +// }); +// }); +// }); -async function testCompletion( - docUri: vscode.Uri, - position: vscode.Position, - expectedCompletionList: vscode.CompletionList -) { - await activate(docUri); +// async function testCompletion( +// docUri: vscode.Uri, +// position: vscode.Position, +// expectedCompletionList: vscode.CompletionList +// ) { +// await activate(docUri); - // Executing the command `vscode.executeCompletionItemProvider` to simulate triggering completion - const actualCompletionList = (await vscode.commands.executeCommand( - 'vscode.executeCompletionItemProvider', - docUri, - position - )) as vscode.CompletionList; +// // Executing the command `vscode.executeCompletionItemProvider` to simulate triggering completion +// const actualCompletionList = (await vscode.commands.executeCommand( +// 'vscode.executeCompletionItemProvider', +// docUri, +// position +// )) as vscode.CompletionList; - assert.ok(actualCompletionList.items.length >= 2); - expectedCompletionList.items.forEach((expectedItem, i) => { - const actualItem = actualCompletionList.items[i]; - assert.equal(actualItem.label, expectedItem.label); - assert.equal(actualItem.kind, expectedItem.kind); - }); -} +// assert.ok(actualCompletionList.items.length >= 2); +// expectedCompletionList.items.forEach((expectedItem, i) => { +// const actualItem = actualCompletionList.items[i]; +// assert.equal(actualItem.label, expectedItem.label); +// assert.equal(actualItem.kind, expectedItem.kind); +// }); +// } From 92c3ba56ff722f6f2d65c71fbce7945e6a705256 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:03:42 +0800 Subject: [PATCH 52/58] Roll back path aliases --- server/tsconfig.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/tsconfig.json b/server/tsconfig.json index b2cf88c..184e983 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -8,12 +8,12 @@ "strict": true, "outDir": "out", "rootDir": "src", - "baseUrl": ".", - "paths": { - "@antlr/*": ["src/antlr/out/*"], - "@project/*": ["src/project/*"], - "@capabilities/*": ["src/capabilities/*"], - } + // "baseUrl": ".", + // "paths": { + // "@antlr/*": ["src/antlr/out/*"], + // "@project/*": ["src/project/*"], + // "@capabilities/*": ["src/capabilities/*"], + // } }, "include": ["src"], "exclude": ["node_modules", ".vscode-test"] From 93a271ee26d5375cbf51f19780c811d7ea145ce6 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:06:07 +0800 Subject: [PATCH 53/58] reimplement precompiler --- server/src/antlr/vbapre.g4 | 8 +- server/src/project/elements/precompiled.ts | 132 +++++++++++++++++++++ 2 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 server/src/project/elements/precompiled.ts diff --git a/server/src/antlr/vbapre.g4 b/server/src/antlr/vbapre.g4 index d8a4a53..5e77e1a 100644 --- a/server/src/antlr/vbapre.g4 +++ b/server/src/antlr/vbapre.g4 @@ -25,11 +25,11 @@ compilerIfBlock ; compilerConditionalBlock - : compilerConditionalStatement (anyOtherLine | endOfLine)* + : compilerConditionalStatement compilerBlockContent? ; compilerDefaultBlock - : compilerElseStatement (anyOtherLine | endOfLine)* + : compilerElseStatement compilerBlockContent? ; compilerConditionalStatement @@ -53,6 +53,10 @@ compilerEndIfStatement : ENDIF endOfStatement? ; +compilerBlockContent + : (anyOtherLine | endOfLine)+ + ; + // ************************* booleanExpression diff --git a/server/src/project/elements/precompiled.ts b/server/src/project/elements/precompiled.ts new file mode 100644 index 0000000..62c53b5 --- /dev/null +++ b/server/src/project/elements/precompiled.ts @@ -0,0 +1,132 @@ +// Core +import * as ts from "typescript"; +import { Position, Range, SemanticTokenTypes } from 'vscode-languageserver'; +import { TextDocument } from 'vscode-languageserver-textdocument'; + +// Antlr +import { ParserRuleContext } from 'antlr4ng'; +import { CompilerConditionalBlockContext, CompilerDefaultBlockContext, CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; + +// Project +import { SemanticTokenCapability } from '../../capabilities/capabilities'; +import { BaseContextSyntaxElement, HasSemanticTokenCapability } from '../elements/base'; + + +export class CompilerLogicalBlock extends BaseContextSyntaxElement { + conditionalBlocks: CompilerConditionBlock[] = []; + inactiveBlocks: CompilerConditionBlock[] = []; + + constructor(ctx: CompilerIfBlockContext, doc: TextDocument, env: {environment: { os: string, version: string }}) { + super(ctx, doc); + + // Create the block elements + const blocks = [ctx.compilerConditionalBlock(), ctx.compilerDefaultBlock()].flat(); + blocks.map(x => { if(x) this.conditionalBlocks.push(new CompilerConditionBlock(x, doc, env)) }); + + // Create the comment elements. + let resolved = false; + for (const block of this.conditionalBlocks) { + if (!resolved && block.conditionResult) { + resolved = true; + continue; + } + this.inactiveBlocks.push(block); + } + } +} + + +class CompilerConditionBlock extends BaseContextSyntaxElement { + readonly documentSettings: {environment: { os: string, version: string }}; + + constructor(ctx: CompilerConditionalBlockContext | CompilerDefaultBlockContext, doc: TextDocument, env: {environment: { os: string, version: string }}) { + super(ctx, doc); + this.documentSettings = env; + } + + get blockLines(): string[] { + return this.context.rule.compilerBlockContent()?.getText().split('\n') ?? []; + } + + get linesToComments(): GenericCommentElement[] { + const rowX = this.context.range.start.line; + const rowY = this.context.range.end.line; + + // Iterate the rows -- test what happens when you get to the end of the document. + // May require a try catch where the default offset is the character count of the document. + const result: GenericCommentElement[] = []; + for (let i = rowX; i < rowY; i++) { + const posX = this.context.document.offsetAt({ line: i, character: 0 }); + const posY = this.context.document.offsetAt({ line: i + 1, character: 0 }) - 1; + + const lineRange = Range.create( + this.context.document.positionAt(posX), + this.context.document.positionAt(posY) + ); + result.push(new GenericCommentElement( + this.context.rule, + this.context.document, + lineRange) + ); + } + + return result; + } + + get conditionResult(): boolean { + // Default "Else" block is always true. + const ctx = this.context.rule; + if(((o: any): o is CompilerDefaultBlockContext => 'compilerElseStatement' in o)(ctx)) return true; + + const vbaExpression = ctx.compilerConditionalStatement().vbaExpression(); + const tsExpression = this.transpileVbaToTypescript(vbaExpression); + + // Evaluate the expression and return the result. + const result = eval(ts.transpile(tsExpression)); + if (!(typeof result === "boolean")) { + // TODO: Return false here instead of throwing + // and return an error diagnostic for the expression. + throw new Error("Expected boolean result."); + } + return result; + } + + /** Transpiles a VBA expression into Typescript. */ + private transpileVbaToTypescript(exp: string): string { + // Convert the environment constant to boolean. + const envToBooleanText = (opt: string) => { + const isOs = this.documentSettings.environment.os.toLowerCase() == opt; + const isVer = this.documentSettings.environment.version.toLowerCase() == opt; + return isOs || isVer ? 'true' : 'false'; + } + + // Set up text replacements map. + const constants = ['vba6', 'vba7', 'mac', 'win16', 'win32', 'win64'] + const replacements = new Map(constants.map(x => [x, envToBooleanText(x)])); + replacements.set('or', '||'); + replacements.set('and', '&&'); + replacements.set('not ', '!'); + + // Perform text replacements. + let result = exp; + replacements.forEach((v, k) => { + const regexp = RegExp(`${k}`, 'i') + if (regexp.test(result)) { + result = result.replace(regexp, v); + } + }); + + return result; + } +} + + +export class GenericCommentElement extends BaseContextSyntaxElement implements HasSemanticTokenCapability { + semanticTokenCapability: SemanticTokenCapability; + + constructor(ctx: ParserRuleContext, doc: TextDocument, range?: Range) { + super(ctx, doc); + const textLen = range ? doc.offsetAt(range.end) - doc.offsetAt(range.start) + 1 : undefined; + this.semanticTokenCapability = new SemanticTokenCapability(this, SemanticTokenTypes.comment, [], range, textLen) + } +} From 93ce0b9912506bdbc981b70fcfce12fe2e4a193a Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:07:44 +0800 Subject: [PATCH 54/58] Composition over inheritence redesign --- server/src/capabilities/capabilities.ts | 129 +++++ server/src/capabilities/diagnostics.ts | 23 +- server/src/capabilities/folding.ts | 11 +- server/src/capabilities/semanticTokens.ts | 126 ++--- server/src/capabilities/symbolInformation.ts | 15 - server/src/capabilities/workspaceFolder.ts | 11 +- server/src/extensions/parserExtensions.ts | 264 +++++++-- server/src/extensions/stringExtensions.ts | 1 + server/src/project/document.ts | 170 +++--- server/src/project/elements/base.ts | 208 ++++--- server/src/project/elements/flow.ts | 33 +- server/src/project/elements/memory.ts | 554 ------------------- server/src/project/elements/module.ts | 368 +++++------- server/src/project/elements/procedure.ts | 123 ++++ server/src/project/elements/special.ts | 175 ------ server/src/project/elements/typing.ts | 152 +++++ server/src/project/parser/vbaAntlr.ts | 10 +- server/src/project/parser/vbaListener.ts | 232 ++++---- server/src/project/parser/vbaParser.ts | 13 +- server/src/project/scope.ts | 40 +- server/src/project/workspace.ts | 162 +++--- server/src/server.ts | 6 + server/src/utils/helpers.ts | 44 +- 23 files changed, 1327 insertions(+), 1543 deletions(-) create mode 100644 server/src/capabilities/capabilities.ts delete mode 100644 server/src/capabilities/symbolInformation.ts delete mode 100644 server/src/project/elements/memory.ts create mode 100644 server/src/project/elements/procedure.ts delete mode 100644 server/src/project/elements/special.ts create mode 100644 server/src/project/elements/typing.ts diff --git a/server/src/capabilities/capabilities.ts b/server/src/capabilities/capabilities.ts new file mode 100644 index 0000000..25293d7 --- /dev/null +++ b/server/src/capabilities/capabilities.ts @@ -0,0 +1,129 @@ +// Core +import { + Diagnostic, + Range, + SemanticTokenModifiers, + SemanticTokenTypes, + SymbolInformation, + SymbolKind +} from 'vscode-languageserver'; + +// Antlr +import { ParserRuleContext, TerminalNode } from 'antlr4ng'; + +// Project +import { SemanticToken } from '../capabilities/semanticTokens'; +import { FoldingRange, FoldingRangeKind } from '../capabilities/folding'; +import { BaseContextSyntaxElement, BaseIdentifyableSyntaxElement, HasSemanticTokenCapability } from '../project/elements/base'; + + +abstract class BaseCapability { + element: BaseContextSyntaxElement + + constructor(element: BaseContextSyntaxElement) { + this.element = element; + } +} + + +export class FoldingRangeCapability extends BaseCapability { + foldingRangeKind?: FoldingRangeKind; + + get foldingRange(): FoldingRange { + return new FoldingRange(this.element.context.range, this.foldingRangeKind); + } + + constructor(element: BaseContextSyntaxElement, foldingRangeKind?: FoldingRangeKind) { + super(element); + this.foldingRangeKind = foldingRangeKind; + } +} + + +export class DiagnosticCapability extends BaseCapability { + diagnostics: Diagnostic[] = []; + evaluate: (...args: any[]) => Diagnostic[] + + constructor(element: BaseContextSyntaxElement, evaluate?: (...args: any[]) => Diagnostic[]) { + super(element); + this.evaluate = evaluate ?? (() => this.diagnostics); + } +} + + +export class SemanticTokenCapability extends BaseCapability { + semanticToken: SemanticToken; + + constructor(element: BaseContextSyntaxElement & HasSemanticTokenCapability, tokenType: SemanticTokenTypes, tokenModifiers: SemanticTokenModifiers[], range?: Range, tokLength?: number) { + super(element); + + const context = !!element.identifierCapability + ? element.identifierCapability.element.context + : element.context; + + const startLine = range?.start.line ?? context.range.start.line; + const startChar = range?.start.character ?? context.range.start.character; + const textLength = tokLength ?? context.text.length; + + this.semanticToken = new SemanticToken( + element, + startLine, + startChar, + textLength, + tokenType, + tokenModifiers + ); + } +} + + +export class SymbolInformationCapability extends BaseCapability { + private symbolKind: SymbolKind + + get SymbolInformation(): SymbolInformation { + const element = this.element as BaseIdentifyableSyntaxElement; + return SymbolInformation.create( + element.identifierCapability.name, + this.symbolKind, + element.context.range, + element.context.document.uri + ) + } + + constructor(element: BaseIdentifyableSyntaxElement, symbolKind: SymbolKind) { + super(element); + this.symbolKind = symbolKind; + } +} + +interface IdentifierArgs { + element: BaseContextSyntaxElement, + getNameContext?: () => ParserRuleContext | TerminalNode | null | undefined, + formatName?: (name: string) => string, + defaultName?: string; + defaultRange?: () => Range; +} + + +export class IdentifierCapability extends BaseCapability { + nameContext?: ParserRuleContext | TerminalNode | null; + range: Range; + name: string; + + constructor(args: IdentifierArgs) { + super(args.element); + + this.nameContext = (args.getNameContext ?? (() => args.element.context.rule))(); + + if (!!this.nameContext) { + // Use the context to set the values. + this.name = (args.formatName ?? ((name: string) => name))(this.nameContext.getText()); + this.range = this.nameContext.toRange(args.element.context.document); + } else { + // Use the defaults to set the values. + if (!args.defaultRange) throw new Error("Default range not optional where name context not found."); + this.name = (args.defaultName ?? "Unknown Element"); + this.range = !!args.defaultRange ? args.defaultRange() : args.element.context.range; + } + } +} \ No newline at end of file diff --git a/server/src/capabilities/diagnostics.ts b/server/src/capabilities/diagnostics.ts index 5a3ac2f..e1da9e1 100644 --- a/server/src/capabilities/diagnostics.ts +++ b/server/src/capabilities/diagnostics.ts @@ -1,10 +1,7 @@ -import { CodeDescription, Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, Position, Range, TextDocumentClientCapabilities } from 'vscode-languageserver'; +// Core +import { CodeDescription, Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, Position, Range } from 'vscode-languageserver'; -function hasDiagnosticRelatedInformationCapability(x: TextDocumentClientCapabilities) { - return !!(x && x.publishDiagnostics && x.publishDiagnostics.relatedInformation); -} - abstract class BaseDiagnostic implements Diagnostic { range: Range; message: string @@ -32,6 +29,7 @@ export class MultipleOperatorsDiagnostic extends BaseDiagnostic { } } + export class WhileWendDeprecatedDiagnostic extends BaseDiagnostic { message = "The Do...Loop statement provides a more structured and flexible way to perform looping."; severity = DiagnosticSeverity.Information; @@ -40,6 +38,7 @@ export class WhileWendDeprecatedDiagnostic extends BaseDiagnostic { } } + export class MissingAttributeDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Error; constructor(range: Range, attributeName: string) { @@ -47,6 +46,7 @@ export class MissingAttributeDiagnostic extends BaseDiagnostic { } } + export class DuplicateAttributeDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Error; constructor(range: Range, attributeName: string) { @@ -54,6 +54,7 @@ export class DuplicateAttributeDiagnostic extends BaseDiagnostic { } } + // test export class DuplicateDeclarationDiagnostic extends BaseDiagnostic { message = "Duplicate declaration in current scope."; @@ -63,6 +64,7 @@ export class DuplicateDeclarationDiagnostic extends BaseDiagnostic { } } + // test export class ShadowDeclarationDiagnostic extends BaseDiagnostic { message = "Declaration is shadowed in the local scope."; @@ -72,6 +74,7 @@ export class ShadowDeclarationDiagnostic extends BaseDiagnostic { } } + export class IgnoredAttributeDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Warning; constructor(range: Range, attributeName: string) { @@ -79,6 +82,7 @@ export class IgnoredAttributeDiagnostic extends BaseDiagnostic { } } + export class MissingOptionExplicitDiagnostic extends BaseDiagnostic { message = "Option Explicit is missing from module header."; severity = DiagnosticSeverity.Warning; @@ -87,9 +91,18 @@ export class MissingOptionExplicitDiagnostic extends BaseDiagnostic { } } + export class ElementOutOfPlaceDiagnostic extends BaseDiagnostic { severity = DiagnosticSeverity.Error; constructor(range: Range, elementName: string) { super(range, `${elementName}s cannot appear below a Sub, Function, or Property declaration.`); } +} + + +export class LegacyFunctionalityDiagnostic extends BaseDiagnostic { + severity = DiagnosticSeverity.Warning; + constructor(range: Range, functionalityType: string) { + super(range, `${functionalityType} are legacy functionality and should be avoided.`); + } } \ No newline at end of file diff --git a/server/src/capabilities/folding.ts b/server/src/capabilities/folding.ts index da503c2..97c772b 100644 --- a/server/src/capabilities/folding.ts +++ b/server/src/capabilities/folding.ts @@ -1,5 +1,4 @@ -import { FoldingRange as LSFoldingRange } from 'vscode-languageserver'; -import { FoldableElement } from '../project/elements/special'; +import { FoldingRange as VscFoldingRange, Range } from 'vscode-languageserver'; /** * Enum of known range kinds @@ -21,7 +20,7 @@ export enum FoldingRangeKind { } -export class FoldingRange implements LSFoldingRange { +export class FoldingRange implements VscFoldingRange { /** * The zero-based line number from where the folded range starts. */ @@ -49,9 +48,9 @@ export class FoldingRange implements LSFoldingRange { */ kind?: string; - constructor(element: FoldableElement, foldingRangeKind?: FoldingRangeKind) { - this.startLine = element.range.start.line; - this.endLine = element.range.end.line; + constructor(range: Range, foldingRangeKind?: FoldingRangeKind) { + this.startLine = range.start.line; + this.endLine = range.end.line; this.kind = foldingRangeKind; } } \ No newline at end of file diff --git a/server/src/capabilities/semanticTokens.ts b/server/src/capabilities/semanticTokens.ts index 74b1f54..0377afb 100644 --- a/server/src/capabilities/semanticTokens.ts +++ b/server/src/capabilities/semanticTokens.ts @@ -1,9 +1,23 @@ -import {InitializeResult, Range, SemanticTokenModifiers, SemanticTokenTypes, uinteger, _LanguagesImpl, SemanticTokens, SemanticTokensParams, SemanticTokensRangeParams} from 'vscode-languageserver'; -import { BaseContextSyntaxElement, HasNamedSemanticToken, HasSemanticToken } from '../project/elements/base'; +// Core +import { + InitializeResult, + Range, + SemanticTokenModifiers, + SemanticTokenTypes, + uinteger, + SemanticTokens +} from 'vscode-languageserver'; + +// Antlr +import { ParserRuleContext } from 'antlr4ng/dist/ParserRuleContext'; + +// Project +import { BaseContextSyntaxElement, HasSemanticTokenCapability } from '../project/elements/base'; const registeredTokenTypes = new Map((Object.keys(SemanticTokenTypes) as (keyof typeof SemanticTokenTypes)[]).map((k, i) => ([k, i]))); const registeredTokenModifiers = new Map((Object.keys(SemanticTokenModifiers) as (keyof typeof SemanticTokenModifiers)[]).map((k, i) => ([k, 2**i]))); + export function activateSemanticTokenProvider(result: InitializeResult) { result.capabilities.semanticTokensProvider = { "full": true, @@ -14,18 +28,9 @@ export function activateSemanticTokenProvider(result: InitializeResult) { }; } -export function sortSemanticTokens(tokens: SemanticToken[]): SemanticToken[] { - return tokens.sort((a, b) => { - // Sort a before than b. - if ((a.line < b.line) || (a.line === b.line && a.char < b.char)) - return -1; - // Sort b before a. - if ((a.line > b.line) || (a.line === b.line && a.char > b.char)) - return 1; - // No difference. - return 0; - }); -} + +type SemanticElementType = HasSemanticTokenCapability + & BaseContextSyntaxElement; export class SemanticToken { line: uinteger; @@ -33,65 +38,18 @@ export class SemanticToken { length: uinteger; tokenType: uinteger; tokenModifiers: uinteger = 0; - element: HasNamedSemanticToken | HasSemanticToken; + element: SemanticElementType; - constructor(element: HasNamedSemanticToken | HasSemanticToken, line: uinteger, startChar: uinteger, length: uinteger, tokenType: SemanticTokenTypes, tokenModifiers: SemanticTokenModifiers[]) { + constructor(element: SemanticElementType, line: uinteger, startChar: uinteger, length: uinteger, tokenType: SemanticTokenTypes, tokenModifiers: SemanticTokenModifiers[]) { this.element = element; this.line = line; this.char = startChar; this.length = length; this.tokenType = registeredTokenTypes.get(tokenType)!; tokenModifiers.forEach((x) => this.tokenModifiers += registeredTokenModifiers.get(x) ?? 0); - } - - static create(st: HasSemanticToken): SemanticToken; - static create(nst: HasNamedSemanticToken): SemanticToken; - static create(element: HasSemanticToken | HasNamedSemanticToken): SemanticToken { - if (((o: any): o is HasNamedSemanticToken => 'identifier' in o)(element)) { - return new SemanticToken( - element, - element.identifier.range.start.line, - element.identifier.range.start.character, - element.identifier.context.getText().length, - element.tokenType, - element.tokenModifiers - ); - } - if (((o: any): o is HasSemanticToken => 'tokenType' in o)(element)) { - return new SemanticToken( - element, - element.range.start.line, - element.range.start.character, - element.context.getText().length, - element.tokenType, - element.tokenModifiers - ); - } - - throw new Error("This will never be thrown but it appeases the linter."); - } - - toNewRange(range: Range): SemanticToken { - const token = new SemanticToken( - this.element, - range.start.line, - range.start.character, - this.length, - SemanticTokenTypes.class, - [] - ); - token.tokenType = this.tokenType; - token.tokenModifiers = this.tokenModifiers; - return token; } - toDeltaToken(line: uinteger = 0, startChar: uinteger = 0): uinteger[] { - const deltaLine = this.line - line; - const deltaChar = deltaLine === 0 ? this.char - startChar : this.char; - return [deltaLine, deltaChar, this.length, this.tokenType, this.tokenModifiers]; - } - - toSemanticTokensArray(reference?: SemanticToken): uinteger[] { + toUintegerArray(reference?: SemanticToken): uinteger[] { const line = this.line - (reference?.line ?? 0); const char = line === 0 ? this.char - reference!.char : this.char; return [ @@ -109,37 +67,35 @@ export class SemanticToken { * Tracks, sorts, and provides LSP response for SemanticTokens. */ export class SemanticTokensManager { - private _tokens: SemanticToken[] = []; + private tokens: SemanticToken[] = []; - private _tokensInRange = (range: Range) => - this._tokens.filter(token => token.element.isChildOf(range)); - - add(element: HasNamedSemanticToken) { - this._tokens.push(SemanticToken.create(element)); - } + private tokensInRange = (range: Range) => + this.tokens.filter(token => token.element.isChildOf(range)); - addComment(element: HasSemanticToken) { - this._tokens.push(SemanticToken.create(element)); + add(element: HasSemanticTokenCapability) { + this.tokens.push(element.semanticTokenCapability.semanticToken); } - // getSemanticTokens(params: SemanticTokensParams): SemanticTokens | null; - // getSemanticTokens(rangeParams: SemanticTokensRangeParams): SemanticTokens | null; - // getSemanticTokens(_?: SemanticTokensParams, rangeParams?: SemanticTokensRangeParams): SemanticTokens | null { getSemanticTokens(range?: Range): SemanticTokens | null { - // Get the range if we have one. - // const range: Range | undefined = rangeParams?.range; - // Filter and sort the semantic tokens. - const filteredTokens = range ? this._tokensInRange(range) : this._tokens; - const sortedTokens = sortSemanticTokens(filteredTokens); + const filteredTokens = range ? this.tokensInRange(range) : this.tokens; + const sortedTokens = this.sortSemanticTokens(filteredTokens); if (sortedTokens.length === 0) return null; // Get an array of SemanticTokens relative to previous token. - const packedData: uinteger[][] = sortedTokens.map((token, i) => - token.toSemanticTokensArray(i === 0 ? undefined : sortedTokens[i - 1])); + const relativeResult: uinteger[] = sortedTokens.map((token, i) => + token.toUintegerArray(i === 0 ? undefined : sortedTokens[i - 1])).flat(); // Return the flattened array. - return { data: ([] as uinteger[]).concat(...packedData) }; + return { data: relativeResult }; } -} + + sortSemanticTokens(tokens: SemanticToken[]): SemanticToken[] { + return tokens.sort((a, b) => { + if ((a.line < b.line) || (a.line === b.line && a.char < b.char)) return -1; + if ((a.line > b.line) || (a.line === b.line && a.char > b.char)) return 1; + return 0; + }); + } +} \ No newline at end of file diff --git a/server/src/capabilities/symbolInformation.ts b/server/src/capabilities/symbolInformation.ts deleted file mode 100644 index bf94b5c..0000000 --- a/server/src/capabilities/symbolInformation.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SymbolInformation, SymbolKind } from 'vscode-languageserver'; -import { NamedSyntaxElement } from '../project/elements/base'; - - -export class SymbolInformationFactory { - static create(element: NamedSyntaxElement, symbolKind: SymbolKind): SymbolInformation { - return SymbolInformation.create( - element.name, - symbolKind, - element.range, - element.uri - ); - } -} - diff --git a/server/src/capabilities/workspaceFolder.ts b/server/src/capabilities/workspaceFolder.ts index d42d09c..c85b575 100644 --- a/server/src/capabilities/workspaceFolder.ts +++ b/server/src/capabilities/workspaceFolder.ts @@ -1,15 +1,20 @@ +// Core import { ClientCapabilities, InitializeResult } from 'vscode-languageserver'; + +// Project import { LanguageServerConfiguration } from '../server'; +function hasWorkspaceFolderCapability(x: ClientCapabilities) { + return !!(x.workspace && !!x.workspace.workspaceFolders); +} + + export function hasConfigurationCapability(languageServerConfiguration: LanguageServerConfiguration) { const capabilities = languageServerConfiguration.params.capabilities; return !!(capabilities.workspace && !!capabilities.workspace.configuration); } -function hasWorkspaceFolderCapability(x: ClientCapabilities) { - return !!(x.workspace && !!x.workspace.workspaceFolders); -} export function activateWorkspaceFolderCapability(capabilities: ClientCapabilities, result: InitializeResult) { if (hasWorkspaceFolderCapability(capabilities)) { diff --git a/server/src/extensions/parserExtensions.ts b/server/src/extensions/parserExtensions.ts index e41272e..10e67ee 100644 --- a/server/src/extensions/parserExtensions.ts +++ b/server/src/extensions/parserExtensions.ts @@ -1,17 +1,104 @@ -import { ParserRuleContext } from 'antlr4ng'; -import { Range } from 'vscode-languageserver'; +// Core +import { Range, SymbolKind } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; +// Antlr +import { ParserRuleContext, TerminalNode } from 'antlr4ng'; + +// Project +import { CompilerConditionalStatementContext } from '../antlr/out/vbapreParser'; +import { + AmbiguousIdentifierContext, + BuiltinTypeContext, + ClassTypeNameContext, + ConstItemContext, + GlobalVariableDeclarationContext, + PrivateConstDeclarationContext, + PrivateVariableDeclarationContext, + PublicConstDeclarationContext, + PublicVariableDeclarationContext, + TypeSpecContext, + TypeSuffixContext, + VariableDclContext, + WitheventsVariableDclContext +} from '../antlr/out/vbaParser'; + + declare module 'antlr4ng' { interface ParserRuleContext { + /** Convert the node to a range. */ toRange(doc: TextDocument): Range; } + + interface TerminalNode { + /** Convert the node to a range. */ + toRange(doc: TextDocument): Range; + } +} + + +declare module '../antlr/out/vbapreParser' { + interface CompilerConditionalStatementContext { + vbaExpression(): string; + } +} + + +declare module '../antlr/out/vbaParser' { + interface PublicConstDeclarationContext { + /** Shortcut to get the declaration contexts. */ + declarationContexts(): ConstItemContext[]; + } + + interface PrivateConstDeclarationContext { + /** Shortcut to get the declaration contexts. */ + declarationContexts(): ConstItemContext[]; + } + + interface ConstItemContext { + /** Shortcut the identifier as we know it will always exist. */ + ambiguousIdentifier(): AmbiguousIdentifierContext; + /** Shortcut to get the type context */ + typeContext(): BuiltinTypeContext | TypeSuffixContext | undefined; + /** Extension method to get the symbol kind. */ + toSymbolKind(): SymbolKind; + } + + interface PublicVariableDeclarationContext { + /** Shortcut the variable list */ + declarationContexts(): (VariableDclContext | WitheventsVariableDclContext)[]; + } + + interface PrivateVariableDeclarationContext { + /** Shortcut the variable list */ + declarationContexts(): (VariableDclContext | WitheventsVariableDclContext)[]; + } + + interface GlobalVariableDeclarationContext { + /** Shortcut the variable list */ + declarationContexts(): VariableDclContext[]; + } + + interface VariableDclContext { + /** Shortcut the identifier as we know it will always exist. */ + ambiguousIdentifier(): AmbiguousIdentifierContext; + /** Shortcut to get the type context */ + typeContext(): TypeSpecContext | TypeSuffixContext | ClassTypeNameContext | undefined; + /** Extension method to get the symbol kind. */ + toSymbolKind(): SymbolKind; + } + + interface WitheventsVariableDclContext { + /** Shortcut the identifier as we know it will always exist. */ + ambiguousIdentifier(): AmbiguousIdentifierContext; + /** Shortcut to get the type context */ + typeContext(): TypeSpecContext | TypeSuffixContext | ClassTypeNameContext | undefined; + /** Extension method to get the symbol kind. */ + toSymbolKind(): SymbolKind; + } } -/** - * Convert the context to a range. - */ ParserRuleContext.prototype.toRange = function (doc: TextDocument): Range { const startIndex = this.start?.start ?? 0; const stopIndex = this.stop?.stop ?? startIndex; @@ -21,44 +108,135 @@ ParserRuleContext.prototype.toRange = function (doc: TextDocument): Range { ); }; -// declare module '../antlr/out/vbaParser' { -// export interface BaseTypeContext { -// toSymbolKind(): SymbolKind; -// } - -// export interface ComplexTypeContext { -// toSymbolKind(): SymbolKind; -// } -// } - -// BaseTypeContext.prototype.toSymbolKind = function (): SymbolKind { -// return toSymbolKind(this); -// }; - -// ComplexTypeContext.prototype.toSymbolKind = function (): SymbolKind { -// return toSymbolKind(this); -// }; - -// function toSymbolKind(context: BaseTypeContext | ComplexTypeContext): SymbolKind { -// switch (context.text.toLocaleLowerCase()) { -// case 'boolean': -// return SymbolKind.Boolean; -// case 'byte': -// case 'string': -// return SymbolKind.String; -// case 'double': -// case 'currency': -// case 'integer': -// case 'long': -// case 'longPtr': -// case 'longLong': -// return SymbolKind.Number; -// case 'object': -// return SymbolKind.Object; -// default: -// return SymbolKind.Class; -// } -// } + +TerminalNode.prototype.toRange = function (doc: TextDocument): Range { + const startIndex = this.getPayload()?.start ?? 0; + const stopIndex = this.getPayload()?.stop ?? startIndex; + return Range.create( + doc.positionAt(startIndex), + doc.positionAt(stopIndex + 1) + ); +}; + + +CompilerConditionalStatementContext.prototype.vbaExpression = function (): string { + return (this.compilerIfStatement() ?? this.compilerElseIfStatement())! + .booleanExpression() + .getText() + .toLowerCase(); +}; + + +// Constants + +PublicConstDeclarationContext.prototype.declarationContexts = function (): ConstItemContext[] { + return this.moduleConstDeclaration() + .constDeclaration() + .constItemList() + .constItem(); +}; + + +PrivateConstDeclarationContext.prototype.declarationContexts = function (): ConstItemContext[] { + return this.moduleConstDeclaration() + .constDeclaration() + .constItemList() + .constItem(); +}; + + +ConstItemContext.prototype.ambiguousIdentifier = function (): AmbiguousIdentifierContext { + // A variable will always be typed or untyped. + return this.typedNameConstItem()?.typedName().ambiguousIdentifier() + ?? this.untypedNameConstItem()!.ambiguousIdentifier(); +}; + +ConstItemContext.prototype.typeContext = function (): BuiltinTypeContext | TypeSuffixContext | undefined { + return this.typedNameConstItem()?.typedName().typeSuffix() + ?? this.untypedNameConstItem()?.constAsClause()?.builtinType() +}; + + +// Variables + +PublicVariableDeclarationContext.prototype.declarationContexts = function (): (VariableDclContext | WitheventsVariableDclContext)[] { + const dims = this.moduleVariableDeclarationList(); + return [dims.witheventsVariableDcl(), dims.variableDcl()].flat(); +}; + + +PrivateVariableDeclarationContext.prototype.declarationContexts = function (): (VariableDclContext | WitheventsVariableDclContext)[] { + const dims = this.moduleVariableDeclarationList(); + return [dims.witheventsVariableDcl(), dims.variableDcl()].flat(); +}; + + +GlobalVariableDeclarationContext.prototype.declarationContexts = function (): VariableDclContext[] { + const varList = this.variableDeclarationList(); + return varList.variableDcl(); +}; + + +VariableDclContext.prototype.ambiguousIdentifier = function (): AmbiguousIdentifierContext { + // A variable will always be typed or untyped. + return this.typedVariableDcl()?.typedName().ambiguousIdentifier() + ?? this.untypedVariableDcl()!.ambiguousIdentifier(); +}; + + +VariableDclContext.prototype.typeContext = function (): TypeSpecContext | TypeSuffixContext | ClassTypeNameContext | undefined { + return this.typedVariableDcl()?.typedName().typeSuffix() + ?? this.untypedVariableDcl()?.asClause()?.asType()?.typeSpec() + ?? this.untypedVariableDcl()?.asClause()?.asAutoObject()?.classTypeName(); +}; + + +// SymbolKind + +ConstItemContext.prototype.toSymbolKind = function (): SymbolKind { + return toSymbolKind(this.typeContext()); +}; + + +WitheventsVariableDclContext.prototype.toSymbolKind = function (): SymbolKind { + return toSymbolKind(this.typeContext()); +}; + + +VariableDclContext.prototype.toSymbolKind = function (): SymbolKind { + return toSymbolKind(this.typeContext()); +}; + + +function toSymbolKind(context: BuiltinTypeContext | TypeSuffixContext | TypeSpecContext | ClassTypeNameContext | undefined): SymbolKind { + switch (context?.getText().toLocaleLowerCase()) { + case undefined: + return SymbolKind.Class + case 'boolean': + return SymbolKind.Boolean; + case '$': // string + case 'byte': + case 'string': + return SymbolKind.String; + case '%': // integer + case '&': // long + case '^': // longlong + case '@': // decimal + case '!': // single + case '#': // double + case 'double': + case 'currency': + case 'integer': + case 'long': + case 'longPtr': + case 'longLong': + return SymbolKind.Number; + case 'object': + return SymbolKind.Object; + default: + return SymbolKind.Class; + } +} /** * const File: 1; diff --git a/server/src/extensions/stringExtensions.ts b/server/src/extensions/stringExtensions.ts index 9c43ace..f8fb6fb 100644 --- a/server/src/extensions/stringExtensions.ts +++ b/server/src/extensions/stringExtensions.ts @@ -2,6 +2,7 @@ interface String { stripQuotes(): string; } + String.prototype.stripQuotes = function (): string { const exp = /^"?(.*?)"?$/; return exp.exec(this.toString())![1]; diff --git a/server/src/project/document.ts b/server/src/project/document.ts index 7eefeab..2bf9ef2 100644 --- a/server/src/project/document.ts +++ b/server/src/project/document.ts @@ -1,13 +1,31 @@ +// Core +import { Range, TextDocument } from 'vscode-languageserver-textdocument'; import { CancellationToken, Diagnostic, DocumentDiagnosticReport, DocumentDiagnosticReportKind, SymbolInformation, SymbolKind } from 'vscode-languageserver'; + +// Antlr +import { ParseCancellationException, ParserRuleContext } from 'antlr4ng'; + +// Project import { Workspace } from './workspace'; -import { FoldableElement } from './elements/special'; -import { BaseContextSyntaxElement, HasDiagnosticCapability, HasNamedSemanticToken, HasSemanticToken, HasSymbolInformation, NamedSyntaxElement } from './elements/base'; -import { Range, TextDocument } from 'vscode-languageserver-textdocument'; +import { Dictionary } from '../utils/helpers'; import { SyntaxParser } from './parser/vbaParser'; import { FoldingRange } from '../capabilities/folding'; import { SemanticTokensManager } from '../capabilities/semanticTokens'; -import { ParseCancellationException } from 'antlr4ng'; -import { NewPropertyDeclarationElement, NewPropertyGetDeclarationElement, NewPropertyLetDeclarationElement, NewPropertySetDeclarationElement } from './elements/memory'; +import { BaseContextSyntaxElement, + BaseSyntaxElement, + DeclarableElement, + HasDiagnosticCapability, + HasFoldingRangeCapability, + HasSemanticTokenCapability, + HasSymbolInformationCapability +} from './elements/base'; + +import { PropertyDeclarationElement, + PropertyGetDeclarationElement, + PropertyLetDeclarationElement, + PropertySetDeclarationElement +} from './elements/procedure'; + export interface DocumentSettings { maxDocumentLines: number; @@ -34,25 +52,22 @@ export abstract class BaseProjectDocument { readonly name: string; readonly workspace: Workspace; readonly textDocument: TextDocument; - protected _documentConfiguration?: DocumentSettings; - - protected _hasDiagnosticElements: HasDiagnosticCapability[] = []; - protected _unhandledNamedElements: [] = []; - protected _documentScopeDeclarations: Map> = new Map(); + + protected diagnostics: Diagnostic[] = []; + protected documentConfiguration?: DocumentSettings; + protected documentScopeDeclarations: Map> = new Map(); + protected foldableElements: FoldingRange[] = []; + protected hasDiagnosticElements: HasDiagnosticCapability[] = []; + protected properties: Dictionary = new Dictionary(() => new PropertyDeclarationElement()); + protected redactedElements: BaseContextSyntaxElement[] = []; + protected semanticTokens: SemanticTokensManager = new SemanticTokensManager(); + protected symbolInformations: SymbolInformation[] = []; + protected unhandledNamedElements: [] = []; - protected _diagnostics: Diagnostic[] = []; - protected _foldableElements: FoldingRange[] = []; - protected _symbolInformations: SymbolInformation[] = []; - protected _semanticTokens: SemanticTokensManager = new SemanticTokensManager(); - protected _redactedElements: BaseContextSyntaxElement[] = []; - protected _properties: Map = new Map(); + abstract symbolKind: SymbolKind protected _isBusy = true; - abstract symbolKind: SymbolKind - - get isBusy() { - return this._isBusy; - } + get isBusy() { return this._isBusy; } get isOversize() { // Workaround for async getter. @@ -62,25 +77,25 @@ export abstract class BaseProjectDocument { } get redactedText() { - return this._subtractTextFromRanges(this._redactedElements.map(x => x.range)); + return this.subtractTextFromRanges(this.redactedElements.map(x => x.context.range)); } async getDocumentConfiguration(): Promise { // Get the stored configuration. - if (this._documentConfiguration) { - return this._documentConfiguration; + if (this.documentConfiguration) { + return this.documentConfiguration; } // Get the configuration from the client. if (this.workspace.hasConfigurationCapability) { - this._documentConfiguration = await this.workspace.requestDocumentSettings(this.textDocument.uri); - if (this._documentConfiguration) { - return this._documentConfiguration; + this.documentConfiguration = await this.workspace.requestDocumentSettings(this.textDocument.uri); + if (this.documentConfiguration) { + return this.documentConfiguration; } } // Use the defaults. - this._documentConfiguration = { + this.documentConfiguration = { maxDocumentLines: 1500, maxNumberOfProblems: 100, doWarnOptionExplicitMissing: true, @@ -89,10 +104,10 @@ export abstract class BaseProjectDocument { version: "Vba7" } }; - return this._documentConfiguration; + return this.documentConfiguration; } - clearDocumentConfiguration = () => this._documentConfiguration = undefined; + clearDocumentConfiguration = () => this.documentConfiguration = undefined; constructor(workspace: Workspace, name: string, document: TextDocument) { this.textDocument = document; @@ -123,22 +138,22 @@ export abstract class BaseProjectDocument { } languageServerSemanticTokens = (range?: Range) => { - return this._semanticTokens.getSemanticTokens(range); + return this.semanticTokens.getSemanticTokens(range); }; languageServerFoldingRanges(): FoldingRange[] { - return this._foldableElements; + return this.foldableElements; } languageServerSymbolInformation(): SymbolInformation[] { - return this._symbolInformations; + return this.symbolInformations; } languageServerDiagnostics(): DocumentDiagnosticReport { return { kind: DocumentDiagnosticReportKind.Full, - items: this._hasDiagnosticElements - .map((e) => e.diagnostics).flat(1) + items: this.hasDiagnosticElements + .map((e) => e.diagnosticCapability.diagnostics).flat(1) }; } @@ -165,66 +180,54 @@ export abstract class BaseProjectDocument { await (new SyntaxParser()).parseAsync(this) // Evaluate the diagnostics. - this._diagnostics = this._hasDiagnosticElements - .map(e => e.evaluateDiagnostics()) + this.diagnostics = this.hasDiagnosticElements + .map(e => e.diagnosticCapability.evaluate()) .flat(); this._isBusy = false; }; - registerPropertyElementDeclaration(element: NewPropertyGetDeclarationElement | NewPropertySetDeclarationElement | NewPropertyLetDeclarationElement) { - if (this._properties.has(element.name)) { - this._properties.get(element.name)!.addPropertyDeclaration(element); - return this; - } - this._properties.set(element.name, new NewPropertyDeclarationElement(element)); + /** + * Auto registers the element based on capabilities. + * @returns This for chaining. + */ + registerElement(element: BaseSyntaxElement) { + if (!!element.diagnosticCapability) this.registerDiagnosticElement(element as HasDiagnosticCapability); + if (!!element.foldingRangeCapability) this.registerFoldableElement(element as HasFoldingRangeCapability); + if (!!element.semanticTokenCapability) this.registerSemanticToken(element as HasSemanticTokenCapability); + if (!!element.symbolInformationCapability) this.registerSymbolInformation(element as HasSymbolInformationCapability); return this; } - registerNamedElementDeclaration(element: NamedSyntaxElement) { + registerPropertyElementDeclaration(element: PropertyGetDeclarationElement | PropertySetDeclarationElement | PropertyLetDeclarationElement) { + const elementName = element.propertyName; + this.properties.getOrSet(elementName) + .addPropertyDeclaration(element); + return this; + } + + registerNamedElementDeclaration(element: DeclarableElement) { this.workspace.namespaceManager.addNameItem(element); return this; } - registerNamespaceElement(element: NamedSyntaxElement) { + registerNamespaceElement(element: DeclarableElement) { this.workspace.namespaceManager.addNamespace(element); return this; } - deregisterScopedElement() { + deregisterNamespaceElement() { this.workspace.namespaceManager.popNamespace(); return this; } registerDiagnosticElement(element: HasDiagnosticCapability) { - this._hasDiagnosticElements.push(element); + this.hasDiagnosticElements.push(element); return this; } - /** - * Pushes an element to the attribute elements stack. - * Be careful to pair a register action with an appropriate deregister. - * @param element the element to register. - * @returns nothing of interest. - */ - // registerAttributeElement = (element: HasAttribute) => { - // this._attributeElements.push(element); - // return this; - // }; - - /** - * Pops an element from the attribute elements stack. - * Popping allows actions to be performed on the same element, - * e.g., registered in the entry event and deregistered in the exit event. - * @param element the element to register. - * @returns the element at the end of the stack. - */ - // deregisterAttributeElement = () => { - // return this._attributeElements.pop(); - // }; - - registerFoldableElement = (element: FoldableElement) => { - this._foldableElements.push(new FoldingRange(element)); + registerFoldableElement = (element: HasFoldingRangeCapability) => { + this.foldableElements.push(element.foldingRangeCapability.foldingRange); return this; }; @@ -233,18 +236,13 @@ export abstract class BaseProjectDocument { * @param element element The element that has a semantic token. * @returns this for chaining. */ - registerSemanticToken = (element: HasNamedSemanticToken) => { - this._semanticTokens.add(element); - return this; - }; - - registerCommentOutElement = (element: HasSemanticToken) => { - this._semanticTokens.addComment(element); + registerSemanticToken = (element: HasSemanticTokenCapability) => { + this.semanticTokens.add(element); return this; } - registerSubtractElement = (element: BaseContextSyntaxElement) => { - this._redactedElements.push(element); + registerSubtractElement = (element: BaseContextSyntaxElement) => { + this.redactedElements.push(element); return this; } @@ -253,15 +251,15 @@ export abstract class BaseProjectDocument { * @param element The element that has symbol information. * @returns this for chaining. */ - registerSymbolInformation = (element: HasSymbolInformation) => { - this._symbolInformations.push(element.symbolInformation); + registerSymbolInformation = (element: HasSymbolInformationCapability) => { + this.symbolInformations.push(element.symbolInformationCapability.SymbolInformation); return this; - }; + } - private _subtractTextFromRanges(ranges: Range[]): string { + private subtractTextFromRanges(ranges: Range[]): string { const text = this.textDocument.getText(); - return ranges.reduce((x, y) => this._subtractTextRange(x, y), text); + return ranges.reduce((x, y) => this.subtractTextRange(x, y), text); } /** @@ -270,7 +268,7 @@ export abstract class BaseProjectDocument { * @param range the range to subtract. * @returns the original text with the range replaced by spaces. */ - private _subtractTextRange(text: string, range: Range): string { + private subtractTextRange(text: string, range: Range): string { const docLines = text.split('\r\n'); if (range.start.line === range.end.line) { diff --git a/server/src/project/elements/base.ts b/server/src/project/elements/base.ts index ac1a3f5..ad6e8ee 100644 --- a/server/src/project/elements/base.ts +++ b/server/src/project/elements/base.ts @@ -1,118 +1,154 @@ +// Core +import { Position, Range } from 'vscode-languageserver'; +import { TextDocument } from 'vscode-languageserver-textdocument'; + +// Antlr import { ParserRuleContext } from 'antlr4ng'; -import { Diagnostic, Range, SemanticTokenModifiers, SemanticTokenTypes, SymbolInformation, SymbolKind } from 'vscode-languageserver'; -import { Position, TextDocument } from 'vscode-languageserver-textdocument'; -import { FoldingRangeKind } from '../../capabilities/folding'; -import { IdentifierElement, PropertyDeclarationElement } from './memory'; -import '../../extensions/parserExtensions'; -import { contextToRange } from '../../utils/helpers'; - -export interface ContextOptionalSyntaxElement { - range?: Range; - parent?: ContextOptionalSyntaxElement; - context?: ParserRuleContext; - get text(): string; - get uri(): string; +// Project +import { + DiagnosticCapability, + FoldingRangeCapability, + IdentifierCapability, + SemanticTokenCapability, + SymbolInformationCapability +} from '../../capabilities/capabilities'; + + +export abstract class BaseSyntaxElement { + // Base Properties + context?: Context + identifierCapability?: IdentifierCapability; + + // Capabilities + diagnosticCapability?: DiagnosticCapability; + foldingRangeCapability?: FoldingRangeCapability; + semanticTokenCapability?: SemanticTokenCapability; + symbolInformationCapability?: SymbolInformationCapability; + + get isPublic(): boolean { return false; } + + constructor(); + constructor(ctx: T, doc: TextDocument) + constructor(ctx?: T, doc?: TextDocument) { + if (!!ctx && !!doc) this.context = new Context(ctx, doc); + } + + /** + * Checks if this element is a child of another element. + * @returns True if the element is a child of the passed element. + */ isChildOf(range: Range): boolean; -} + isChildOf(element: BaseSyntaxElement): boolean; + isChildOf(elementOrRange: BaseSyntaxElement | Range): boolean { + const a = this.context?.range; + const b = ((o: any): o is BaseSyntaxElement => 'context' in o)(elementOrRange) + ? elementOrRange.context?.range + : elementOrRange; -interface SyntaxElement extends ContextOptionalSyntaxElement { - range: Range; - context: ParserRuleContext; -} + if (!a || !b) return false; -export interface HasDiagnosticCapability { - diagnostics: Diagnostic[]; - evaluateDiagnostics(): Diagnostic[]; -} + const isPositionBefore = (x: Position, y: Position) => x.line < y.line + || (x.line === y.line && x.character <= y.character); -export interface NamedSyntaxElement extends SyntaxElement, HasDiagnosticCapability { - get name(): string; - get isPublic(): boolean; - equals(element: any): boolean; -} + return isPositionBefore(b.start, a.start) + && isPositionBefore(a.end, b.end); + } -export interface IdentifiableSyntaxElement extends NamedSyntaxElement { - identifier: IdentifierElement; - isPropertyElement(): this is PropertyDeclarationElement + /** + * Compare two syntax elements for equality. + * @returns True if the document, range, and text match. + */ + equals(element: BaseSyntaxElement): boolean { + const a = this.context; + const b = element.context; + + return !!a && !!b + && a.document.uri === b.document.uri + && a.range === b.range + && a.text === b.text; + } } -export interface HasSymbolInformation extends NamedSyntaxElement { - get symbolInformation(): SymbolInformation; -} -export interface HasNamedSemanticToken extends NamedSyntaxElement, IdentifiableSyntaxElement { - tokenType: SemanticTokenTypes; - tokenModifiers: SemanticTokenModifiers[]; -} +export abstract class BaseContextSyntaxElement extends BaseSyntaxElement implements HasContext { + context!: Context; -export interface HasSemanticToken extends SyntaxElement { - range: Range; - context: ParserRuleContext; - tokenType: SemanticTokenTypes; - tokenModifiers: SemanticTokenModifiers[]; + constructor(ctx: T, doc: TextDocument) { + super(ctx, doc); + } } -export interface MemoryElement extends BaseSyntaxElement { - name: string; - returnType: any; - symbol: SymbolKind; -} -export interface FoldingRangeElement { - range: Range; - foldingRangeKind?: FoldingRangeKind; -} +export abstract class BaseIdentifyableSyntaxElement extends BaseContextSyntaxElement implements IsIdentifiable { + abstract identifierCapability: IdentifierCapability; -export interface DeclarationElement extends HasDiagnosticCapability, NamedSyntaxElement { - isPublic: boolean; - isPropertyElement(): this is PropertyDeclarationElement + constructor(ctx: T, doc: TextDocument) { + super(ctx, doc); + } } -export abstract class BaseSyntaxElement implements ContextOptionalSyntaxElement { - protected document: TextDocument; + +// --------------------------------------------------------- +// Utilities +// --------------------------------------------------------- + +export class Context { + rule: T; + document: TextDocument; + range: Range; - range?: Range; - parent?: ContextOptionalSyntaxElement; - context?: ParserRuleContext; + get text(): string { + return this.rule.getText(); + } - get text(): string { return this.context?.getText() ?? ''; } - get uri(): string { return this.document.uri; } + get startIndex() { return this.rule.start?.start ?? 0; } + get stopIndex() { return this.rule.stop?.stop ?? 0; } - constructor(context: ParserRuleContext | undefined, document: TextDocument) { - this.context = context; + constructor(context: T, document: TextDocument) { + this.rule = context; this.document = document; - this.range = this._contextToRange(); + this.range = context.toRange(document); } +} - isChildOf = (range: Range): boolean => { - if (!this.range) { - return false; - } - const isPositionBefore = (x: Position, y: Position) => - x.line < y.line || (x.line === y.line && x.character <= y.character); +// --------------------------------------------------------- +// Interfaces +// --------------------------------------------------------- - return isPositionBefore(range.start, this.range.start) - && isPositionBefore(this.range.end, range.end); - }; +export interface HasContext { + context: Context; +} - equals = (element: BaseSyntaxElement): boolean => - this.document.uri === element.document.uri - && this.range === element.range - && this.text === element.text; - protected _contextToRange(): Range | undefined { - return contextToRange(this.document, this.context); - } +export interface HasDiagnosticCapability extends HasContext { + diagnosticCapability: DiagnosticCapability; } -export abstract class BaseContextSyntaxElement extends BaseSyntaxElement { - range!: Range; - context!: ParserRuleContext; - constructor(ctx: ParserRuleContext, doc: TextDocument) { - super(ctx, doc); - } +export interface IsIdentifiable { + identifierCapability: IdentifierCapability +} + + +export interface HasSemanticTokenCapability { + semanticTokenCapability: SemanticTokenCapability +} + + +export interface HasSymbolInformationCapability extends IsIdentifiable { + symbolInformationCapability: SymbolInformationCapability } + +export interface HasFoldingRangeCapability { + foldingRangeCapability: FoldingRangeCapability; +} + + +// --------------------------------------------------------- +// Compound Types +// --------------------------------------------------------- + +export type DeclarableElement = BaseContextSyntaxElement & IsIdentifiable & HasDiagnosticCapability; diff --git a/server/src/project/elements/flow.ts b/server/src/project/elements/flow.ts index d1cac94..25af6bf 100644 --- a/server/src/project/elements/flow.ts +++ b/server/src/project/elements/flow.ts @@ -1,33 +1,36 @@ -import { Diagnostic } from 'vscode-languageserver'; +// Core import { TextDocument } from 'vscode-languageserver-textdocument'; + +// Antlr import { AnyOperatorContext, WhileStatementContext } from '../../antlr/out/vbaParser'; +// Project +import { DiagnosticCapability } from '../../capabilities/capabilities'; import { BaseContextSyntaxElement, HasDiagnosticCapability } from './base'; import { MultipleOperatorsDiagnostic, WhileWendDeprecatedDiagnostic } from '../../capabilities/diagnostics'; -export class WhileLoopElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { - diagnostics: Diagnostic[] = []; +export class WhileLoopElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { + diagnosticCapability: DiagnosticCapability; constructor(context: WhileStatementContext, document: TextDocument) { super(context, document); - } - - evaluateDiagnostics() { - this.diagnostics.push(new WhileWendDeprecatedDiagnostic(this.range)) - return this.diagnostics; + this.diagnosticCapability = new DiagnosticCapability(this, () => { + this.diagnosticCapability.diagnostics.push(new WhileWendDeprecatedDiagnostic(this.context.range)); + return this.diagnosticCapability.diagnostics; + }); } } -export class DuplicateOperatorElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { - diagnostics: Diagnostic[] = []; + +export class DuplicateOperatorElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { + diagnosticCapability: DiagnosticCapability; constructor(context: AnyOperatorContext, document: TextDocument) { super(context, document); - } - - evaluateDiagnostics() { - this.diagnostics.push(new MultipleOperatorsDiagnostic(this.range)) - return this.diagnostics; + this.diagnosticCapability = new DiagnosticCapability(this, () => { + this.diagnosticCapability.diagnostics.push(new MultipleOperatorsDiagnostic(this.context.range)); + return this.diagnosticCapability.diagnostics; + }); } } \ No newline at end of file diff --git a/server/src/project/elements/memory.ts b/server/src/project/elements/memory.ts deleted file mode 100644 index 0d00cb4..0000000 --- a/server/src/project/elements/memory.ts +++ /dev/null @@ -1,554 +0,0 @@ -import { TextDocument } from 'vscode-languageserver-textdocument'; -import { Diagnostic, SemanticTokenModifiers, SemanticTokenTypes, SymbolInformation, SymbolKind } from 'vscode-languageserver'; -import { AmbiguousIdentifierContext, ConstItemContext, EnumDeclarationContext, EnumMemberContext, FunctionDeclarationContext, ProcedureDeclarationContext, PropertyGetDeclarationContext, PropertySetDeclarationContext, PublicConstDeclarationContext, ReservedMemberNameContext, SubroutineDeclarationContext, UdtDeclarationContext, UdtElementContext, UntypedNameContext, VariableDclContext } from '../../antlr/out/vbaParser'; - -import { BaseContextSyntaxElement, DeclarationElement, HasDiagnosticCapability, HasNamedSemanticToken, HasSymbolInformation, IdentifiableSyntaxElement, NamedSyntaxElement } from './base'; - -import { VbaClassDocument, VbaModuleDocument } from '../document'; -import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; -import '../../extensions/parserExtensions'; -import { DuplicateDeclarationDiagnostic, ElementOutOfPlaceDiagnostic } from '../../capabilities/diagnostics'; -import { ScopeElement } from './special'; -import { ParserRuleContext } from 'antlr4ng'; - - - -export class IdentifierElement extends BaseContextSyntaxElement { - constructor(ctx: UntypedNameContext | ConstItemContext | AmbiguousIdentifierContext | ReservedMemberNameContext, doc: TextDocument) { - super(ctx, doc); - } -} - -export abstract class ProcedureDeclarationElement extends ScopeElement { - abstract diagnostics: Diagnostic[]; - abstract identifier: IdentifierElement; - - constructor(context: ProcedureDeclarationContext, document: TextDocument) { - super(context, document); - } - - evaluateDiagnostics(): Diagnostic[] { - return []; - } - - get name(): string { - return this.identifier.text; - } - - static create(context: ProcedureDeclarationContext, document: VbaClassDocument | VbaModuleDocument) { - let methodContext: SubroutineDeclarationContext | FunctionDeclarationContext | PropertyGetDeclarationContext | null; - - // Create a sub if we have one. - methodContext = context.subroutineDeclaration(); - if (methodContext) { - return new SubDeclarationElement(context, document.textDocument, methodContext); - } - - // Create a function if we have one. - methodContext = context.functionDeclaration(); - if (methodContext) { - return new FunctionDeclarationElement(context, document.textDocument, methodContext); - } - - // Check if we already have a property with this name. - const propertyDeclaration = new PropertyDeclarationElement(context, document.textDocument); - const identifierText = propertyDeclaration.identifier.text; - // const predeclaredElements = document.currentScopeElement?.declaredNames.get(identifierText) ?? []; - - // Add to an existing property rather than creating. - // for (const element of predeclaredElements) { - // if (element.isPropertyElement() && element.identifier.text === identifierText) { - // element.addPropertyDeclaration(context, document.textDocument); - // return element; - // } - // } - - // Return a new property. - return propertyDeclaration; - } -} - -export class SubDeclarationElement extends ProcedureDeclarationElement implements DeclarationElement, HasSymbolInformation { - identifier: IdentifierElement; - symbolInformation: SymbolInformation; - diagnostics: Diagnostic[] = []; - - constructor(context: ProcedureDeclarationContext, document: TextDocument, methodContext: SubroutineDeclarationContext) { - super(context, document); - - const identifierContext = methodContext.subroutineName()?.ambiguousIdentifier(); - this.identifier = new IdentifierElement(identifierContext!, document); - this.symbolInformation = SymbolInformation.create( - this.identifier.text, - SymbolKind.Method, - this.range, - this.document.uri - ); - } -} - -export class FunctionDeclarationElement extends ProcedureDeclarationElement implements DeclarationElement, HasSymbolInformation { - identifier: IdentifierElement; - symbolInformation: SymbolInformation; - diagnostics: Diagnostic[] = []; - - constructor(context: ProcedureDeclarationContext, document: TextDocument, methodContext: FunctionDeclarationContext) { - super(context, document); - const identifierContext = methodContext.functionName()!.ambiguousIdentifier()!; - this.identifier = new IdentifierElement(identifierContext, document); - this.symbolInformation = SymbolInformation.create( - this.identifier.text, - SymbolKind.Method, - this.range, - this.document.uri - ); - } -} - -export class PropertyDeclarationElement extends ProcedureDeclarationElement implements HasSymbolInformation { - identifier: IdentifierElement; - diagnostics: Diagnostic[] = []; - symbolInformation: SymbolInformation; - getDeclarations: PropertyGetDeclarationElement[] = []; - letDeclarations: PropertyLetDeclarationElement[] = []; - setDeclarations: PropertyLetDeclarationElement[] = []; - - get countDeclarations(): number { - return this.getDeclarations.length - + this.letDeclarations.length - + this.setDeclarations.length; - } - - constructor(context: ProcedureDeclarationContext, document: TextDocument) { - super(context, document); - const identifier = this.addPropertyDeclaration(context, document); - this.identifier = identifier.value - this.symbolInformation = SymbolInformation.create( - `${identifier.type} ${this.identifier.text}`, - SymbolKind.Property, - this.range, - this.document.uri - ); - } - - evaluateDiagnostics() { - this._evaluateDuplicateDeclarationsDiagnostics(); - return this.diagnostics; - } - - addPropertyDeclaration(context: ProcedureDeclarationContext, document: TextDocument) { - let property: PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement; - let propertyType: string; - switch (true) { - case !!context.propertyGetDeclaration(): - propertyType = 'Get'; - property = new PropertyGetDeclarationElement(context, document, context.propertyGetDeclaration()!); - this.getDeclarations.push(new PropertyGetDeclarationElement(context, document, context.propertyGetDeclaration()!)); - break; - case !!context.propertySetDeclaration()?.LET(): - propertyType = 'Let'; - property = new PropertyLetDeclarationElement(context, document, context.propertySetDeclaration()!); - this.letDeclarations.push(property); - break; - default: - propertyType = 'Set'; - property = new PropertyLetDeclarationElement(context, document, context.propertySetDeclaration()!); - this.setDeclarations.push(new PropertySetDeclarationElement(context, document, context.propertySetDeclaration()!)); - break; - } - return { type: propertyType, value: property.identifier }; - } - - private _evaluateDuplicateDeclarationsDiagnostics(): void { - [this.getDeclarations, this.letDeclarations, this.setDeclarations].forEach(declarations => { - declarations.forEach((declaration, i) => { - if (i > 0) this.diagnostics.push(new DuplicateDeclarationDiagnostic(declaration.identifier.range)); - }); - }); - } -} - -export class NewPropertyDeclarationElement implements HasDiagnosticCapability { - identifier: IdentifierElement; - diagnostics: Diagnostic[] = []; - - getters: PropertyGetDeclarationElement[] = []; - setters: PropertySetDeclarationElement[] = []; - letters: PropertyLetDeclarationElement[] = []; - - constructor(property: PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement) { - this.identifier = property.identifier; - this.addPropertyDeclaration(property); - } - - addPropertyDeclaration(property: PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement) { - if (property instanceof PropertyGetDeclarationElement) { - this.getters.push(property); - } else if (property instanceof PropertySetDeclarationElement) { - this.setters.push(property); - } else { - this.letters.push(property); - } - } - - evaluateDiagnostics(): Diagnostic[] { - [this.getters, this.setters, this.letters].forEach(x => this._evaluateDuplicatesFor(x)); - return this.diagnostics; - } - - private _evaluateDuplicatesFor(props: (PropertyGetDeclarationElement | PropertyLetDeclarationElement | PropertySetDeclarationElement)[]) { - if (props.length <= 1) return; - const duplicateProperties = props.slice(1); - duplicateProperties.forEach(x => this.diagnostics.push(new DuplicateDeclarationDiagnostic(x.range))); - } -} - - -abstract class BaseNewPropertyDeclarationElement extends ScopeElement { - abstract identifier: IdentifierElement; - diagnostics: Diagnostic[] = []; - - get name(): string { - return this.identifier.text; - } - - constructor(context: PropertyGetDeclarationContext | PropertySetDeclarationContext, document: TextDocument) { - super(context, document); - } - - evaluateDiagnostics(): Diagnostic[] { - return this.diagnostics; - } -} - - -export class NewPropertyGetDeclarationElement extends BaseNewPropertyDeclarationElement { - identifier: IdentifierElement; - - constructor(context: PropertyGetDeclarationContext, document: TextDocument) { - super(context, document); - this.identifier = new IdentifierElement(context.functionName()!.ambiguousIdentifier()!, document); - } -} - - -export class NewPropertySetDeclarationElement extends BaseNewPropertyDeclarationElement { - identifier: IdentifierElement; - - constructor(context: PropertySetDeclarationContext, document: TextDocument) { - super(context, document); - this.identifier = new IdentifierElement(context.subroutineName()!.ambiguousIdentifier()!, document); - } -} - - -export class NewPropertyLetDeclarationElement extends NewPropertySetDeclarationElement { - constructor(context: PropertySetDeclarationContext, document: TextDocument) { - super(context, document); - } -} - - -class PropertyGetDeclarationElement extends ProcedureDeclarationElement { - identifier: IdentifierElement; - diagnostics: Diagnostic[] = []; - - constructor(context: ProcedureDeclarationContext, document: TextDocument, getContext: PropertyGetDeclarationContext) { - super(context, document); - this.identifier = new IdentifierElement(getContext.functionName()!.ambiguousIdentifier()!, document); - } -} - -class PropertyLetDeclarationElement extends ProcedureDeclarationElement { - identifier: IdentifierElement; - diagnostics: Diagnostic[] = []; - - constructor(context: ProcedureDeclarationContext, document: TextDocument, setContext: PropertySetDeclarationContext) { - super(context, document); - this.identifier = new IdentifierElement(setContext.subroutineName()!.ambiguousIdentifier()!, document); - } -} - -class PropertySetDeclarationElement extends ProcedureDeclarationElement { - identifier: IdentifierElement; - diagnostics: Diagnostic[] = []; - - constructor(context: ProcedureDeclarationContext, document: TextDocument, setContext: PropertySetDeclarationContext) { - super(context, document); - this.identifier = new IdentifierElement(setContext.subroutineName()!.ambiguousIdentifier()!, document); - } -} - -abstract class BaseEnumDeclarationElement extends ScopeElement implements HasNamedSemanticToken, HasSymbolInformation, NamedSyntaxElement, IdentifiableSyntaxElement { - identifier: IdentifierElement; - tokenModifiers: SemanticTokenModifiers[] = []; - declaredNames: Map = new Map(); - - abstract tokenType: SemanticTokenTypes; - abstract symbolInformation: SymbolInformation; - - get name(): string { - return this.identifier.text; - } - - constructor(context: EnumDeclarationContext | EnumMemberContext, document: TextDocument) { - super(context, document); - this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); - } -} - -export class EnumDeclarationElement extends BaseEnumDeclarationElement implements HasDiagnosticCapability { - // scope: Scope; - diagnostics: Diagnostic[] = []; - tokenType: SemanticTokenTypes; - isDeclaredAfterMethod: boolean; - enumMembers: EnumMemberDeclarationElement[]; - - get symbolInformation(): SymbolInformation { - return SymbolInformationFactory.create( - this, SymbolKind.Enum - ); - } - - constructor(context: EnumDeclarationContext, document: TextDocument, isDeclaredAfterMethod: boolean) { - super(context, document); - // this.scope = scope; - this.tokenType = SemanticTokenTypes.enum; - this.isDeclaredAfterMethod = isDeclaredAfterMethod; - this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); - this.enumMembers = context.enumMemberList().enumElement().map(e => { - const member = e.enumMember()!; - return new EnumMemberDeclarationElement(member, document); - } ) - } - - evaluateDiagnostics() { - if (this.isDeclaredAfterMethod) { - this.diagnostics.push(new ElementOutOfPlaceDiagnostic(this.range, 'Enum declaration')); - } - return this.diagnostics - } -} - -class EnumMemberDeclarationElement extends BaseEnumDeclarationElement { - tokenType: SemanticTokenTypes; - - get symbolInformation(): SymbolInformation { - return SymbolInformationFactory.create( - this, SymbolKind.EnumMember - ); - } - - constructor(context: EnumMemberContext, document: TextDocument) { - super(context, document); - this.tokenType = SemanticTokenTypes.enumMember; - this.identifier = new IdentifierElement(context.untypedName().ambiguousIdentifier()!, document); - } - - evaluateDiagnostics(): Diagnostic[] { - return this.diagnostics - } -} - -abstract class BaseVariableDeclarationStatementElement extends BaseContextSyntaxElement implements DeclarationElement { - tokenType: SemanticTokenTypes; - tokenModifiers: SemanticTokenModifiers[] = []; - diagnostics: Diagnostic[] = []; - readonly symbolKind: SymbolKind; - abstract isPublic: boolean; - abstract identifier: IdentifierElement; - - get name(): string { - return this.identifier.text; - } - - get symbolInformation(): SymbolInformation { - return SymbolInformation.create( - this.identifier.text, - this.symbolKind, - this.range, - this.document.uri - ); - } - - constructor(context: VariableDclContext | ConstItemContext | UdtElementContext, document: TextDocument, tokenType: SemanticTokenTypes, symbolKind: SymbolKind) { - super(context, document); - this.tokenType = tokenType; - this.symbolKind = symbolKind; - } - - // Empty method so that implementation is optional. - evaluateDiagnostics(): Diagnostic[] { - return []; - } - - isPropertyElement(): this is PropertyDeclarationElement { - return false; - } -} - -export class ConstDeclarationElement extends BaseVariableDeclarationStatementElement { - identifier: IdentifierElement; - isPublic: boolean; - - constructor(context: ConstItemContext, document: TextDocument) { - super(context, document, SemanticTokenTypes.variable, SymbolKind.Constant); - const identifierContext = ConstDeclarationElement._getIdentifierContext(context); - this.identifier = new IdentifierElement(identifierContext, document); - - // Public/Global and private are at module level. - // Local cannot have a modifier, i.e., they are private. - // publicConstDeclaration -> moduleConstDeclaration -> constDeclaration -> constItemList -> constItem - // privateConstDeclaration -> moduleConstDeclaration -> constDeclaration -> constItemList -> constItem - // localConstDeclaration -> constDeclaration -> constItemList -> constItem - const constDeclaration = context.parent!.parent!.parent!.parent!; - if(this._isPublicConst(constDeclaration)) { - // TODO: Add logic to get module option private module when no modifiers present. - // *Assuming module level declaration (add this to variable and method too). - this.isPublic = !!constDeclaration.GLOBAL() || !!constDeclaration.PUBLIC(); - } else { - this.isPublic = false; - } - } - - // We're always going to have a context here, and if we don't, we'd want it to break anyway. - private static _getIdentifierContext(context: ConstItemContext): AmbiguousIdentifierContext { - const name = context.typedNameConstItem()?.typedName().ambiguousIdentifier() - ?? context.untypedNameConstItem()?.ambiguousIdentifier(); - return name!; - } - - private _isPublicConst(ctx: ParserRuleContext): ctx is PublicConstDeclarationContext { - return 'PUBLIC' in ctx; - } - - // private _isPrivateConst(ctx: ParserRuleContext): ctx is PrivateConstDeclarationContext { - // return 'PRIVATE' in ctx; - // } -} - -export class TypeDeclarationElement extends ScopeElement implements HasNamedSemanticToken, HasSymbolInformation, NamedSyntaxElement, IdentifiableSyntaxElement { - tokenType: SemanticTokenTypes; - tokenModifiers: SemanticTokenModifiers[] = []; - identifier: IdentifierElement; - symbolKind: SymbolKind; - declaredNames: Map = new Map(); - - constructor(context: UdtDeclarationContext, document: TextDocument) { - super(context, document); - this.symbolKind = SymbolKind.Struct; - this.tokenType = SemanticTokenTypes.struct; - this.identifier = new IdentifierElement(context.untypedName(), document); - context.udtMemberList().udtElement().forEach(member => - this.pushDeclaredName(new TypeMemberDeclarationElement(member, document)) - ); - } - - get name(): string { return this.identifier.text; } - get symbolInformation(): SymbolInformation { - return SymbolInformationFactory.create( - this as NamedSyntaxElement, this.symbolKind - ); - } - - pushDeclaredName(e: TypeMemberDeclarationElement) { - if (!this.declaredNames.has(e.identifier.text)) { - this.declaredNames.set(e.identifier.text, [e]); - } else { - this.declaredNames.get(e.identifier.text)?.push(e); - } - } - - evaluateDiagnostics(): Diagnostic[] { - return []; - } -} - -export class TypeMemberDeclarationElement extends BaseVariableDeclarationStatementElement { - isPublic = false; // temp fix for implementation - TODO: don't inherit base variable. - identifier: IdentifierElement; - - get name(): string { - return this.identifier.text; - } - - constructor(context: UdtElementContext, document: TextDocument) { - super(context, document, SemanticTokenTypes.property, SymbolKind.Property); - const identifierContext = context.udtMember()?.untypedNameMemberDcl()?.ambiguousIdentifier() ?? context.udtMember()?.reservedNameMemberDcl()?.reservedMemberName(); - this.identifier = new IdentifierElement(identifierContext!, document); - } -} - -// export class VariableDeclarationsElement extends BaseVariableDeclarationStatementElement { -// declarations: VariableDeclarationElement[] = []; - -// constructor(context: VariableStmtContext, document: TextDocument) { -// super(context, document); -// context.variableListStmt().variableSubStmt().forEach((element) => -// this.declarations.push(new VariableDeclarationElement( -// element, document -// )) -// ); -// } -// } - -// class VariableDeclarationElement extends BaseContextSyntaxElement implements HasSymbolInformation { -// identifier: IdentifierElement; -// asType: VariableType; -// arrayBounds?: ArrayBounds; - -// constructor(context: ConstSubStmtContext | VariableSubStmtContext, document: TextDocument) { -// super(context, document); -// this.asType = new VariableType(context.asTypeClause(), document); -// this.arrayBounds = ArrayBounds.create(context); -// this.identifier = new IdentifierElement(context.ambiguousIdentifier(), document); -// } - -// get name(): string { return this.identifier.text; } -// get symbolInformation(): SymbolInformation { -// return SymbolInformationFactory.create( -// this, this.asType.symbolKind -// ); -// } -// } - -// class VariableType extends BaseSyntaxElement { -// typeName: string; -// symbolKind: SymbolKind; - -// constructor(context: AsTypeClauseContext | undefined, document: TextDocument, isArray?: boolean) { -// super(context, document); -// this.symbolKind = isArray ? SymbolKind.Array : SymbolKind.Variable; - -// // Needs more ternery. -// const type = context?.type_()?.baseType() ?? context?.type_()?.complexType(); -// this.typeName = type?.text ?? type?.text ?? 'Variant'; -// this.symbolKind = type ? type.toSymbolKind() : SymbolKind.Variable; -// } -// } - -// class ArrayBounds { -// dimensions: { lower: number, upper: number }[] = []; - -// constructor(subStmt: VariableSubStmtContext) { -// subStmt.subscripts()?.subscript_().forEach((x) => { -// const vals = x.valueStmt(); -// this.dimensions.push({ -// lower: vals.length === 1 ? 0 : +vals[0].text, -// upper: vals.length === 1 ? +vals[0].text : +vals[1].text -// }); -// }); -// } - -// /** -// * Creates an ArrayBounds if the context is a variable and an array. -// * @param subStmt a subStmt context for a variable or a constant. -// * @returns A new array bounds if the context is an array variable. -// */ -// static create(subStmt: VariableSubStmtContext | ConstSubStmtContext) { -// const hasLparenMethod = (x: any): x is VariableSubStmtContext => 'LPAREN' in x; -// if (hasLparenMethod(subStmt) && subStmt.LPAREN()) { -// return new ArrayBounds(subStmt); -// } -// } -// } \ No newline at end of file diff --git a/server/src/project/elements/module.ts b/server/src/project/elements/module.ts index a203857..ca40024 100644 --- a/server/src/project/elements/module.ts +++ b/server/src/project/elements/module.ts @@ -1,72 +1,92 @@ -import { Diagnostic, Range, SymbolInformation, SymbolKind } from 'vscode-languageserver'; +// Core import { TextDocument } from 'vscode-languageserver-textdocument'; +import { Diagnostic, Range, SymbolKind } from 'vscode-languageserver'; +// Antlr import { ParserRuleContext } from 'antlr4ng'; -import { ClassModuleContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext } from '../../antlr/out/vbaParser'; - -import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSymbolInformation } from './base'; -import { ScopeElement } from './special'; - -import { SymbolInformationFactory } from '../../capabilities/symbolInformation'; +import { + ClassModuleCodeElementContext, + ClassModuleContext, + ClassModuleHeaderContext, + IgnoredClassAttrContext, + IgnoredProceduralAttrContext, + ProceduralModuleCodeElementContext, + ProceduralModuleContext, + ProceduralModuleHeaderContext +} from '../../antlr/out/vbaParser'; + +// Project +import { BaseContextSyntaxElement, BaseIdentifyableSyntaxElement, HasDiagnosticCapability } from './base'; +import { DiagnosticCapability, FoldingRangeCapability, IdentifierCapability, SymbolInformationCapability } from '../../capabilities/capabilities'; import { DuplicateAttributeDiagnostic, IgnoredAttributeDiagnostic, MissingAttributeDiagnostic, MissingOptionExplicitDiagnostic } from '../../capabilities/diagnostics'; -import '../../extensions/stringExtensions'; -import { contextToRange } from '../../utils/helpers'; interface DocumentSettings { doWarnOptionExplicitMissing: boolean; } -abstract class BaseModuleElement extends ScopeElement implements HasSymbolInformation, HasDiagnosticCapability { - protected abstract _name: string; - symbolKind: SymbolKind; - diagnostics: Diagnostic[] = []; - context: ProceduralModuleContext | ClassModuleContext; + +abstract class BaseModuleElement extends BaseIdentifyableSyntaxElement { + abstract attrubutes: ParserRuleContext[]; + abstract diagnosticCapability: DiagnosticCapability; + abstract hasOptionExplicit: boolean; + settings: DocumentSettings; - isPublic = true; + foldingRangeCapability: FoldingRangeCapability; + symbolInformationCapability: SymbolInformationCapability; - constructor(context: ProceduralModuleContext | ClassModuleContext, document: TextDocument, symbolKind: SymbolKind, documentSettings: DocumentSettings) { - super(context, document); - this.context = context; - this.symbolKind = symbolKind; + constructor(ctx: T, doc: TextDocument, documentSettings: DocumentSettings, symbolKind: SymbolKind) { + super(ctx, doc); this.settings = documentSettings; + this.foldingRangeCapability = new FoldingRangeCapability(this); + this.symbolInformationCapability = new SymbolInformationCapability(this, symbolKind); } - get name(): string { - return this._name; + // Helpers + protected addMissingAttributesDiagnostics(diagnostics: Diagnostic[]): void { + if (!!this.identifierCapability.nameContext) return; + diagnostics.push(new MissingAttributeDiagnostic( + Range.create(this.context.range.start, this.context.range.start), + 'VB_NAME' + )); } - get symbolInformation(): SymbolInformation { - return SymbolInformationFactory.create( - this, this.symbolKind + protected addDuplicateAttributeDiagnostics(diagnostics: Diagnostic[]): void { + this.duplicateAttributes(this.attrubutes).forEach(attr => + diagnostics.push(new DuplicateAttributeDiagnostic( + attr.toRange(this.context.document), + getAttributeName(attr) + )) ); } - abstract evaluateDiagnostics(): Diagnostic[]; - - protected get _hasOptionExplicit(): boolean { - const getCodeElements = () => { - if (this._isClassModule(this.context)) { - return this.context.classModuleBody().classModuleCode().classModuleCodeElement() - } - return this.context.proceduralModuleBody().proceduralModuleCode().proceduralModuleCodeElement(); - } - const codeElements = getCodeElements() - if (!codeElements) { - return false; + protected addOptionExplicitMissingDiagnostic(diagnostics: Diagnostic[], header: ClassModuleHeaderContext | ProceduralModuleHeaderContext): void { + if (this.settings.doWarnOptionExplicitMissing && !this.hasOptionExplicit) { + const startLine = header.stop?.line ?? 0 + 1; + diagnostics.push(new MissingOptionExplicitDiagnostic( + Range.create(startLine, 1, startLine, 1) + )); } + } - for (const declaration of codeElements) { - const element = declaration.commonModuleCodeElement(); - if (element && element.commonOptionDirective()?.optionExplicitDirective()) { - return true; - } - } + protected resolveConfiguration(diagnostics: Diagnostic[], header: ClassModuleHeaderContext | ProceduralModuleHeaderContext): void { + this.addMissingAttributesDiagnostics(diagnostics); + this.addDuplicateAttributeDiagnostics(diagnostics); + this.addOptionExplicitMissingDiagnostic(diagnostics, header); + } + protected evaluateHasOptionExplicit(codeElements: (ProceduralModuleCodeElementContext | ClassModuleCodeElementContext)[]): boolean { + for (const codeElement of codeElements) { + const isOptionExplicitDirective = codeElement + .commonModuleCodeElement() + ?.commonOptionDirective() + ?.optionExplicitDirective(); + if (!!isOptionExplicitDirective) return true; + } return false; } - protected _duplicateAttributes(attrs: ParserRuleContext[]) { + private duplicateAttributes(attrs: ParserRuleContext[]) { const catalogue = new Map(); const result: ParserRuleContext[] = []; attrs.forEach(attr => { @@ -79,213 +99,103 @@ abstract class BaseModuleElement extends ScopeElement implements HasSymbolInform }) return result; } - - private _isClassModule(context: ProceduralModuleContext | ClassModuleContext): context is ClassModuleContext { - return 'classModuleHeader' in context; - } } -export class ModuleElement extends BaseModuleElement { - context: ProceduralModuleContext; - attrubutes: ParserRuleContext[]; - protected _name: string; - constructor(context: ProceduralModuleContext, document: TextDocument, documentSettings: DocumentSettings) { - super(context, document, SymbolKind.File, documentSettings); - this.context = context; - this.attrubutes = context.proceduralModuleHeader().proceduralModuleAttr(); - this._name = this._getName(context); - } +export class ModuleElement extends BaseModuleElement { + diagnosticCapability: DiagnosticCapability; + identifierCapability: IdentifierCapability; - evaluateDiagnostics() { - // Diagnose duplicate attributes. - this._duplicateAttributes(this.attrubutes).forEach(attr => - this.diagnostics.push(new DuplicateAttributeDiagnostic( - contextToRange(this.document, attr)!, - getAttributeName(attr) - )) + attrubutes: ParserRuleContext[]; + hasOptionExplicit: boolean; + + constructor(ctx: ProceduralModuleContext, doc: TextDocument, documentSettings: DocumentSettings) { + super(ctx, doc, documentSettings, SymbolKind.File); + this.attrubutes = ctx.proceduralModuleHeader().proceduralModuleAttr(); + this.diagnosticCapability = new DiagnosticCapability(this); + + this.hasOptionExplicit = this.evaluateHasOptionExplicit(ctx + .proceduralModuleBody() + .proceduralModuleCode() + .proceduralModuleCodeElement()); + + this.identifierCapability = new IdentifierCapability({ + element: this, + formatName: (x: string) => x.stripQuotes(), + defaultName: 'Unknown Module', + defaultRange: () => Range.create(this.context.range.start, this.context.range.start), + getNameContext: () => ctx + .proceduralModuleHeader() + .proceduralModuleAttr() + .map(x => x.nameAttr()) + .filter(x => !!x)[0] + ?.STRINGLITERAL() + }); + + this.resolveConfiguration( + this.diagnosticCapability.diagnostics, + this.context.rule.proceduralModuleHeader() ); - - // Diagnose option explicit is missing. - if (this.settings.doWarnOptionExplicitMissing && !this._hasOptionExplicit) { - const header = this.context.proceduralModuleHeader(); - const startLine = header.stop?.line ?? 0 + 1; - this.diagnostics.push(new MissingOptionExplicitDiagnostic( - Range.create( - startLine, 1, - startLine, 1 - ) - )); - } - - return this.diagnostics; } +} - private _getName(context: ProceduralModuleContext) { - const attributes = context.proceduralModuleHeader().proceduralModuleAttr(); - const nameAttributes = attributes.map(x => x.nameAttr()).filter(x => !!x) - - // If we don't have any name attributes... - if (nameAttributes.length === 0) { - this.diagnostics.push(new MissingAttributeDiagnostic( - Range.create(this.range.start, this.range.start), - 'VB_NAME' - )); - return 'Unknown Module'; - } - // Get the name from the name attribute. - const name = nameAttributes[0].STRINGLITERAL().getText(); - return name.stripQuotes(); - } -} +export class ClassElement extends BaseModuleElement { + diagnosticCapability: DiagnosticCapability; + identifierCapability: IdentifierCapability; -export class ClassElement extends BaseModuleElement { - context: ClassModuleContext; attrubutes: ParserRuleContext[]; - protected _name: string; + hasOptionExplicit: boolean; - constructor(context: ClassModuleContext, document: TextDocument, documentSettings: DocumentSettings) { - super(context, document, SymbolKind.Class, documentSettings); - this.context = context; + constructor(ctx: ClassModuleContext, doc: TextDocument, documentSettings: DocumentSettings) { + super(ctx, doc, documentSettings, SymbolKind.File); this.attrubutes = [ - context.classModuleHeader().nameAttr(), - context.classModuleHeader().classAttr(), - context.classModuleHeader().ignoredClassAttr() + ctx.classModuleHeader().nameAttr(), + ctx.classModuleHeader().classAttr(), + ctx.classModuleHeader().ignoredClassAttr() ].flat(); - this._name = this._getName(context); - } - - evaluateDiagnostics() { - // Diagnose duplicate attributes. - this._duplicateAttributes(this.attrubutes).forEach(attr => - this.diagnostics.push(new DuplicateAttributeDiagnostic( - attr.toRange(this.document), - getAttributeName(attr) - )) + this.diagnosticCapability = new DiagnosticCapability(this); + + this.hasOptionExplicit = this.evaluateHasOptionExplicit(ctx + .classModuleBody() + .classModuleCode() + .classModuleCodeElement()); + + this.identifierCapability = new IdentifierCapability({ + element: this, + formatName: (x: string) => x.stripQuotes(), + defaultName: 'Unknown Class', + defaultRange: () => Range.create(this.context.range.start, this.context.range.start), + getNameContext: () => ctx + .classModuleHeader() + .nameAttr()[0] + .STRINGLITERAL() + }); + + this.resolveConfiguration( + this.diagnosticCapability.diagnostics, + this.context.rule.classModuleHeader() ); - - // Diagnose option explicit is missing. - if (this.settings.doWarnOptionExplicitMissing && !this._hasOptionExplicit) { - const header = this.context.classModuleHeader(); - const startLine = header.stop?.line ?? 0 + 1; - this.diagnostics.push(new MissingOptionExplicitDiagnostic( - Range.create( - startLine, 1, - startLine, 1 - ) - )); - } - return this.diagnostics - } - - private _getName(context: ClassModuleContext) { - const nameAttributes = context.classModuleHeader().nameAttr(); - - // TODO: Check if other attributes are required and validate them. - if (nameAttributes.length === 0) { - this.diagnostics.push(new MissingAttributeDiagnostic( - Range.create(this.range.start, this.range.start), - 'VB_NAME' - )); - return 'Unknown Class'; - } - - const nameAttribute = nameAttributes[0]; - return nameAttribute.STRINGLITERAL().getText().stripQuotes(); } } -export class IgnoredAttributeElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { - diagnostics: Diagnostic[] = []; - constructor(context: IgnoredClassAttrContext | IgnoredProceduralAttrContext, document: TextDocument) { - super(context, document); - } +export class ModuleIgnoredAttributeElement extends BaseContextSyntaxElement implements HasDiagnosticCapability { + diagnosticCapability: DiagnosticCapability; - evaluateDiagnostics() { - this.diagnostics.push( - new IgnoredAttributeDiagnostic( - this.range, - this.context.getText().split(' ')[1] - ) - ); - return this.diagnostics + constructor(ctx: IgnoredClassAttrContext | IgnoredProceduralAttrContext, doc: TextDocument) { + super(ctx, doc); + this.diagnosticCapability = new DiagnosticCapability(this, () => { + this.diagnosticCapability.diagnostics.push(new IgnoredAttributeDiagnostic( + this.context.range, this.context.text.split(' ')[1] + )); + return this.diagnosticCapability.diagnostics; + }) } - } + +// TODO: Move to helpers. function getAttributeName(e: ParserRuleContext): string { return e.getText().split(' ')[1] -} - - -// export class ModuleElement2 extends BaseContextSyntaxElement implements HasSymbolInformation, HasAttribute, HasDiagnosticCapability { -// private _hasName = false; -// private _name: string; -// symbolKind: SymbolKind; -// diagnostics: Diagnostic[] = []; - -// constructor(context: ModuleContext, document: TextDocument, symbolKind: SymbolKind) { -// super(context, document); -// this._name = "Unknown Module"; -// this.symbolKind = symbolKind; -// } - -// get name(): string { -// return this._name; -// } - -// get symbolInformation(): SymbolInformation { -// return SymbolInformationFactory.create( -// this, this.symbolKind -// ); -// } - -// evaluateDiagnostics(): void { -// const optionExplicitDiagnotic = this._getOptionExplicitDiagnostic(); -// if (optionExplicitDiagnotic) { -// this.diagnostics.push(optionExplicitDiagnotic); -// } -// } - -// private _getOptionExplicitDiagnostic(): Diagnostic | undefined { -// let optionExplicitFound = false; -// const context = this.context as ModuleContext; -// const declarations = context.moduleHeader().moduleDeclarations()?.moduleDeclarationsElement(); - -// if (declarations) { -// for (const declaration of declarations) { -// if ((declaration.moduleOption()?.text ?? '') === 'Option Explicit') { -// optionExplicitFound = true; -// break; -// } -// } -// } - -// return optionExplicitFound ? undefined : new MissingOptionExplicitDiagnostic( -// (new ModuelHeaderElement(context.moduleHeader(), this.document)).range -// ); -// } - -// processAttribute(context: AttributeStmtContext): void { -// if (this._hasName) { -// return; -// } - -// const text = context.text; -// if (text.startsWith("Attribute VB_Name = ")) { -// const unquote = (x: string): string => -// x.replace(/^"+|"+$/g, ''); - -// this._name = unquote(text.split("= ")[1]); -// this._hasName = true; -// } -// } -// } - -// class ModuelHeaderElement extends BaseContextSyntaxElement { -// constructor(context: ModuleHeaderContext, document: TextDocument) { -// super(context, document); -// } -// } \ No newline at end of file +} \ No newline at end of file diff --git a/server/src/project/elements/procedure.ts b/server/src/project/elements/procedure.ts new file mode 100644 index 0000000..074c560 --- /dev/null +++ b/server/src/project/elements/procedure.ts @@ -0,0 +1,123 @@ +//Core +import { SymbolKind } from 'vscode-languageserver'; +import { TextDocument } from 'vscode-languageserver-textdocument'; + +// Antlr +import { ParserRuleContext } from 'antlr4ng'; +import { + AmbiguousIdentifierContext, + FunctionDeclarationContext, + PropertyGetDeclarationContext, + PropertySetDeclarationContext, + SubroutineDeclarationContext +} from '../../antlr/out/vbaParser'; + +// Project +import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSymbolInformationCapability } from './base'; +import { DiagnosticCapability, IdentifierCapability, SymbolInformationCapability } from '../../capabilities/capabilities'; + + +abstract class BaseProcedureElement extends BaseContextSyntaxElement implements HasDiagnosticCapability, HasSymbolInformationCapability { + diagnosticCapability: DiagnosticCapability; + abstract identifierCapability: IdentifierCapability; + abstract symbolInformationCapability: SymbolInformationCapability; + + constructor(ctx: T, doc: TextDocument) { + super(ctx, doc); + this.diagnosticCapability = new DiagnosticCapability(this); + } +} + + +export class SubDeclarationElement extends BaseProcedureElement { + identifierCapability: IdentifierCapability; + symbolInformationCapability: SymbolInformationCapability; + + constructor(ctx: SubroutineDeclarationContext, doc: TextDocument) { + super(ctx, doc); + this.identifierCapability = new IdentifierCapability({ + element: this, + getNameContext: () => ctx.subroutineName()?.ambiguousIdentifier(), + }); + this.symbolInformationCapability = new SymbolInformationCapability(this, SymbolKind.Method); + } +} + + +export class FunctionDeclarationElement extends BaseProcedureElement { + identifierCapability: IdentifierCapability; + symbolInformationCapability: SymbolInformationCapability; + + constructor(ctx: FunctionDeclarationContext, doc: TextDocument) { + super(ctx, doc); + this.identifierCapability = new IdentifierCapability({ + element: this, + getNameContext: () => ctx.functionName()?.ambiguousIdentifier(), + }); + this.symbolInformationCapability = new SymbolInformationCapability(this, SymbolKind.Method); + } +} + + +export class PropertyDeclarationElement { + getters: PropertyGetDeclarationElement[] = []; + setters: PropertySetDeclarationElement[] = []; + letters: PropertyLetDeclarationElement[] = []; + + addPropertyDeclaration(property: PropertyGetDeclarationElement | PropertySetDeclarationElement | PropertyLetDeclarationElement) { + if (property instanceof PropertyGetDeclarationElement) { + this.getters.push(property); + } else if (property instanceof PropertySetDeclarationElement) { + this.setters.push(property); + } else { + this.letters.push(property); + } + } +} + + +/** + * A base class for property Get, Set, Let types to inherit from. + */ +abstract class BasePropertyDeclarationElement extends BaseProcedureElement { + identifierCapability: IdentifierCapability; + symbolInformationCapability: SymbolInformationCapability; + + private propertyType: string; + private nameContext?: AmbiguousIdentifierContext; + + get propertyName(): string { return `${this.identifierCapability.name.split(' ')[1]}`; } + + constructor(ctx: T, doc: TextDocument, propertyType: string, nameCtx?: AmbiguousIdentifierContext) { + super(ctx, doc); + this.nameContext = nameCtx; + this.propertyType = propertyType; + this.symbolInformationCapability = new SymbolInformationCapability(this, SymbolKind.Property); + this.identifierCapability = new IdentifierCapability({ + element: this, + getNameContext: () => this.nameContext, + formatName: (x: string) => `${this.propertyType} ${x}` + }); + } +} + + +export class PropertyGetDeclarationElement extends BasePropertyDeclarationElement { + constructor(ctx: PropertyGetDeclarationContext, doc: TextDocument) { + super(ctx, doc, 'Get', ctx.functionName()?.ambiguousIdentifier() ?? undefined); + } +} + + +export class PropertySetDeclarationElement extends BasePropertyDeclarationElement { + constructor(ctx: PropertySetDeclarationContext, doc: TextDocument) { + super(ctx, doc, 'Set', ctx.subroutineName()?.ambiguousIdentifier() ?? undefined); + } +} + + +export class PropertyLetDeclarationElement extends BasePropertyDeclarationElement { + constructor(ctx: PropertySetDeclarationContext, doc: TextDocument) { + super(ctx, doc, 'Let', ctx.subroutineName()?.ambiguousIdentifier() ?? undefined); + } +} \ No newline at end of file diff --git a/server/src/project/elements/special.ts b/server/src/project/elements/special.ts deleted file mode 100644 index a58ba38..0000000 --- a/server/src/project/elements/special.ts +++ /dev/null @@ -1,175 +0,0 @@ -import * as ts from "typescript"; -import { ParserRuleContext } from 'antlr4ng'; -import { FoldingRangeKind } from '../../capabilities/folding'; -import { BaseContextSyntaxElement, DeclarationElement, FoldingRangeElement, HasSemanticToken, IdentifiableSyntaxElement, NamedSyntaxElement } from './base'; -import { TextDocument } from 'vscode-languageserver-textdocument'; -import { IdentifierElement, PropertyDeclarationElement } from './memory'; -import { Diagnostic, integer, Range, SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver'; -import { CompilerConditionalBlockContext, CompilerConditionalStatementContext, CompilerDefaultBlockContext, CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; - - -// TODO: Reorganise this stuff as properties of more generic classes. -// Whether the element is foldable or not is complicating inheritence. -export class FoldableElement extends BaseContextSyntaxElement implements FoldingRangeElement { - range!: Range; - foldingRangeKind?: FoldingRangeKind; - - constructor(ctx: ParserRuleContext, doc: TextDocument, foldingRangeKind?: FoldingRangeKind) { - super(ctx, doc); - this.foldingRangeKind = foldingRangeKind; - } -} - -export abstract class ScopeElement extends FoldableElement implements DeclarationElement { - isPublic = false; - diagnostics: Diagnostic[] = []; - - isPropertyElement(): this is PropertyDeclarationElement { - return 'getDeclarations' in this; - } - - constructor(ctx: ParserRuleContext, doc: TextDocument, foldingRangeKind?: FoldingRangeKind) { - super(ctx, doc, foldingRangeKind); - } - - abstract evaluateDiagnostics(): Diagnostic[]; - abstract get name(): string; -} - -export abstract class IdentifiableScopeElement extends BaseContextSyntaxElement implements DeclarationElement, IdentifiableSyntaxElement { - isPublic = false; - diagnostics: Diagnostic[] = []; - abstract identifier: IdentifierElement; - - constructor(ctx: ParserRuleContext, doc: TextDocument) { - super(ctx, doc); - } - - isPropertyElement(): this is PropertyDeclarationElement { - return 'getDeclarations' in this; - } - abstract evaluateDiagnostics(): Diagnostic[]; - get name(): string { - return this.identifier.text; - } -} - -export class CompilerIfBlockElement extends BaseContextSyntaxElement { - readonly inactiveChildren: InactiveConstantBlockElement[] = []; - readonly options: {environment: { os: string, version: string }} - readonly blocks: CompilerConditionalBlockContext[] = []; - readonly defaultBlock: CompilerDefaultBlockContext | null; - - constructor(ctx: CompilerIfBlockContext, doc: TextDocument, opts: {environment: { os: string, version: string }}) { - super(ctx, doc); - this.options = opts; - this.blocks = ctx.compilerConditionalBlock(); - this.defaultBlock = ctx.compilerDefaultBlock(); - - // Add the inactive condition blocks. - let hasTrueBlock = false; - for (let i = 0; i < this.blocks.length; i++) { - const element = this.blocks[i]; - const elementIsTrue = !hasTrueBlock && this.getConditionResult(element.compilerConditionalStatement()); - - if (elementIsTrue) { - hasTrueBlock = true; - continue; - } - - this.inactiveChildren.push(new InactiveConstantBlockElement(element, doc)); - } - // Add the default one if we have one and a condition evaluated true. - if (hasTrueBlock && !!this.defaultBlock) { - this.inactiveChildren.push(new InactiveConstantBlockElement(this.defaultBlock, doc)); - } - } - - getConditionResult(ctx: CompilerConditionalStatementContext): boolean { - const statement = ctx.compilerIfStatement() ?? ctx.compilerElseIfStatement()!; - const expression = statement.booleanExpression(); - - let expressionText = expression.getText(); - const boolText = (opt: string) => { - const isOs = this.options.environment.os == opt; - const isVer = this.options.environment.version == opt; - return isOs || isVer ? 'true' : 'false'; - } - - // Configure from options. - const constants = ['VBA6', 'Vba7', 'MAC', 'WIN16', 'WIN32', 'Win64'] - const replacements = new Map(constants.map(x => [x, boolText(x)])); - replacements.set('Or', '||'); - replacements.set('And', '&&'); - replacements.set('Not ', '!'); - - // Perform replacements. - replacements.forEach((v, k) => { - const regexp = RegExp(`${k}`, 'i') - if (regexp.test(expressionText)) { - expressionText = expressionText.replace(regexp, v); - } - }); - - // Evaluate the expression and return the result. - const result = eval(ts.transpile(expressionText)); - if (!(typeof result === "boolean")) { - throw new Error("Expected boolean result."); - } - return result; - } -} - -class InactiveConstantBlockElement extends BaseContextSyntaxElement { - tokenType: SemanticTokenTypes; - tokenModifiers: SemanticTokenModifiers[] = []; - lines: InactiveLineElement[]; - - constructor(ctx: CompilerConditionalBlockContext | CompilerDefaultBlockContext, doc: TextDocument) { - super(ctx, doc) - this.tokenType = SemanticTokenTypes.comment; - this.lines = this._createLines(); - } - - private _createLines(): InactiveLineElement[] { - const inactiveLines = this.text.split('\r\n'); - let stopIndex = (this.context?.start?.start ?? 0); - - // Generate the individual ranges. - const ranges: Range[] = []; - for (const line of inactiveLines) { - // Ignore blank lines. - if (line.length === 0) { - continue; - } - - // Create a range from the segment. - const startIndex = stopIndex; - stopIndex += line.length + 2; - ranges.push(Range.create( - this.document.positionAt(startIndex), - this.document.positionAt(stopIndex) - )); - } - - // Return InactiveLineElement objects. - return ranges.map(range => new InactiveLineElement(this.context, this.document, range)) - } -} - -export class InactiveLineElement extends BaseContextSyntaxElement implements HasSemanticToken { - tokenType: SemanticTokenTypes; - tokenModifiers: SemanticTokenModifiers[] = []; - - get text(): string { - return this.document.getText(this.range); - } - - constructor(ctx: ParserRuleContext, doc: TextDocument, range?: Range) { - super(ctx, doc) - this.tokenType = SemanticTokenTypes.comment; - if (range) { - this.range = range; - } - } -} \ No newline at end of file diff --git a/server/src/project/elements/typing.ts b/server/src/project/elements/typing.ts new file mode 100644 index 0000000..5b9d98d --- /dev/null +++ b/server/src/project/elements/typing.ts @@ -0,0 +1,152 @@ +// Core +import { TextDocument } from 'vscode-languageserver-textdocument'; +import { SemanticTokenModifiers, SemanticTokenTypes, SymbolKind } from 'vscode-languageserver'; + +// Antlr +import { ParserRuleContext } from 'antlr4ng'; +import { ConstItemContext, + EnumDeclarationContext, + GlobalVariableDeclarationContext, + PrivateConstDeclarationContext, + PrivateTypeDeclarationContext, + PrivateVariableDeclarationContext, + PublicConstDeclarationContext, + PublicTypeDeclarationContext, + PublicVariableDeclarationContext, + TypeSuffixContext, + VariableDclContext, + WitheventsVariableDclContext +} from '../../antlr/out/vbaParser'; + +// Project +import { ElementOutOfPlaceDiagnostic, LegacyFunctionalityDiagnostic } from '../../capabilities/diagnostics'; +import { BaseContextSyntaxElement, HasDiagnosticCapability, HasSemanticTokenCapability, HasSymbolInformationCapability } from './base'; +import { DiagnosticCapability, IdentifierCapability, SemanticTokenCapability, SymbolInformationCapability } from '../../capabilities/capabilities'; + + +abstract class BaseTypeDeclarationElement extends BaseContextSyntaxElement implements HasDiagnosticCapability, HasSymbolInformationCapability, HasSemanticTokenCapability { + diagnosticCapability: DiagnosticCapability; + abstract identifierCapability: IdentifierCapability; + symbolInformationCapability: SymbolInformationCapability; + semanticTokenCapability: SemanticTokenCapability; + + // ToDo: Implement callables. + + constructor(ctx: T, doc: TextDocument, symbolKind: SymbolKind, tokenType: SemanticTokenTypes, tokenModifiers?: SemanticTokenModifiers[]) { + super(ctx, doc); + this.diagnosticCapability = new DiagnosticCapability(this); + this.symbolInformationCapability = new SymbolInformationCapability(this, symbolKind); + this.semanticTokenCapability = new SemanticTokenCapability(this, tokenType, tokenModifiers ?? []); + } +} + + +export class EnumDeclarationElement extends BaseTypeDeclarationElement { + identifierCapability: IdentifierCapability; + + constructor(ctx: EnumDeclarationContext, doc: TextDocument, isAfterProcedure: boolean) { + super(ctx, doc, SymbolKind.Enum, SemanticTokenTypes.enum); + this.identifierCapability = new IdentifierCapability({ + element: this, + getNameContext: () => ctx.untypedName().ambiguousIdentifier() + }); + if (isAfterProcedure) this.diagnosticCapability.diagnostics.push( + new ElementOutOfPlaceDiagnostic(this.context.range, "Enum declaration") + ); + } +} + + +export class TypeDeclarationElement extends BaseTypeDeclarationElement { + identifierCapability: IdentifierCapability; + + private _isPublic: boolean + get isPublic(): boolean { return this._isPublic; } + + constructor(ctx: PublicTypeDeclarationContext | PrivateTypeDeclarationContext, doc: TextDocument, isPublic: boolean) { + super(ctx, doc, SymbolKind.Struct, SemanticTokenTypes.struct); + this._isPublic = isPublic; + this.identifierCapability = new IdentifierCapability({ + element: this, + getNameContext: () => ctx.udtDeclaration().untypedName() + }); + this.symbolInformationCapability = new SymbolInformationCapability(this, SymbolKind.Struct); + } +} + + +type CombinedVariableContext = + PublicVariableDeclarationContext + | GlobalVariableDeclarationContext + | PrivateVariableDeclarationContext + | PublicConstDeclarationContext + | PrivateConstDeclarationContext + +export class DeclarationStatementElement extends BaseContextSyntaxElement { + private _isPublic: boolean; + private isConstant: boolean; + + get isPublic(): boolean { return this._isPublic; } + get declarations() { + return this.context.rule.declarationContexts().map(x => new VariableDeclarationElement( + x, this.context.document, this.isPublic, this.isConstant + )); + } + + constructor(ctx: T, doc: TextDocument, isConstant: boolean, isPublic: boolean) { + super(ctx, doc); + this._isPublic = isPublic; + this.isConstant = isConstant; + } + + static create(ctx: CombinedVariableContext, doc: TextDocument) { + const isPublicOrGlobal = (o: any): boolean => 'PUBLIC' in o || 'GLOBAL' in o; + const isConstantContext = (o: any): o is PublicConstDeclarationContext | PrivateConstDeclarationContext => 'moduleConstDeclaration' in o; + return new DeclarationStatementElement(ctx, doc, isConstantContext(ctx), isPublicOrGlobal(ctx)); + } +} + + +export class VariableDeclarationElement extends BaseContextSyntaxElement implements HasDiagnosticCapability, HasSymbolInformationCapability, HasSemanticTokenCapability { + identifierCapability: IdentifierCapability; + diagnosticCapability: DiagnosticCapability; + symbolInformationCapability: SymbolInformationCapability; + semanticTokenCapability: SemanticTokenCapability; + + private _isPublic: boolean; + get isPublic(): boolean { return this._isPublic; } + + constructor(ctx: VariableDclContext | WitheventsVariableDclContext | ConstItemContext, doc: TextDocument, isPublic: boolean, isConst: boolean) { + super(ctx, doc); + this._isPublic = isPublic; + this.diagnosticCapability = new DiagnosticCapability(this); + this.symbolInformationCapability = new SymbolInformationCapability(this, ctx.toSymbolKind()); + this.semanticTokenCapability = new SemanticTokenCapability(this, SemanticTokenTypes.variable, isConst ? [SemanticTokenModifiers.declaration, SemanticTokenModifiers.readonly] : [SemanticTokenModifiers.declaration]); + this.identifierCapability = new IdentifierCapability({element: this, getNameContext: () => ctx.ambiguousIdentifier()}); + } +} + + +export class TypeSuffixElement extends BaseContextSyntaxElement implements HasDiagnosticCapability, HasSemanticTokenCapability { + diagnosticCapability: DiagnosticCapability; + semanticTokenCapability: SemanticTokenCapability; + + constructor(ctx: TypeSuffixContext, doc: TextDocument) { + super(ctx, doc); + this.semanticTokenCapability = new SemanticTokenCapability(this, SemanticTokenTypes.class, []); + this.diagnosticCapability = new DiagnosticCapability(this, + () => this.evaluateDiagnostics() + ); + } + + private evaluateDiagnostics = () => { + // TODO: Make this diagnostic optional. + this.diagnosticCapability.diagnostics.push( + new LegacyFunctionalityDiagnostic( + this.context.range, + 'Type hints' + ) + ); + return this.diagnosticCapability.diagnostics; + } +} \ No newline at end of file diff --git a/server/src/project/parser/vbaAntlr.ts b/server/src/project/parser/vbaAntlr.ts index 11eeea5..1e5f95c 100644 --- a/server/src/project/parser/vbaAntlr.ts +++ b/server/src/project/parser/vbaAntlr.ts @@ -1,10 +1,12 @@ -import { vbaLexer } from '../../antlr/out/vbaLexer'; -import { vbaParser } from '../../antlr/out/vbaParser'; +// Antlr import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DefaultErrorStrategy, Parser, RecognitionException } from 'antlr4ng'; +import { vbaLexer } from '../../antlr/out/vbaLexer'; +import { vbaParser } from '../../antlr/out/vbaParser'; import { vbapreLexer } from '../../antlr/out/vbapreLexer'; import { vbapreParser } from '../../antlr/out/vbapreParser'; + export class VbaLexer extends vbaLexer { constructor(input: CharStream) { super(input); @@ -15,6 +17,7 @@ export class VbaLexer extends vbaLexer { } } + export class VbaParser extends vbaParser { constructor(input: TokenStream) { super(input); @@ -30,6 +33,7 @@ export class VbaParser extends vbaParser { } } + export class VbaPreLexer extends vbapreLexer { constructor(input: CharStream) { super(input); @@ -40,6 +44,7 @@ export class VbaPreLexer extends vbapreLexer { } } + export class VbaPreParser extends vbapreParser { constructor(input: TokenStream) { super(input); @@ -54,6 +59,7 @@ export class VbaPreParser extends vbapreParser { } } + export class VbaErrorHandler extends DefaultErrorStrategy { recover(recognizer: Parser, e: RecognitionException): void { const inputStream = recognizer.inputStream; diff --git a/server/src/project/parser/vbaListener.ts b/server/src/project/parser/vbaListener.ts index 9960c50..ed37ecf 100644 --- a/server/src/project/parser/vbaListener.ts +++ b/server/src/project/parser/vbaListener.ts @@ -1,21 +1,42 @@ +// Antlr import { ErrorNode, ParserRuleContext } from 'antlr4ng'; import { vbaListener } from '../../antlr/out/vbaListener'; import { vbapreListener } from '../../antlr/out/vbapreListener'; -import { AnyOperatorContext, ClassModuleContext, ConstItemContext, EnumDeclarationContext, IgnoredClassAttrContext, IgnoredProceduralAttrContext, ProceduralModuleContext, ProcedureDeclarationContext, PropertyGetDeclarationContext, PropertySetDeclarationContext, UdtDeclarationContext, WhileStatementContext } from '../../antlr/out/vbaParser'; -import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext} from '../../antlr/out/vbapreParser'; - -import { BaseProjectDocument, DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; - +import { CompilerConditionalStatementContext, CompilerElseStatementContext, CompilerEndIfStatementContext, CompilerIfBlockContext } from '../../antlr/out/vbapreParser'; +import { + AnyOperatorContext, + ClassModuleContext, + EnumDeclarationContext, + GlobalVariableDeclarationContext, + IgnoredClassAttrContext, + IgnoredProceduralAttrContext, + PrivateConstDeclarationContext, + PrivateTypeDeclarationContext, + PrivateVariableDeclarationContext, + ProceduralModuleContext, + ProcedureDeclarationContext, + PropertyGetDeclarationContext, + PropertySetDeclarationContext, + PublicConstDeclarationContext, + PublicTypeDeclarationContext, + PublicVariableDeclarationContext, + TypeSuffixContext, + UdtDeclarationContext, + WhileStatementContext +} from '../../antlr/out/vbaParser'; + +// Project import { DuplicateOperatorElement, WhileLoopElement } from '../elements/flow'; -import { ConstDeclarationElement, EnumDeclarationElement, NewPropertyGetDeclarationElement, NewPropertyLetDeclarationElement, NewPropertySetDeclarationElement, TypeDeclarationElement } from '../elements/memory'; -import { ClassElement, IgnoredAttributeElement, ModuleElement } from '../elements/module'; -import { CompilerIfBlockElement, InactiveLineElement } from '../elements/special'; +import { CompilerLogicalBlock, GenericCommentElement } from '../elements/precompiled'; +import { ClassElement, ModuleElement, ModuleIgnoredAttributeElement } from '../elements/module'; +import { DocumentSettings, VbaClassDocument, VbaModuleDocument } from '../document'; +import { PropertyGetDeclarationElement, PropertyLetDeclarationElement, PropertySetDeclarationElement } from '../elements/procedure'; +import { DeclarationStatementElement, EnumDeclarationElement, TypeDeclarationElement, TypeSuffixElement } from '../elements/typing'; class CommonParserCapability { document: VbaClassDocument | VbaModuleDocument; protected _documentSettings?: DocumentSettings; - protected _isAfterMethodDeclaration = false; get documentSettings(): DocumentSettings { if (!this._documentSettings) { @@ -34,10 +55,11 @@ class CommonParserCapability { } } + export class VbaListener extends vbaListener { document: VbaClassDocument | VbaModuleDocument; - protected _documentSettings?: DocumentSettings; - protected _isAfterMethodDeclaration = false; + protected documentSettings?: DocumentSettings; + protected isAfterMethodDeclaration = false; constructor(document: VbaClassDocument | VbaModuleDocument) { super(); @@ -51,7 +73,7 @@ export class VbaListener extends vbaListener { } async ensureHasSettingsAsync() { - this._documentSettings = await this.document.getDocumentConfiguration(); + this.documentSettings = await this.document.getDocumentConfiguration(); } enterAnyOperator = (ctx: AnyOperatorContext) => { @@ -60,163 +82,104 @@ export class VbaListener extends vbaListener { } enterEnumDeclaration = (ctx: EnumDeclarationContext) => { - const element = new EnumDeclarationElement(ctx, this.document.textDocument, this._isAfterMethodDeclaration); - this.document.registerFoldableElement(element) - .registerSemanticToken(element) - .registerNamespaceElement(element) - .registerSymbolInformation(element) - .registerDiagnosticElement(element); - element.enumMembers.forEach(member => this.document - .registerSemanticToken(member) - .registerSymbolInformation(member) - .registerDiagnosticElement(member) - .registerNamedElementDeclaration(member) - ); + const element = new EnumDeclarationElement(ctx, this.document.textDocument, this.isAfterMethodDeclaration); + this.document.registerElement(element) + .registerNamespaceElement(element); }; exitEnumDeclaration = (_: EnumDeclarationContext) => - this.document.deregisterScopedElement(); + this.document.deregisterNamespaceElement(); enterClassModule = (ctx: ClassModuleContext) => { - const element = new ClassElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); - this.document.registerSymbolInformation(element) - .registerDiagnosticElement(element) + const element = new ClassElement(ctx, this.document.textDocument, this.documentSettings ?? { doWarnOptionExplicitMissing: true }); + this.document.registerElement(element) .registerNamespaceElement(element) - .registerFoldableElement(element); - }; - - exitClassModule = (ctx: ClassModuleContext) => { - this.document.deregisterScopedElement(); }; - enterConstItem = (ctx: ConstItemContext) => { - const element = new ConstDeclarationElement(ctx, this.document.textDocument); - this.document.registerSemanticToken(element) - .registerSymbolInformation(element) - .registerNamedElementDeclaration(element); - }; + exitClassModule = (_: ClassModuleContext) => + this.document.deregisterNamespaceElement(); enterIgnoredClassAttr = (ctx: IgnoredClassAttrContext) => this.registerIgnoredAttribute(ctx); enterIgnoredProceduralAttr = (ctx: IgnoredProceduralAttrContext) => this.registerIgnoredAttribute(ctx); private registerIgnoredAttribute(ctx: IgnoredClassAttrContext | IgnoredProceduralAttrContext) { - this.document.registerDiagnosticElement(new IgnoredAttributeElement(ctx, this.document.textDocument)) + this.document.registerDiagnosticElement(new ModuleIgnoredAttributeElement(ctx, this.document.textDocument)) } enterProceduralModule = (ctx: ProceduralModuleContext) => { - const element = new ModuleElement(ctx, this.document.textDocument, this._documentSettings ?? { doWarnOptionExplicitMissing: true }); - this.document.registerSymbolInformation(element) - .registerFoldableElement(element) + const element = new ModuleElement(ctx, this.document.textDocument, this.documentSettings ?? { doWarnOptionExplicitMissing: true }); + this.document.registerElement(element) .registerNamespaceElement(element) }; - exitProceduralModule = (ctx: ProceduralModuleContext) => { - this.document.deregisterScopedElement(); - }; + exitProceduralModule = (_: ProceduralModuleContext) => + this.document.deregisterNamespaceElement(); + // Handles exiting of a sub, func, or property. exitProcedureDeclaration = (ctx: ProcedureDeclarationContext) => { - this._isAfterMethodDeclaration = true; - // this.document.deregisterScopedElement(); + this.isAfterMethodDeclaration = true; + this.document.deregisterNamespaceElement(); }; enterPropertyGetDeclaration = (ctx: PropertyGetDeclarationContext) => { - const element = new NewPropertyGetDeclarationElement(ctx, this.document.textDocument); - this.document.registerNamespaceElement(element) - .registerPropertyElementDeclaration(element) - .registerDiagnosticElement(element); + const element = new PropertyGetDeclarationElement(ctx, this.document.textDocument); + this.document.registerElement(element) + .registerNamespaceElement(element); }; enterPropertySetDeclaration = (ctx: PropertySetDeclarationContext) => { - const element = new NewPropertySetDeclarationElement(ctx, this.document.textDocument); - this.document.registerNamespaceElement(element) - .registerPropertyElementDeclaration(element) - .registerDiagnosticElement(element); + const element = !!ctx.LET() + ? new PropertyLetDeclarationElement(ctx, this.document.textDocument) + : new PropertySetDeclarationElement(ctx, this.document.textDocument); + this.document.registerElement(element) + .registerNamespaceElement(element); }; - enterPropertyLetDeclaration = (ctx: PropertySetDeclarationContext) => { - const element = new NewPropertyLetDeclarationElement(ctx, this.document.textDocument); - this.document.registerNamespaceElement(element) - .registerPropertyElementDeclaration(element) - .registerDiagnosticElement(element); - }; + enterPublicTypeDeclaration = (ctx: PublicTypeDeclarationContext) => this.enterTypeDeclaration(ctx, true); + enterPrivateTypeDeclaration = (ctx: PrivateTypeDeclarationContext) => this.enterTypeDeclaration(ctx, false); + private enterTypeDeclaration = (ctx: PublicTypeDeclarationContext | PrivateTypeDeclarationContext, isPrivate: boolean) => { + const element = new TypeDeclarationElement(ctx, this.document.textDocument, isPrivate); + this.document.registerElement(element).registerNamespaceElement(element); + } - exitPropertyGetDeclaration = (_: PropertyGetDeclarationContext) => - this.document.deregisterScopedElement(); - - exitPropertySetDeclaration = (_: PropertySetDeclarationContext) => - this.document.deregisterScopedElement(); - - exitPropertyLetDeclaration = (_: PropertySetDeclarationContext) => - this.document.deregisterScopedElement(); - - - enterUdtDeclaration = (ctx: UdtDeclarationContext) => { - const element = new TypeDeclarationElement(ctx, this.document.textDocument); - this.document.registerFoldableElement(element) - .registerSemanticToken(element) - .registerSymbolInformation(element); - element.declaredNames.forEach(names => - names.forEach(name => this.document - .registerSemanticToken(name) - .registerSymbolInformation(name)) - ); - }; + enterTypeSuffix = (ctx: TypeSuffixContext) => + this.document.registerElement(new TypeSuffixElement(ctx, this.document.textDocument)); + + // Handles public and private type declarations. + exitUdtDeclaration = (_: UdtDeclarationContext) => + this.document.deregisterNamespaceElement(); + + // Variables + enterPublicConstDeclaration = (ctx: PublicConstDeclarationContext) => this.enterVariableDeclaration(ctx); + enterPrivateConstDeclaration = (ctx: PrivateConstDeclarationContext) => this.enterVariableDeclaration(ctx); + enterPublicVariableDeclaration = (ctx: PublicVariableDeclarationContext) => this.enterVariableDeclaration(ctx); + enterGlobalVariableDeclaration = (ctx: GlobalVariableDeclarationContext) => this.enterVariableDeclaration(ctx); + enterPrivateVariableDeclaration = (ctx: PrivateVariableDeclarationContext) => this.enterVariableDeclaration(ctx); + private enterVariableDeclaration = (ctx: PublicConstDeclarationContext | PrivateConstDeclarationContext | PublicVariableDeclarationContext | GlobalVariableDeclarationContext | PrivateVariableDeclarationContext) => { + const element = DeclarationStatementElement.create(ctx, this.document.textDocument); + element.declarations.forEach(x => this.document.registerElement(x)); + } enterWhileStatement = (ctx: WhileStatementContext) => { - const element = new WhileLoopElement(ctx, this.document.textDocument); + const element = new WhileLoopElement(ctx, this.document.textDocument) this.document.registerDiagnosticElement(element); }; visitErrorNode(node: ErrorNode) { console.log(node.getPayload()); } - - // enterAttributeStmt = (ctx: AttributeStmtContext) => { - // this.document.activeAttributeElement?.processAttribute(ctx); - // }; - - // enterConstStmt = (ctx: ConstStmtContext) => { - // const element = new ConstDeclarationsElement(ctx, this.document.textDocument); - // element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); - // }; - - // enterOperatorsStmt = (ctx: OperatorsStmtContext) => { - // const element = new OperatorElement(ctx, this.document.textDocument); - // this.document.registerDiagnosticElement(element); - // enterModule = (ctx: ModuleContext) => { - // const element = new ModuleElement(ctx, this.document.textDocument, this.document.symbolKind); - // this.document.registerAttributeElement(element) - // .registerScopedElement(element); - // }; - - // enterTypeStmt = (ctx: TypeStmtContext) => { - // const element = new TypeDeclarationElement(ctx, this.document.textDocument); - // this.document.registerSymbolInformation(element) - // .registerSemanticToken(element); - // }; - - // enterVariableStmt = (ctx: VariableStmtContext) => { - // const element = new VariableDeclarationsElement(ctx, this.document.textDocument); - // element.declarations.forEach((e) => this.document.registerSymbolInformation(e)); - // }; - - // enterWhileWendStmt = (ctx: WhileWendStmtContext) => { - // const element = new WhileWendLoopElement(ctx, this.document.textDocument); - // this.document.registerDiagnosticElement(element); - // }; } + export class VbaPreListener extends vbapreListener { common: CommonParserCapability; - private _document: BaseProjectDocument; get text(): string { - return this._document.redactedText; + return this.common.document.redactedText; } constructor(document: VbaClassDocument | VbaModuleDocument) { super(); this.common = new CommonParserCapability(document); - this._document = document; } static async createAsync(document: VbaClassDocument | VbaModuleDocument): Promise { @@ -228,22 +191,25 @@ export class VbaPreListener extends vbapreListener { enterCompilerIfBlock = (ctx: CompilerIfBlockContext) => { const doc = this.common.document; const docprops = this.common.documentSettings; - const element = new CompilerIfBlockElement(ctx, doc.textDocument, docprops); - - element.inactiveChildren.forEach(e => { - doc.registerSubtractElement(e); - e.lines.forEach(c => doc.registerCommentOutElement(c)); + const element = new CompilerLogicalBlock(ctx, doc.textDocument, docprops); + + // Register block subtraction and comment tokens. + element.inactiveBlocks.forEach(b => { + doc.registerSubtractElement(b); + b.linesToComments.forEach(c => + doc.registerSemanticToken(c) + .registerSemanticToken(c) + ); }); } - enterCompilerElseStatement = (ctx: CompilerElseStatementContext) => this._registerInactiveLine(ctx); - enterCompilerEndIfStatement = (ctx: CompilerEndIfStatementContext) => this._registerInactiveLine(ctx); - enterCompilerConditionalStatement = (ctx: CompilerConditionalStatementContext) => this._registerInactiveLine(ctx); + enterCompilerElseStatement = (ctx: CompilerElseStatementContext) => this.registerSemanticComment(ctx); + enterCompilerEndIfStatement = (ctx: CompilerEndIfStatementContext) => this.registerSemanticComment(ctx); + enterCompilerConditionalStatement = (ctx: CompilerConditionalStatementContext) => this.registerSemanticComment(ctx); - private _registerInactiveLine(ctx: ParserRuleContext) { + private registerSemanticComment(ctx: ParserRuleContext) { const doc = this.common.document; - doc.registerSubtractElement( - new InactiveLineElement(ctx, doc.textDocument) - ); + const element = new GenericCommentElement(ctx, doc.textDocument); + doc.registerSubtractElement(element); } } \ No newline at end of file diff --git a/server/src/project/parser/vbaParser.ts b/server/src/project/parser/vbaParser.ts index 9d99826..4d299fb 100644 --- a/server/src/project/parser/vbaParser.ts +++ b/server/src/project/parser/vbaParser.ts @@ -1,8 +1,11 @@ +// Antlr import { ParseTreeWalker } from 'antlr4ng'; +import { VbaParser, VbaPreParser } from './vbaAntlr'; +import { VbaListener, VbaPreListener } from './vbaListener'; +// Project import { VbaClassDocument, VbaModuleDocument } from '../document'; -import { VbaListener, VbaPreListener } from './vbaListener'; -import { VbaParser, VbaPreParser } from './vbaAntlr'; + export class SyntaxParser { async parseAsync(document: VbaClassDocument | VbaModuleDocument): Promise { @@ -12,18 +15,18 @@ export class SyntaxParser { if (regexp.test(docText)) { const prelistener = await VbaPreListener.createAsync(document); const preparser = VbaPreParser.create(docText); - await this._parseAsync(prelistener, preparser); + await this.parseDocumentAsync(prelistener, preparser); docText = prelistener.text; } // Perform main document parse without compiler directives. const listener = await VbaListener.createAsync(document); const parser = VbaParser.create(docText); - await this._parseAsync(listener, parser); + await this.parseDocumentAsync(listener, parser); return true; } - private async _parseAsync(listener: VbaListener | VbaPreListener, parser: VbaParser | VbaPreParser) { + private async parseDocumentAsync(listener: VbaListener | VbaPreListener, parser: VbaParser | VbaPreParser) { ParseTreeWalker.DEFAULT.walk( listener, parser.startRule() diff --git a/server/src/project/scope.ts b/server/src/project/scope.ts index 5809c2f..6a3b797 100644 --- a/server/src/project/scope.ts +++ b/server/src/project/scope.ts @@ -1,56 +1,64 @@ +// Core +import { Diagnostic } from 'vscode-languageserver'; + +// Project +import { DeclarableElement } from './elements/base'; import { DuplicateDeclarationDiagnostic, ShadowDeclarationDiagnostic } from '../capabilities/diagnostics'; -import { NamedSyntaxElement } from './elements/base'; export class NamespaceManager { - private _names: Map = new Map(); - private _scopeStack: {namespace: NamedSyntaxElement, names: Map }[] = []; + private names: Map = new Map(); + private scopeStack: {namespace: DeclarableElement, names: Map }[] = []; /** * Begins tracking a namespace item against a namespace. * @returns A diagnostic if the item has already been declared in this space. */ - addNameItem = (item: NamedSyntaxElement): void => { + addNameItem = (item: DeclarableElement): void => { + const pushDiagnostic = (x: Diagnostic) => item.diagnosticCapability.diagnostics.push(x); + // Check current scope for duplicate declaration. - let checkItem = this._scopeStack.at(-1)?.names.get(item.name); + let checkItem = this.scopeStack.at(-1)?.names.get(item.identifierCapability.name); if (!!checkItem && !checkItem.equals(item)) { - item.diagnostics.push(new DuplicateDeclarationDiagnostic(item.range)); + pushDiagnostic(new DuplicateDeclarationDiagnostic(item.identifierCapability.range)); return; } - this._scopeStack.at(-1)?.names.set(item.name, item); + + // Add the name to the current scope. + this.scopeStack.at(-1)?.names.set(item.identifierCapability.name, item); // Check higher scopes for shadowed declarations - checkItem = this._names.get(item.name) + checkItem = this.names.get(item.identifierCapability.name) if (!!checkItem && !checkItem.equals(item)) { - item.diagnostics.push(new ShadowDeclarationDiagnostic(item.range)); + pushDiagnostic(new ShadowDeclarationDiagnostic(item.context.range)); return; } - this._names.set(item.name, item); + this.names.set(item.identifierCapability.name, item); } /** * Adds a namespace to the stack and tracks names. * @param scope The namespace to add. */ - addNamespace = (scope: NamedSyntaxElement) => { + addNamespace = (scope: DeclarableElement) => { this.addNameItem(scope); // a namespace is also a name - this._scopeStack.push({namespace: scope, names: new Map()}); + this.scopeStack.push({namespace: scope, names: new Map()}); } /** * Removes the namespace and all names associated with it. */ popNamespace = (): void => { - const ns = this._scopeStack.pop(); + const ns = this.scopeStack.pop(); // Remove the items in the current scope if they are not public. ns?.names.forEach((_, x) => { - if (!(this._names.get(x)?.isPublic ?? true)) { this._names.delete(x); } + if (!(this.names.get(x)?.isPublic ?? true)) { this.names.delete(x); } }); // Remove the current scope. - if (ns && !ns.namespace.isPublic && this._names.has(ns.namespace.name)) { - this._names.delete(ns.namespace.name); + if (ns && !ns.namespace.isPublic && this.names.has(ns.namespace.identifierCapability.name)) { + this.names.delete(ns.namespace.identifierCapability.name); } } } diff --git a/server/src/project/workspace.ts b/server/src/project/workspace.ts index 126e1ed..4c59399 100644 --- a/server/src/project/workspace.ts +++ b/server/src/project/workspace.ts @@ -1,22 +1,45 @@ -import { CancellationToken, CancellationTokenSource, CompletionItem, CompletionParams, DidChangeConfigurationNotification, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DocumentDiagnosticParams, DocumentDiagnosticReport, DocumentDiagnosticReportKind, DocumentSymbolParams, FoldingRange, FoldingRangeParams, Hover, HoverParams, SemanticTokensRangeParams, SymbolInformation, TextDocuments, WorkspaceFoldersChangeEvent, _Connection } from 'vscode-languageserver'; +// Core +import { TextDocument } from 'vscode-languageserver-textdocument'; +import { + CancellationToken, + CancellationTokenSource, + CompletionItem, + CompletionParams, + DidChangeConfigurationNotification, + DidChangeWatchedFilesParams, + DidOpenTextDocumentParams, + DocumentDiagnosticParams, + DocumentDiagnosticReport, + DocumentDiagnosticReportKind, + DocumentSymbolParams, + FoldingRange, + FoldingRangeParams, + Hover, + HoverParams, + SemanticTokensRangeParams, + SymbolInformation, + TextDocuments, + WorkspaceFoldersChangeEvent, + _Connection +} from 'vscode-languageserver'; + import { BaseProjectDocument } from './document'; import { LanguageServerConfiguration } from '../server'; import { hasConfigurationCapability } from '../capabilities/workspaceFolder'; -import { TextDocument } from 'vscode-languageserver-textdocument'; import { sleep } from '../utils/helpers'; import { NamespaceManager } from './scope'; /** - * Organises project documents and runs actions - * at a workspace level. + * Organises project documents and runs actions at a workspace level. */ export class Workspace { - private _events: WorkspaceEvents; - private _nsManager: NamespaceManager = new NamespaceManager(); - private _documents: BaseProjectDocument[] = []; + private events: WorkspaceEvents; + private nsManager: NamespaceManager = new NamespaceManager(); + private documents: BaseProjectDocument[] = []; + private parseCancellationTokenSource?: CancellationTokenSource; + private _activeDocument?: BaseProjectDocument; - private _parseCancellationTokenSource?: CancellationTokenSource; private readonly _hasConfigurationCapability: boolean; get hasConfigurationCapability() { @@ -30,13 +53,13 @@ export class Workspace { } get namespaceManager() { - return this._nsManager; + return this.nsManager; } constructor(params: {connection: _Connection, capabilities: LanguageServerConfiguration}) { this.connection = params.connection; this._hasConfigurationCapability = hasConfigurationCapability(params.capabilities); - this._events = new WorkspaceEvents({ + this.events = new WorkspaceEvents({ workspace: this, connection: params.connection, configuration: params.capabilities, @@ -51,17 +74,17 @@ export class Workspace { async parseActiveDocument(document?: BaseProjectDocument) { this.activateDocument(document); - this._parseCancellationTokenSource?.cancel(); - this._parseCancellationTokenSource = new CancellationTokenSource(); + this.parseCancellationTokenSource?.cancel(); + this.parseCancellationTokenSource = new CancellationTokenSource(); // Exceptions thrown by the parser should be ignored. try { - await this._activeDocument?.parseAsync(this._parseCancellationTokenSource.token); + await this.activeDocument?.parseAsync(this.parseCancellationTokenSource.token); } catch (error) { this.connection.console.log(`Parser error: ${error}`) } - this._parseCancellationTokenSource = undefined; + this.parseCancellationTokenSource = undefined; } /** @@ -89,28 +112,29 @@ export class Workspace { }); clearDocumentsConfiguration = () => { - this._documents.forEach(d => d.clearDocumentConfiguration()); + this.documents.forEach(d => d.clearDocumentConfiguration()); this.connection.languages.diagnostics.refresh(); } } + // TODO: This class should not be doing anything with connection. class WorkspaceEvents { - private readonly _workspace: Workspace; - private readonly _documents: TextDocuments; - private readonly _configuration: LanguageServerConfiguration; - private readonly _parsedDocuments: Map; + private readonly workspace: Workspace; + private readonly documents: TextDocuments; + private readonly configuration: LanguageServerConfiguration; + private readonly parsedDocuments: Map; - private _activeDocument?: BaseProjectDocument; + private activeDocument?: BaseProjectDocument; constructor(params: {connection: _Connection, workspace: Workspace, configuration: LanguageServerConfiguration}) { - this._workspace = params.workspace; - this._configuration = params.configuration; - this._documents = new TextDocuments(TextDocument); - this._parsedDocuments = new Map(); + this.workspace = params.workspace; + this.configuration = params.configuration; + this.documents = new TextDocuments(TextDocument); + this.parsedDocuments = new Map(); this.initialiseConnectionEvents(params.connection); - this._initialiseDocumentsEvents(); - this._documents.listen(params.connection); + this.initialiseDocumentsEvents(); + this.documents.listen(params.connection); } /** @@ -121,7 +145,7 @@ class WorkspaceEvents { */ private async activeParsedDocument(version: number, token: CancellationToken): Promise { let document: BaseProjectDocument | undefined; - document = this._activeDocument; + document = this.activeDocument; // Sleep between attempting to grab the document. // Loop while we have undefined or an earlier version. @@ -130,7 +154,7 @@ class WorkspaceEvents { return; } await sleep(5); - document = this._activeDocument; + document = this.activeDocument; } // Return if the version somehow outpaced us. @@ -151,12 +175,12 @@ class WorkspaceEvents { token.onCancellationRequested(() => { throw new Error("Request cancelled during run."); }); let document: BaseProjectDocument | undefined; - document = this._parsedDocuments.get(uri); + document = this.parsedDocuments.get(uri); // Ensure we have the appropriately versioned document. while (!document || document.textDocument.version < version) { await sleep(5); - document = this._parsedDocuments.get(uri); + document = this.parsedDocuments.get(uri); } // Return nothing if the document version is newer than requested. @@ -173,28 +197,28 @@ class WorkspaceEvents { } private initialiseConnectionEvents(connection: _Connection) { - connection.onInitialized(() => this._onInitialized()); - connection.onDidOpenTextDocument(params => this._onDidOpenTextDocumentAsync(params)); - connection.onCompletion(params => this._onCompletion(params)); - connection.onCompletionResolve(item => this._onCompletionResolve(item)); - connection.onDidChangeConfiguration(_ => this._workspace.clearDocumentsConfiguration()); - connection.onDidChangeWatchedFiles(params => this._onDidChangeWatchedFiles(params)); - connection.onDocumentSymbol(async (params, token) => await this._onDocumentSymbolAsync(params, token)); - connection.onHover(params => this._onHover(params)); - connection.languages.diagnostics.on(async (params, token) => await this._onDiagnosticAsync(params, token)); - - if (hasConfigurationCapability(this._configuration)) { - connection.onFoldingRanges(async (params, token) => this._onFoldingRangesAsync(params, token)); + connection.onInitialized(() => this.onInitialized()); + connection.onDidOpenTextDocument(params => this.onDidOpenTextDocumentAsync(params)); + connection.onCompletion(params => this.onCompletion(params)); + connection.onCompletionResolve(item => this.onCompletionResolve(item)); + connection.onDidChangeConfiguration(_ => this.workspace.clearDocumentsConfiguration()); + connection.onDidChangeWatchedFiles(params => this.onDidChangeWatchedFiles(params)); + connection.onDocumentSymbol(async (params, token) => await this.onDocumentSymbolAsync(params, token)); + connection.onHover(params => this.onHover(params)); + connection.languages.diagnostics.on(async (params, token) => await this.onDiagnosticAsync(params, token)); + + if (hasConfigurationCapability(this.configuration)) { + connection.onFoldingRanges(async (params, token) => this.onFoldingRangesAsync(params, token)); } connection.onRequest((method: string, params: object | object[] | any) => { switch (method) { case 'textDocument/semanticTokens/full': { - return this._activeDocument?.languageServerSemanticTokens(); + return this.activeDocument?.languageServerSemanticTokens(); } case 'textDocument/semanticTokens/range': { const rangeParams = params as SemanticTokensRangeParams; - return this._activeDocument?.languageServerSemanticTokens(rangeParams.range); + return this.activeDocument?.languageServerSemanticTokens(rangeParams.range); } default: console.error(`Unresolved request path: ${method}`); @@ -202,37 +226,35 @@ class WorkspaceEvents { }); } - - - private _initialiseDocumentsEvents() { - this._documents.onDidChangeContent(async (e) => await this.onDidChangeContentAsync(e.document)); + private initialiseDocumentsEvents() { + this.documents.onDidChangeContent(async (e) => await this.onDidChangeContentAsync(e.document)); } /** Connection event handlers */ - private _onCompletion(params: CompletionParams): never[] { + private onCompletion(params: CompletionParams): never[] { return []; } - private _onCompletionResolve(item: CompletionItem): CompletionItem { + private onCompletionResolve(item: CompletionItem): CompletionItem { return item; } - private _onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams) { + private onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams) { return; } // TODO: Should trigger a full workspace refresh. - private _onDidChangeWorkspaceFolders(e: WorkspaceFoldersChangeEvent) { - this._workspace.connection.console.log(`Workspace folder change event received.\n${e}`); + private onDidChangeWorkspaceFolders(e: WorkspaceFoldersChangeEvent) { + this.workspace.connection.console.log(`Workspace folder change event received.\n${e}`); } - private async _onDocumentSymbolAsync(params: DocumentSymbolParams, token: CancellationToken): Promise { + private async onDocumentSymbolAsync(params: DocumentSymbolParams, token: CancellationToken): Promise { const document = await this.activeParsedDocument(0, token); return document?.languageServerSymbolInformation() ?? []; } - private async _onDiagnosticAsync(params: DocumentDiagnosticParams, token: CancellationToken): Promise { + private async onDiagnosticAsync(params: DocumentDiagnosticParams, token: CancellationToken): Promise { const document = await this.activeParsedDocument(0, token); return document?.languageServerDiagnostics() ?? { kind: DocumentDiagnosticReportKind.Full, @@ -240,26 +262,26 @@ class WorkspaceEvents { } satisfies DocumentDiagnosticReport; } - private async _onFoldingRangesAsync(params: FoldingRangeParams, token: CancellationToken): Promise { + private async onFoldingRangesAsync(params: FoldingRangeParams, token: CancellationToken): Promise { const document = await this.getParsedDocument(params.textDocument.uri, 0, token); const result = document?.languageServerFoldingRanges(); return result ?? []; } - private _onHover(params: HoverParams): Hover { - console.debug(`_onHover`); + private onHover(params: HoverParams): Hover { + console.debug(`onHover`); return { contents: '' }; } - private _onInitialized(): void { - const connection = this._workspace.connection; + private onInitialized(): void { + const connection = this.workspace.connection; // Register for client configuration notification changes. connection.client.register(DidChangeConfigurationNotification.type, undefined); // This is how we can listen for changes to workspace folders. - if (hasConfigurationCapability(this._configuration)) { + if (hasConfigurationCapability(this.configuration)) { connection.workspace.onDidChangeWorkspaceFolders(e => - this._onDidChangeWorkspaceFolders(e) + this.onDidChangeWorkspaceFolders(e) ); connection.client.register(DidChangeConfigurationNotification.type, undefined); } @@ -271,8 +293,8 @@ class WorkspaceEvents { * This event handler is called whenever a `TextDocuments` is changed. * @param doc The document that changed. */ - async _onDidOpenTextDocumentAsync(params: DidOpenTextDocumentParams) { - await this._handleChangeOrOpenAsync(TextDocument.create( + async onDidOpenTextDocumentAsync(params: DidOpenTextDocumentParams) { + await this.handleChangeOrOpenAsync(TextDocument.create( params.textDocument.uri, params.textDocument.languageId, params.textDocument.version, @@ -281,13 +303,13 @@ class WorkspaceEvents { } async onDidChangeContentAsync(document: TextDocument) { - await this._handleChangeOrOpenAsync(document); + await this.handleChangeOrOpenAsync(document); } - protected async _handleChangeOrOpenAsync(document: TextDocument) { - const doc = BaseProjectDocument.create(this._workspace, document); - this._parsedDocuments.set(document.uri, doc); - this._activeDocument = doc; - await this._workspace.parseActiveDocument(this._activeDocument); + protected async handleChangeOrOpenAsync(document: TextDocument) { + const doc = BaseProjectDocument.create(this.workspace, document); + this.parsedDocuments.set(document.uri, doc); + this.activeDocument = doc; + await this.workspace.parseActiveDocument(this.activeDocument); } } diff --git a/server/src/server.ts b/server/src/server.ts index fe7f62d..adf83f6 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -12,10 +12,14 @@ import { ServerCapabilities, } from 'vscode-languageserver/node'; +// Ensures globally available type extensions. +import './extensions/stringExtensions'; +import './extensions/parserExtensions'; import { Workspace } from './project/workspace'; import { activateSemanticTokenProvider } from './capabilities/semanticTokens'; import { activateWorkspaceFolderCapability } from './capabilities/workspaceFolder'; + class LanguageServer { workspace?: Workspace; configuration?: LanguageServerConfiguration; @@ -51,6 +55,7 @@ class LanguageServer { } } + export class LanguageServerConfiguration { params: InitializeParams; capabilities: ServerCapabilities = { @@ -98,6 +103,7 @@ export class LanguageServerConfiguration { } } + class ConnectionInitializeResult implements InitializeResult { [custom: string]: any; capabilities: ServerCapabilities; diff --git a/server/src/utils/helpers.ts b/server/src/utils/helpers.ts index b989b98..73ae4a0 100644 --- a/server/src/utils/helpers.ts +++ b/server/src/utils/helpers.ts @@ -1,20 +1,34 @@ -import { ParserRuleContext } from 'antlr4ng'; -import { Range } from 'vscode-languageserver'; -import { TextDocument } from 'vscode-languageserver-textdocument'; +export class Dictionary extends Map { + private defaultFactory: (...args: any) => V; -export function sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms) ); -} + constructor(defaultFactory: (...args: any) => V) { + super(); + this.defaultFactory = defaultFactory; + } -export function contextToRange(doc: TextDocument, ctx?: ParserRuleContext): Range | undefined { - if (!ctx) { - return; + /** + * Gets the value if the key exists or creates it in the dictionary if it does not. + */ + getOrSet(key: K, ...args: any): V { + if (this.has(key)) return this.get(key)!; + const defaultValue = this.defaultFactory(args); + this.set(key, defaultValue); + return defaultValue; } +} + - const startIndex = ctx.start?.start ?? 0; - const stopIndex = ctx.stop?.stop ?? startIndex; - return Range.create( - doc.positionAt(startIndex), - doc.positionAt(stopIndex + 1) - ); +export function isOfType(obj: unknown, property: keyof T, nullable: boolean = true): obj is T { + if (nullable) return (obj as T)[property] !== undefined; + return ( + typeof obj === 'object' + && obj !== null + && property in obj + && (!!(obj as T)[property]) + ) +} + + +export function sleep(ms: number): Promise { + return new Promise(resolve => setTimeout(resolve, ms) ); } \ No newline at end of file From 9267568fdbd6321e9838568111fdffd6d3c90569 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:27:27 +0800 Subject: [PATCH 55/58] Package updates and fixes --- client/package-lock.json | 37 +- client/package.json | 2 +- client/src/test/index.ts | 29 +- package-lock.json | 1132 ++++++++++++++++++++------------------ package.json | 14 +- 5 files changed, 635 insertions(+), 579 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 4bfa372..090de57 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -12,7 +12,7 @@ "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@types/vscode": "^1.95.0", + "@types/vscode": "^1.96.0", "@vscode/test-electron": "^2.4.1" }, "engines": { @@ -20,9 +20,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.95.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", - "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", + "version": "1.96.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.96.0.tgz", + "integrity": "sha512-qvZbSZo+K4ZYmmDuaodMbAa67Pl6VDQzLKFka6rq+3WUTY4Kro7Bwoi0CuZLO/wema0ygcmpwow7zZfPJTs5jg==", "dev": true, "license": "MIT" }, @@ -44,14 +44,11 @@ } }, "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, "engines": { "node": ">= 14" } @@ -158,9 +155,9 @@ } }, "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", "dev": true, "license": "MIT", "engines": { @@ -207,9 +204,9 @@ "license": "MIT" }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -253,13 +250,13 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { diff --git a/client/package.json b/client/package.json index a895ef0..0fe610f 100644 --- a/client/package.json +++ b/client/package.json @@ -16,7 +16,7 @@ "vscode-languageclient": "^9.0.1" }, "devDependencies": { - "@types/vscode": "^1.95.0", + "@types/vscode": "^1.96.0", "@vscode/test-electron": "^2.4.1" } } diff --git a/client/src/test/index.ts b/client/src/test/index.ts index b9de4dc..cf7e13a 100644 --- a/client/src/test/index.ts +++ b/client/src/test/index.ts @@ -4,7 +4,7 @@ * ------------------------------------------------------------------------------------------ */ import * as path from 'path'; import * as Mocha from 'mocha'; -import * as glob from 'glob'; +import { glob } from 'glob'; export function run(): Promise { // Create the mocha test @@ -16,28 +16,25 @@ export function run(): Promise { const testsRoot = __dirname; - return new Promise((resolve, reject) => { - glob('**.test.js', { cwd: testsRoot }, (err, files) => { - if (err) { - return reject(err); - } + return glob.glob('**.test.js', { cwd: testsRoot }).then(async files => { - // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + // Add files to the test suite + files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); - try { - // Run the mocha test + try { + // Run the mocha test + await new Promise((resolve, reject) => { mocha.run(failures => { if (failures > 0) { - reject(new Error(`${failures} tests failed.`)); + reject(`${failures} tests failed.`); } else { resolve(); } }); - } catch (err) { - console.error(err); - reject(err); - } - }); + }); + } catch (err) { + console.error(err); + throw err; + } }); } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e2bedd4..39d10ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,20 +10,20 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "antlr4ng": "^3.0.8" + "antlr4ng": "^3.0.14" }, "devDependencies": { - "@types/mocha": "^10.0.9", - "@types/node": "^22.9.1", - "@typescript-eslint/eslint-plugin": "^8.15.0", - "@typescript-eslint/parser": "^8.15.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.10.6", + "@typescript-eslint/eslint-plugin": "^8.20.0", + "@typescript-eslint/parser": "^8.20.0", "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", "antlr4ng-cli": "^2.0.0", - "eslint": "^9.15.0", + "eslint": "^9.18.0", "js-yaml": "^4.1.0", "mocha": "^10.8.2", - "typescript": "^5.6.3", + "typescript": "^5.7.3", "vscode-tmgrammar-test": "^0.1.3" }, "engines": { @@ -67,13 +67,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", - "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -106,11 +106,14 @@ } }, "node_modules/@eslint/core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", - "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -164,9 +167,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", - "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", + "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==", "dev": true, "license": "MIT", "engines": { @@ -174,9 +177,9 @@ } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -184,12 +187,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", - "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", "dev": true, "license": "Apache-2.0", "dependencies": { + "@eslint/core": "^0.10.0", "levn": "^0.4.1" }, "engines": { @@ -280,91 +284,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -481,31 +400,31 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", - "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", + "version": "22.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.6.tgz", + "integrity": "sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.15.0.tgz", - "integrity": "sha512-+zkm9AR1Ds9uLWN3fkoeXgFppaQ+uEVtfOV62dDmsy9QCNqlRHWNEck4yarvRNrvRcHQLGfqBNui3cimoz8XAg==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.20.0.tgz", + "integrity": "sha512-naduuphVw5StFfqp4Gq4WhIBE2gN1GEmMUExpJYknZJdRnc+2gDzB8Z3+5+/Kv33hPQRDGzQO/0opHE72lZZ6A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/type-utils": "8.15.0", - "@typescript-eslint/utils": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/scope-manager": "8.20.0", + "@typescript-eslint/type-utils": "8.20.0", + "@typescript-eslint/utils": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -516,25 +435,21 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.15.0.tgz", - "integrity": "sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.20.0.tgz", + "integrity": "sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/typescript-estree": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/scope-manager": "8.20.0", + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/typescript-estree": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0", "debug": "^4.3.4" }, "engines": { @@ -545,23 +460,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.15.0.tgz", - "integrity": "sha512-QRGy8ADi4J7ii95xz4UoiymmmMd/zuy9azCaamnZ3FM8T5fZcex8UfJcjkiEZjJSztKfEBe3dZ5T/5RHAmw2mA==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.20.0.tgz", + "integrity": "sha512-J7+VkpeGzhOt3FeG1+SzhiMj9NzGD/M6KoGn9f4dbz3YzK9hvbhVTmLj/HiTp9DazIzJ8B4XcM80LrR9Dm1rJw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0" + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -572,16 +483,16 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.15.0.tgz", - "integrity": "sha512-UU6uwXDoI3JGSXmcdnP5d8Fffa2KayOhUUqr/AiBnG1Gl7+7ut/oyagVeSkh7bxQ0zSXV9ptRh/4N15nkCqnpw==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.20.0.tgz", + "integrity": "sha512-bPC+j71GGvA7rVNAHAtOjbVXbLN5PkwqMvy1cwGeaxUoRQXVuKCebRoLzm+IPW/NtFFpstn1ummSIasD5t60GA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.15.0", - "@typescript-eslint/utils": "8.15.0", + "@typescript-eslint/typescript-estree": "8.20.0", + "@typescript-eslint/utils": "8.20.0", "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -591,18 +502,14 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.15.0.tgz", - "integrity": "sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.20.0.tgz", + "integrity": "sha512-cqaMiY72CkP+2xZRrFt3ExRBu0WmVitN/rYPZErA80mHjHx/Svgp8yfbzkJmDoQ/whcytOPO9/IZXnOc+wigRA==", "dev": true, "license": "MIT", "engines": { @@ -614,20 +521,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.15.0.tgz", - "integrity": "sha512-1eMp2JgNec/niZsR7ioFBlsh/Fk0oJbhaqO0jRyQBMgkz7RrFfkqF9lYYmBoGBaSiLnu8TAPQTwoTUiSTUW9dg==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.20.0.tgz", + "integrity": "sha512-Y7ncuy78bJqHI35NwzWol8E0X7XkRVS4K4P4TCyzWkOJih5NDvtoRDW4Ba9YJJoB2igm9yXDdYI/+fkiiAxPzA==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -636,23 +543,21 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.15.0.tgz", - "integrity": "sha512-k82RI9yGhr0QM3Dnq+egEpz9qB6Un+WLYhmoNcvl8ltMEededhh7otBVVIDDsEEttauwdY/hQoSsOv13lxrFzQ==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.20.0.tgz", + "integrity": "sha512-dq70RUw6UK9ei7vxc4KQtBRk7qkHZv447OUZ6RPQMQl71I3NZxQJX/f32Smr+iqWrB02pHKn2yAdHBb0KNrRMA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/typescript-estree": "8.15.0" + "@typescript-eslint/scope-manager": "8.20.0", + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/typescript-estree": "8.20.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -662,22 +567,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz", - "integrity": "sha512-h8vYOulWec9LhpwfAdZf2bjr8xIp0KNKnpgqSz0qqYYKAW/QZKw3ktRndbiAtUz4acH4QLQavwZBYCc0wulA/Q==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.20.0.tgz", + "integrity": "sha512-v/BpkeeYAsPkKCkR8BDwcno0llhzWVqPOamQrAEMdpZav2Y9OVjd9dwJyBLJWwf335B5DmlifECIkZRJCaGaHA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/types": "8.20.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -725,84 +626,6 @@ "node": ">=18" } }, - "node_modules/@vscode/test-cli/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@vscode/test-cli/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@vscode/test-cli/node_modules/supports-color": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", - "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/@vscode/test-cli/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@vscode/test-cli/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/@vscode/test-electron": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.1.tgz", @@ -844,14 +667,11 @@ } }, "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, "engines": { "node": ">= 14" } @@ -884,13 +704,16 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -910,9 +733,9 @@ } }, "node_modules/antlr4ng": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.9.tgz", - "integrity": "sha512-xRl3RNanvJwKdBDHrqOcESJGO/0vraqtPuJPkaO3RH1zME3+2jkjMtZJjVSFR2Nt4oh9tW7U6/iX4EBSxaiUBw==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/antlr4ng/-/antlr4ng-3.0.14.tgz", + "integrity": "sha512-EVEn3B3zpxgbq/731dhwMYCls9e8mAudBvo479hoXbX/yTL24Do1HNZEU+v1U6GayIFrow5EcHMdyXqqRXTtBw==", "license": "BSD-3-Clause", "peerDependencies": { "antlr4ng-cli": "^2.0.0" @@ -1104,50 +927,6 @@ "node": ">=14.14.0" } }, - "node_modules/c8/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/c8/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/c8/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1188,6 +967,19 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -1213,58 +1005,111 @@ "fsevents": "~2.3.2" } }, - "node_modules/chokidar/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "license": "ISC", "dependencies": { - "is-glob": "^4.0.1" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">= 6" + "node": ">=12" } }, - "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", "dependencies": { - "restore-cursor": "^4.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/color-convert": { @@ -1334,9 +1179,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -1389,16 +1234,16 @@ "license": "MIT" }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", + "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1433,19 +1278,19 @@ } }, "node_modules/eslint": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", - "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", + "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.9.0", + "@eslint/core": "^0.10.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.15.0", - "@eslint/plugin-kit": "^0.2.3", + "@eslint/js": "9.18.0", + "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.1", @@ -1453,7 +1298,7 @@ "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -1546,6 +1391,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1644,9 +1502,9 @@ "license": "MIT" }, "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "license": "MIT", "dependencies": { @@ -1654,25 +1512,12 @@ "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" } }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -1688,9 +1533,9 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "dev": true, "license": "ISC", "dependencies": { @@ -1821,50 +1666,37 @@ } }, "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": ">=12" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=10" + "node": ">= 6" } }, "node_modules/globals": { @@ -1936,13 +1768,13 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -2164,6 +1996,19 @@ "node": ">=10" } }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/istanbul-reports": { "version": "3.1.7", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", @@ -2434,6 +2279,56 @@ "node": ">= 14.0.0" } }, + "node_modules/mocha/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mocha/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -2447,6 +2342,34 @@ "node": ">=10" } }, + "node_modules/mocha/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -2463,6 +2386,53 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2546,32 +2516,19 @@ "log-symbols": "^5.1.0", "stdin-discarder": "^0.1.0", "string-width": "^6.1.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", + "strip-ansi": "^7.1.0" + }, "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ora/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", "dev": true, "license": "MIT", "engines": { @@ -2636,22 +2593,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ora/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -2845,13 +2786,6 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "license": "MIT" - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -2945,24 +2879,10 @@ } }, "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], "license": "MIT" }, "node_modules/semver": { @@ -3057,26 +2977,22 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "license": "MIT" - }, "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/string-width-cjs": { @@ -3095,7 +3011,24 @@ "node": ">=8" } }, - "node_modules/strip-ansi": { + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -3108,6 +3041,22 @@ "node": ">=8" } }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", @@ -3122,6 +3071,16 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3136,16 +3095,16 @@ } }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", "dev": true, "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/tapable": { @@ -3233,16 +3192,16 @@ } }, "node_modules/ts-api-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz", - "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", + "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/type-check": { @@ -3259,9 +3218,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -3273,9 +3232,9 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, "license": "MIT" }, @@ -3513,18 +3472,18 @@ "license": "Apache-2.0" }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -3549,6 +3508,64 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -3567,32 +3584,32 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "license": "MIT", "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-unparser": { @@ -3611,6 +3628,51 @@ "node": ">=10" } }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index f70adb2..42e90d6 100644 --- a/package.json +++ b/package.json @@ -135,20 +135,20 @@ "vsctest": "vscode-test" }, "dependencies": { - "antlr4ng": "^3.0.8" + "antlr4ng": "^3.0.14" }, "devDependencies": { - "@types/mocha": "^10.0.9", - "@types/node": "^22.9.1", - "@typescript-eslint/eslint-plugin": "^8.15.0", - "@typescript-eslint/parser": "^8.15.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.10.6", + "@typescript-eslint/eslint-plugin": "^8.20.0", + "@typescript-eslint/parser": "^8.20.0", "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", "antlr4ng-cli": "^2.0.0", - "eslint": "^9.15.0", + "eslint": "^9.18.0", "js-yaml": "^4.1.0", "mocha": "^10.8.2", - "typescript": "^5.6.3", + "typescript": "^5.7.3", "vscode-tmgrammar-test": "^0.1.3" } } From 6a7a872849f87ea2d0948d0292b98bffa59b7979 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:39:24 +0800 Subject: [PATCH 56/58] Fixed CI workflow --- .github/workflows/node.js.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6dae351..ff1ba93 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -30,6 +30,6 @@ jobs: # For some reason, antlr4ng writes to a different location on the VM # than it does locally, preventing compile. Command added to move the generated files. - name: npm run antlr4ng - run: npm run antlr4ng && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out + run: npm run antlr4ng && npm run antlr4ngPre && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out - run: npm run compile - run: npm test diff --git a/package.json b/package.json index 42e90d6..87cf6ce 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ ] }, "scripts": { - "vscode:prepublish": "npm run antlr4ng && npm run compile", + "vscode:prepublish": "npm run antlr4ngPre && npm run antlr4ng && npm run compile", "compile": "tsc -b", "watch": "tsc -b -w", "lint": "eslint ./client/src ./server/src --ext .ts,.tsx", From f75eba3927e04e87bb516faef2ba968bb47719c0 Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 02:45:37 +0800 Subject: [PATCH 57/58] Added run compile textMate --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index ff1ba93..d61be15 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,6 +29,7 @@ jobs: - run: npm ci # For some reason, antlr4ng writes to a different location on the VM # than it does locally, preventing compile. Command added to move the generated files. + - run: npm run textMate - name: npm run antlr4ng run: npm run antlr4ng && npm run antlr4ngPre && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out - run: npm run compile From dfffd12ad321e483aeef1d34393fd15440f835ec Mon Sep 17 00:00:00 2001 From: sslinky Date: Wed, 15 Jan 2025 03:00:37 +0800 Subject: [PATCH 58/58] Fix testing in headless linux --- .github/workflows/node.js.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d61be15..ff46964 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -33,4 +33,7 @@ jobs: - name: npm run antlr4ng run: npm run antlr4ng && npm run antlr4ngPre && mv ./server/src/antlr/out/server/src/antlr/* ./server/src/antlr/out - run: npm run compile + - run: xvfb-run -a npm test + if: runner.os == 'Linux' - run: npm test + if: runner.os != 'Linux'