From 221065fd995d1fe4dd8589fdaf48a4d471e9837b Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Thu, 14 Sep 2023 20:03:37 +0200 Subject: [PATCH 1/8] feat: remove javascript/typescript and add rust --- .gitignore | 5 + Cargo.toml | 8 + decs.d.ts | 2 - package-lock.json | 943 ---------------------------------------------- package.json | 24 -- src/index.ts | 4 - src/main.rs | 3 + src/php.ts | 117 ------ src/server.ts | 66 ---- src/types.ts | 9 - src/xml.ts | 104 ----- tsconfig.json | 14 - yarn.lock | 636 ------------------------------- 13 files changed, 16 insertions(+), 1919 deletions(-) create mode 100644 Cargo.toml delete mode 100644 decs.d.ts delete mode 100644 package-lock.json delete mode 100644 package.json delete mode 100644 src/index.ts create mode 100644 src/main.rs delete mode 100644 src/php.ts delete mode 100644 src/server.ts delete mode 100644 src/types.ts delete mode 100644 src/xml.ts delete mode 100644 tsconfig.json delete mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index 72aae85..3c853e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ node_modules/ out/ + + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a405c74 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "magento2-ls" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/decs.d.ts b/decs.d.ts deleted file mode 100644 index aa1f580..0000000 --- a/decs.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare module 'tree-sitter-php'; -declare module 'tree-sitter-html'; diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 6199dea..0000000 --- a/package-lock.json +++ /dev/null @@ -1,943 +0,0 @@ -{ - "name": "magento2-ls", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "magento2-ls", - "version": "0.0.1", - "dependencies": { - "glob": "^10.2.1", - "tree-sitter": "^0.20.1", - "tree-sitter-html": "^0.19.0", - "tree-sitter-php": "^0.19.0", - "typescript": "^5.0.4", - "vscode-languageserver": "^8.1.0" - }, - "bin": { - "magento2-ls": "out/server.js" - }, - "devDependencies": { - "@types/node": "^18.15.11" - } - }, - "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==", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true - }, - "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==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "node_modules/are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "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==" - }, - "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==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "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==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "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==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "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==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/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==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/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==" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "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==" - }, - "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==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "dependencies": { - "mimic-response": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "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==" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/gauge/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/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==" - }, - "node_modules/gauge/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gauge/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" - }, - "node_modules/glob": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.1.tgz", - "integrity": "sha512-ngom3wq2UhjdbmRE/krgkD8BQyi1KZ5l+D2dVm4+Yj+jJIBp74/ZGunL6gNGc/CYuQmvUBiavWEXIotRiv5R6A==", - "dependencies": { - "foreground-child": "^3.1.0", - "fs.realpath": "^1.0.0", - "jackspeak": "^2.0.3", - "minimatch": "^9.0.0", - "minipass": "^5.0.0", - "path-scurry": "^1.7.0" - }, - "bin": { - "glob": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/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==", - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/jackspeak": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.0.3.tgz", - "integrity": "sha512-0Jud3OMUdMbrlr3PyUMKESq51LXVAB+a239Ywdvd+Kgxj3MaBRml/nVRxf8tQFyfthMjuRkxkv7Vg58pmIMfuQ==", - "dependencies": { - "cliui": "^7.0.4" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/lru-cache": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.0.tgz", - "integrity": "sha512-qFXQEwchrZcMVen2uIDceR8Tii6kCJak5rzDStfEM0qA3YLMswaxIEZO0DhIbJ3aqaJiDjt+3crlplOb0tDtKQ==", - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimatch": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", - "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, - "node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" - }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, - "node_modules/node-abi": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", - "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", - "dependencies": { - "semver": "^5.4.1" - } - }, - "node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "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==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.7.0.tgz", - "integrity": "sha512-UkZUeDjczjYRE495+9thsgcVgsaCPkaw80slmfVFgllxY+IO8ubTsOpFVjDPROBqJdHfVPUFRHPBV/WciOVfWg==", - "dependencies": { - "lru-cache": "^9.0.0", - "minipass": "^5.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/prebuild-install": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", - "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", - "dependencies": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.21.0", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=6" - } - }, - "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==" - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "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==", - "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/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==" - }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "node_modules/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==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz", - "integrity": "sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/simple-get": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", - "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", - "dependencies": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "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==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "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==", - "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", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar-stream/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==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/tree-sitter": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.20.1.tgz", - "integrity": "sha512-Cmb8V0ocamHbgWMVhZIa+78k/7r8VCQ6+ePG8eYEAO7AccwWi06Ct4ATNiI94KwhIkRl0+OwZ42/5nk3GnEMpQ==", - "hasInstallScript": true, - "dependencies": { - "nan": "^2.14.0", - "prebuild-install": "^6.0.1" - } - }, - "node_modules/tree-sitter-html": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/tree-sitter-html/-/tree-sitter-html-0.19.0.tgz", - "integrity": "sha512-xH6XGSBWzb4oU/aG6gouMRQKsd96iKuy0zboUqo3wcIWrA++q9a7CmQTSeIINiSfOXjT2ZLJciXFDgAh6h04Bw==", - "hasInstallScript": true, - "dependencies": { - "nan": "^2.14.0" - } - }, - "node_modules/tree-sitter-php": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/tree-sitter-php/-/tree-sitter-php-0.19.0.tgz", - "integrity": "sha512-YchOF4ai+CIP8AMHuNDohEOG4T+9+6YwVqyNwWS9+BIBze41D32V9FCc88/v4W5YRvvCdRqJk8V+hWtnCHrUcw==", - "hasInstallScript": true, - "dependencies": { - "nan": "^2.14.0" - } - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=12.20" - } - }, - "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==" - }, - "node_modules/vscode-jsonrpc": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", - "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/vscode-languageserver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", - "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", - "dependencies": { - "vscode-languageserver-protocol": "3.17.3" - }, - "bin": { - "installServerIntoExtension": "bin/installServerIntoExtension" - } - }, - "node_modules/vscode-languageserver-protocol": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", - "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", - "dependencies": { - "vscode-jsonrpc": "8.1.0", - "vscode-languageserver-types": "3.17.3" - } - }, - "node_modules/vscode-languageserver-types": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", - "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "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==", - "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", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 785192d..0000000 --- a/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "magento2-ls", - "type": "module", - "version": "0.0.1", - "dependencies": { - "glob": "^10.2.1", - "tree-sitter": "^0.20.1", - "tree-sitter-html": "^0.19.0", - "tree-sitter-php": "^0.19.0", - "typescript": "^5.0.4", - "vscode-languageserver": "^8.1.0" - }, - "devDependencies": { - "@types/node": "^18.15.11" - }, - "scripts": { - "dev": "npm run-script build && npm link", - "watch": "tsc --watch", - "build": "tsc" - }, - "bin": { - "magento2-ls": "./out/server.js" - } -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 12703d0..0000000 --- a/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node - -import { collectPhpClasses } from './php.js' - diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/src/php.ts b/src/php.ts deleted file mode 100644 index 81a9594..0000000 --- a/src/php.ts +++ /dev/null @@ -1,117 +0,0 @@ -import Parser from 'tree-sitter'; -import Php from 'tree-sitter-php'; -import { glob } from 'glob'; -import fs from 'fs'; - -const phpClasses: Map = new Map(); - -const query_string = ` - (namespace_definition (namespace_name) @namespace) ; pattern: 0 - (class_declaration (name) @class) ; pattern: 1 - (interface_declaration (name) @class) ; pattern: 2 - ((method_declaration (visibility_modifier) - @_vis (name) @name) (#eq? @_vis "public")) ; pattern: 3 -`; - -const parser = new Parser(); -parser.setLanguage(Php); -const query = new Parser.Query(Php, query_string); - -export class PHPClass { - fqn: string; - cls: Parser.SyntaxNode; - methods: Parser.SyntaxNode[]; - file: string; - - constructor( - namespace: Parser.SyntaxNode, - cls: Parser.SyntaxNode, - methods: Parser.SyntaxNode[], - file: string - ) { - this.fqn = namespace.text + '\\' + cls.text; - this.cls = cls; - this.methods = methods; - this.file = file; - } -} - -const trimLength = 'registration.php'.length; - -export function getLocation(fqn: string, method: string | null = null) { - let phpClass = phpClasses.get(fqn); - - if (phpClass == null) { - return null; - } - - let node = phpClass.cls; - if (method != null) { - phpClass.methods.forEach((m) => { - if (m.text == method) { - node = m; - } - }); - } - - return { - file: phpClass.file, - start: { - line: node.startPosition.row, - character: node.startPosition.column - }, - end: { - line: node.endPosition.row, - character: node.endPosition.column - } - }; -} - -export function collectPhpClasses(dir: string) { - dir = dir.endsWith('/') ? dir : dir + '/'; - glob(dir + '**/registration.php').then((modules) => { - modules.forEach((module) => { - glob(module.slice(0, -trimLength) + '**/*.php').then((files) => { - files.forEach((file) => { - if (file.endsWith('Test.php')) { - return; - } - if (fs.statSync(file).isFile()) { - let tree = parser.parse(fs.readFileSync(file, 'utf8')); - // console.log(tree.rootNode.toString()) - let matches = query.matches(tree.rootNode); - if (matches.length > 1) { - let ns = null; - let cls = null; - let methods: Parser.SyntaxNode[] = []; - - matches.forEach((match) => { - if (match.pattern == 0) { - ns = match.captures[0].node; - } - if (match.pattern == 1 || match.pattern == 2) { - cls = match.captures[0].node; - } - if (match.pattern == 3) { - methods.push(match.captures[1].node); - } - }); - - if (!ns || !cls) { - return; - } - - let php = new PHPClass( - ns, - cls, - methods, - file - ); - phpClasses.set(php.fqn, php); - } - } - }); - }); - }); - }); -} diff --git a/src/server.ts b/src/server.ts deleted file mode 100644 index 580f1db..0000000 --- a/src/server.ts +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env node - -import { getLocation, collectPhpClasses } from './php.js'; -import { getAtPosition } from './xml.js'; - -import { - createConnection, - InitializeParams, - InitializeResult, - ProposedFeatures, - Location, - Definition, -} from "vscode-languageserver/node.js"; - -let connection = createConnection(ProposedFeatures.all); - -connection.onInitialize((params: InitializeParams) => { - if (params.workspaceFolders) { - params.workspaceFolders.forEach((folder) => { - let path = folder.uri.slice(7); // get rid of file:// - collectPhpClasses(path); - }); - } - - const result: InitializeResult = { - capabilities: { - definitionProvider: true, - declarationProvider: true, - }, - }; - return result; -}); - -interface Settings { } - -const defaultSettings: Settings = {}; -let globalSettings: Settings = defaultSettings; - - -connection.onDidChangeConfiguration((change) => { - globalSettings = change.settings; -}); - -connection.onDefinition((params): Definition | null => { - let token = getAtPosition(params.textDocument.uri, params.position); - if (token == null) { - return null; - } - let location; - if (typeof token == "string") { - location = getLocation(token); - } else { - location = getLocation(token.class_name, token.method_name); - } - - if (location == null) { - return null; - } - - return Location.create('file://' + location.file, { - start: location.start, - end: location.end - }); -}); - -connection.listen(); diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 027e81a..0000000 --- a/src/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Position { - line: number, - character: number -} - -export interface Callable { - class_name: string, - method_name: string | null -} diff --git a/src/xml.ts b/src/xml.ts deleted file mode 100644 index 2836a37..0000000 --- a/src/xml.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Position, Callable } from './types.js'; -import Parser from 'tree-sitter'; -import Xml from 'tree-sitter-html'; -import fs from 'fs'; - -const query_string = ` -(attribute_value) @attr -(text) @text - -(self_closing_tag (tag_name) - (attribute (attribute_name ) @_attr2 (#eq? @_attr2 "class") - (quoted_attribute_value (attribute_value) @class)) - ) @callable -(self_closing_tag (tag_name) - (attribute (attribute_name) @_attr (#eq? @_attr "method") - (quoted_attribute_value (attribute_value) @method)) - ) @callable -(self_closing_tag (tag_name) @_name - (attribute (attribute_name ) @_attr2 (#eq? @_attr2 "instance") - (quoted_attribute_value (attribute_value) @class)) - ) @callable -(start_tag (tag_name) - (attribute (attribute_name ) @_attr2 (#eq? @_attr2 "class") - (quoted_attribute_value (attribute_value) @class)) - ) @callable -(start_tag (tag_name) - (attribute (attribute_name) @_attr (#eq? @_attr "method") - (quoted_attribute_value (attribute_value) @method)) - ) @callable -(start_tag (tag_name) @_name - (attribute (attribute_name ) @_attr2 (#eq? @_attr2 "instance") - (quoted_attribute_value (attribute_value) @class)) - ) @callable -`; - -const parser = new Parser(); -parser.setLanguage(Xml); -const query = new Parser.Query(Xml, query_string); - -const getCallable = (node: Parser.SyntaxNode): Callable | null => { - let class_name = null; - let method_name = null; - node.namedChildren.forEach((child) => { - if (child.type == 'attribute') { - if (['class', 'instance'].includes(child.namedChildren[0].text)) { - class_name = child.namedChildren[1].namedChildren[0].text; - } - if (child.namedChildren[0].text == 'method') { - method_name = child.namedChildren[1].namedChildren[0].text; - } - } - }); - if (class_name == null) { - return null; - } - return { class_name, method_name }; -}; - -export const getAtPosition = (file: string, position: Position): Callable | string | null => { - file = file.slice(7); // get rid of file:// - let tree = parser.parse(fs.readFileSync(file, 'utf8')); - - let matches = query.matches(tree.rootNode); - - let node_text: string | null = null; - let callable: null | Callable = null; - - matches.forEach((match) => { - let node = match.captures[0].node; - if ( - node.startPosition.row <= position.line - && node.endPosition.row >= position.line - && node.startPosition.column <= position.character - && node.endPosition.column - 1 >= position.character - ) { - if (node.type == 'attribute_value' || node.type == 'text') { - node_text = node.text; - } - if (node.type == 'self_closing_tag' || node.type == 'start_tag') { - callable = getCallable(node); - } - } - }); - - if (!node_text) { - return null; - } - - node_text = node_text as string; - - if (node_text.startsWith('\\')) { - node_text = node_text.slice(1); - } - - if (callable != null) { - callable = callable as Callable; - - if (callable.method_name == node_text || callable.class_name == node_text) { - return callable; - } - } - - return node_text; -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 1804659..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "target": "es2020", - "lib": ["ES2020"], - "rootDir": "src", - "moduleResolution": "node", - "allowJs": true, - "outDir": "out", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true - } -} diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index f6cd822..0000000 --- a/yarn.lock +++ /dev/null @@ -1,636 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@pkgjs/parseargs@^0.11.0": - version "0.11.0" - resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz" - integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== - -"@types/node@^18.15.11": - version "18.15.11" - resolved "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz" - integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" - integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.0.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.7" - resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz" - integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -cliui@^7.0.4: - version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" - integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" - integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cross-spawn@^7.0.0: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -decompress-response@^4.2.0: - version "4.2.1" - resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz" - integrity sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw== - dependencies: - mimic-response "^2.0.0" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" - integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== - -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" - integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -expand-template@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz" - integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== - -foreground-child@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz" - integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== - dependencies: - cross-spawn "^7.0.0" - signal-exit "^4.0.1" - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" - integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -github-from-package@0.0.0: - version "0.0.0" - resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" - integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== - -glob@^10.2.1: - version "10.2.1" - resolved "https://registry.npmjs.org/glob/-/glob-10.2.1.tgz" - integrity sha512-ngom3wq2UhjdbmRE/krgkD8BQyi1KZ5l+D2dVm4+Yj+jJIBp74/ZGunL6gNGc/CYuQmvUBiavWEXIotRiv5R6A== - dependencies: - foreground-child "^3.1.0" - fs.realpath "^1.0.0" - jackspeak "^2.0.3" - minimatch "^9.0.0" - minipass "^5.0.0" - path-scurry "^1.7.0" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" - integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@~1.3.0: - version "1.3.8" - resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" - integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^3.0.0: - 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== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -jackspeak@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/jackspeak/-/jackspeak-2.0.3.tgz" - integrity sha512-0Jud3OMUdMbrlr3PyUMKESq51LXVAB+a239Ywdvd+Kgxj3MaBRml/nVRxf8tQFyfthMjuRkxkv7Vg58pmIMfuQ== - dependencies: - cliui "^7.0.4" - optionalDependencies: - "@pkgjs/parseargs" "^0.11.0" - -lru-cache@^9.0.0: - version "9.1.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.0.tgz" - integrity sha512-qFXQEwchrZcMVen2uIDceR8Tii6kCJak5rzDStfEM0qA3YLMswaxIEZO0DhIbJ3aqaJiDjt+3crlplOb0tDtKQ== - -mimic-response@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz" - integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== - -minimatch@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz" - integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== - dependencies: - brace-expansion "^2.0.1" - -minimist@^1.2.0, minimist@^1.2.3: - version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== - -mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: - version "0.5.3" - resolved "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz" - integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== - -nan@^2.14.0: - version "2.17.0" - resolved "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz" - integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== - -napi-build-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz" - integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== - -node-abi@^2.21.0: - version "2.30.1" - resolved "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz" - integrity sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w== - dependencies: - semver "^5.4.1" - -npmlog@^4.0.1: - version "4.1.2" - resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" - integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-scurry@^1.7.0: - version "1.7.0" - resolved "https://registry.npmjs.org/path-scurry/-/path-scurry-1.7.0.tgz" - integrity sha512-UkZUeDjczjYRE495+9thsgcVgsaCPkaw80slmfVFgllxY+IO8ubTsOpFVjDPROBqJdHfVPUFRHPBV/WciOVfWg== - dependencies: - lru-cache "^9.0.0" - minipass "^5.0.0" - -prebuild-install@^6.0.1: - version "6.1.4" - resolved "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz" - integrity sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ== - dependencies: - detect-libc "^1.0.3" - expand-template "^2.0.3" - github-from-package "0.0.0" - minimist "^1.2.3" - mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" - node-abi "^2.21.0" - npmlog "^4.0.1" - pump "^3.0.0" - rc "^1.2.7" - simple-get "^3.0.3" - tar-fs "^2.0.0" - tunnel-agent "^0.6.0" - -process-nextick-args@~2.0.0: - 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== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.0.6: - version "2.3.8" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" - integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== - 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" - -readable-stream@^3.1.1: - version "3.6.2" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^3.4.0: - version "3.6.2" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -semver@^5.4.1: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.0: - version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -signal-exit@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.1.tgz" - integrity sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw== - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^3.0.3: - version "3.1.1" - resolved "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz" - integrity sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA== - dependencies: - decompress-response "^4.2.0" - once "^1.3.1" - simple-concat "^1.0.0" - -string_decoder@^1.1.1, string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" - integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== - -tar-fs@^2.0.0: - version "2.1.1" - resolved "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz" - integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.1.4" - -tar-stream@^2.1.4: - version "2.2.0" - resolved "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -tree-sitter-html@^0.19.0: - version "0.19.0" - resolved "https://registry.npmjs.org/tree-sitter-html/-/tree-sitter-html-0.19.0.tgz" - integrity sha512-xH6XGSBWzb4oU/aG6gouMRQKsd96iKuy0zboUqo3wcIWrA++q9a7CmQTSeIINiSfOXjT2ZLJciXFDgAh6h04Bw== - dependencies: - nan "^2.14.0" - -tree-sitter-php@^0.19.0: - version "0.19.0" - resolved "https://registry.npmjs.org/tree-sitter-php/-/tree-sitter-php-0.19.0.tgz" - integrity sha512-YchOF4ai+CIP8AMHuNDohEOG4T+9+6YwVqyNwWS9+BIBze41D32V9FCc88/v4W5YRvvCdRqJk8V+hWtnCHrUcw== - dependencies: - nan "^2.14.0" - -tree-sitter@^0.20.1: - version "0.20.1" - resolved "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.20.1.tgz" - integrity sha512-Cmb8V0ocamHbgWMVhZIa+78k/7r8VCQ6+ePG8eYEAO7AccwWi06Ct4ATNiI94KwhIkRl0+OwZ42/5nk3GnEMpQ== - dependencies: - nan "^2.14.0" - prebuild-install "^6.0.1" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -typescript@^5.0.4: - version "5.0.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -vscode-jsonrpc@8.1.0: - version "8.1.0" - resolved "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz" - integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== - -vscode-languageserver-protocol@3.17.3: - version "3.17.3" - resolved "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz" - integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== - dependencies: - vscode-jsonrpc "8.1.0" - vscode-languageserver-types "3.17.3" - -vscode-languageserver-types@3.17.3: - version "3.17.3" - resolved "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz" - integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== - -vscode-languageserver@^8.1.0: - version "8.1.0" - resolved "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz" - integrity sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw== - dependencies: - vscode-languageserver-protocol "3.17.3" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.5" - resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz" - integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== - dependencies: - string-width "^1.0.2 || 2 || 3 || 4" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== From 523db2a214185ab47bb67f712f016736a7246124 Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Thu, 14 Sep 2023 20:30:28 +0200 Subject: [PATCH 2/8] feat: add example lsp goto definition --- Cargo.lock | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 4 + src/main.rs | 96 +++++++++++++++++++++- 3 files changed, 329 insertions(+), 2 deletions(-) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..59217c7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,231 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lsp-server" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52dccdf3302eefab8c8a1273047f0a3c3dca4b527c8458d00c09484c8371928" +dependencies = [ + "crossbeam-channel", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "lsp-types" +version = "0.94.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" +dependencies = [ + "bitflags", + "serde", + "serde_json", + "serde_repr", + "url", +] + +[[package]] +name = "magento2-ls" +version = "0.1.0" +dependencies = [ + "lsp-server", + "lsp-types", + "serde", + "serde_json", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "proc-macro2" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] diff --git a/Cargo.toml b/Cargo.toml index a405c74..ef931f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +lsp-server = "0.7.4" +lsp-types = "0.94.1" +serde = { version = "1.0.188", features = ["derive"] } +serde_json = "1.0.107" diff --git a/src/main.rs b/src/main.rs index e7a11a9..6abcd52 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,95 @@ -fn main() { - println!("Hello, world!"); +use std::error::Error; + +use lsp_types::{ + request::GotoDefinition, GotoDefinitionResponse, InitializeParams, ServerCapabilities, +}; +use lsp_types::{Location, OneOf, Position, Range, Url}; + +use lsp_server::{Connection, ExtractError, Message, Request, RequestId, Response}; + +fn main() -> Result<(), Box> { + // Note that we must have our logging only write out to stderr. + eprintln!("starting generic LSP server"); + + // Create the transport. Includes the stdio (stdin and stdout) versions but this could + // also be implemented to use sockets or HTTP. + let (connection, io_threads) = Connection::stdio(); + + // Run the server and wait for the two threads to end (typically by trigger LSP Exit event). + let server_capabilities = serde_json::to_value(&ServerCapabilities { + definition_provider: Some(OneOf::Left(true)), + ..Default::default() + }) + .unwrap(); + let initialization_params = connection.initialize(server_capabilities)?; + main_loop(connection, initialization_params)?; + io_threads.join()?; + + // Shut down gracefully. + eprintln!("shutting down server"); + Ok(()) +} + +fn main_loop( + connection: Connection, + params: serde_json::Value, +) -> Result<(), Box> { + let _params: InitializeParams = serde_json::from_value(params).unwrap(); + eprintln!("starting example main loop"); + for msg in &connection.receiver { + eprintln!("got msg: {msg:?}"); + match msg { + Message::Request(req) => { + if connection.handle_shutdown(&req)? { + return Ok(()); + } + eprintln!("got request: {req:?}"); + match cast::(req) { + Ok((id, params)) => { + eprintln!("got gotoDefinition request #{id}: {params:?}"); + let loc = Location { + uri: Url::from_file_path("/tmp/foo.rs").unwrap(), + range: Range { + start: Position { + line: 0, + character: 0, + }, + end: Position { + line: 0, + character: 0, + }, + }, + }; + let result = Some(GotoDefinitionResponse::Array(vec![loc])); + let result = serde_json::to_value(&result).unwrap(); + let resp = Response { + id, + result: Some(result), + error: None, + }; + connection.sender.send(Message::Response(resp))?; + continue; + } + Err(err @ ExtractError::JsonError { .. }) => panic!("{err:?}"), + Err(ExtractError::MethodMismatch(req)) => req, + }; + // ... + } + Message::Response(resp) => { + eprintln!("got response: {resp:?}"); + } + Message::Notification(not) => { + eprintln!("got notification: {not:?}"); + } + } + } + Ok(()) +} + +fn cast(req: Request) -> Result<(RequestId, R::Params), ExtractError> +where + R: lsp_types::request::Request, + R::Params: serde::de::DeserializeOwned, +{ + req.extract(R::METHOD) } From 0cf23bb32695ab27924c27e169c2f345009f98f9 Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Mon, 18 Sep 2023 10:27:42 +0200 Subject: [PATCH 3/8] feat: add php file parse function --- Cargo.lock | 91 +++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 + src/main.rs | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 208 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 59217c7..5888699 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,31 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -58,6 +77,21 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "libc" +version = "0.2.148" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" + [[package]] name = "log" version = "0.4.20" @@ -97,8 +131,16 @@ dependencies = [ "lsp-types", "serde", "serde_json", + "tree-sitter", + "tree-sitter-parsers", ] +[[package]] +name = "memchr" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -123,6 +165,35 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "regex" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "ryu" version = "1.0.15" @@ -197,6 +268,26 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tree-sitter" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +dependencies = [ + "cc", + "regex", +] + +[[package]] +name = "tree-sitter-parsers" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c15d2f5d9d5e4a7579210e5b57d1e125c7c89325ebe35729b03a28656a705c4" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "unicode-bidi" version = "0.3.13" diff --git a/Cargo.toml b/Cargo.toml index ef931f9..8cedf11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,5 @@ lsp-server = "0.7.4" lsp-types = "0.94.1" serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.107" +tree-sitter = "0.20.10" +tree-sitter-parsers = "0.0.5" diff --git a/src/main.rs b/src/main.rs index 6abcd52..00b716c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,14 @@ +use std::collections::HashMap; use std::error::Error; +use std::path::PathBuf; use lsp_types::{ request::GotoDefinition, GotoDefinitionResponse, InitializeParams, ServerCapabilities, }; -use lsp_types::{Location, OneOf, Position, Range, Url}; +use lsp_types::{GotoDefinitionParams, Location, OneOf, Position, Range, Url}; use lsp_server::{Connection, ExtractError, Message, Request, RequestId, Response}; +use tree_sitter::{Node, Query, QueryCursor}; fn main() -> Result<(), Box> { // Note that we must have our logging only write out to stderr. @@ -86,6 +89,117 @@ fn main_loop( Ok(()) } +#[derive(Debug)] +struct PHPClass { + fqn: String, + uri: Url, + range: Range, + methods: Vec, +} + +#[derive(Debug)] +struct PHPMethod { + name: String, + range: Range, +} + +fn get_range_from_node(node: Node) -> Range { + Range { + start: Position { + line: node.start_position().row as u32, + character: node.start_position().column as u32, + }, + end: Position { + line: node.end_position().row as u32, + character: node.end_position().column as u32, + }, + } +} + +fn get_location_from_node(path: PathBuf, node: Node) -> Location { + Location { + uri: Url::from_file_path(path.clone()).unwrap(), + range: get_range_from_node(node), + } +} + +fn parse_php_file(file_path: PathBuf) -> Option { + let query_string = " + (namespace_definition (namespace_name) @namespace) ; pattern: 0 + (class_declaration (name) @class) ; pattern: 1 + (interface_declaration (name) @class) ; pattern: 2 + ((method_declaration (visibility_modifier) + @_vis (name) @name) (#eq? @_vis \"public\")) ; pattern: 3 + "; + + let content = + std::fs::read_to_string(&file_path).expect("Should have been able to read the file"); + + let tree = tree_sitter_parsers::parse(&content, "php"); + let query = Query::new(tree.language(), &query_string) + .map_err(|e| eprintln!("Error creating query: {:?}", e)) + .unwrap(); + + let mut cursor = QueryCursor::new(); + let matches = cursor.matches(&query, tree.root_node(), content.as_bytes()); + + let mut ns: Option = None; + let mut cls: Option = None; + let mut methods: Vec = vec![]; + + for m in matches { + if m.pattern_index == 0 { + ns = Some(m.captures[0].node); + } + if m.pattern_index == 1 || m.pattern_index == 2 { + cls = Some(m.captures[0].node); + } + if m.pattern_index == 3 { + let method_node = m.captures[1].node; + let method_name = method_node.utf8_text(&content.as_bytes()).unwrap_or(""); + if method_name != "" { + methods.push(PHPMethod { + name: method_name.to_string(), + range: get_range_from_node(method_node), + }); + } + } + } + + if ns.is_none() || cls.is_none() { + return None; + } + + let ns_node = ns.expect("ns is some"); + let cls_node = cls.expect("cls is some"); + let ns_text = ns_node.utf8_text(&content.as_bytes()).unwrap_or(""); + let cls_text = cls_node.utf8_text(&content.as_bytes()).unwrap_or(""); + + let fqn = ns_text.to_string() + "\\" + cls_text; + if fqn == "\\" { + return None; + } + + let uri = Url::from_file_path(file_path.clone()).unwrap(); + let range = Range { + start: Position { + line: cls_node.start_position().row as u32, + character: cls_node.start_position().column as u32, + }, + end: Position { + line: cls_node.end_position().row as u32, + character: cls_node.end_position().column as u32, + }, + }; + + return Some(PHPClass { + fqn, + uri, + range, + methods, + }); +} + fn cast(req: Request) -> Result<(RequestId, R::Params), ExtractError> where R: lsp_types::request::Request, From 2293be5590e866ac574567407f09c38cc148bafd Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Mon, 18 Sep 2023 15:54:19 +0200 Subject: [PATCH 4/8] refactor: split code into modules --- src/main.rs | 118 +++------------------------------------------------- src/php.rs | 97 ++++++++++++++++++++++++++++++++++++++++++ src/ts.rs | 15 +++++++ 3 files changed, 117 insertions(+), 113 deletions(-) create mode 100644 src/php.rs create mode 100644 src/ts.rs diff --git a/src/main.rs b/src/main.rs index 00b716c..e4a566e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,7 @@ +mod php; +mod ts; + +use php::*; use std::collections::HashMap; use std::error::Error; use std::path::PathBuf; @@ -5,10 +9,9 @@ use std::path::PathBuf; use lsp_types::{ request::GotoDefinition, GotoDefinitionResponse, InitializeParams, ServerCapabilities, }; -use lsp_types::{GotoDefinitionParams, Location, OneOf, Position, Range, Url}; +use lsp_types::{GotoDefinitionParams, Location, OneOf}; use lsp_server::{Connection, ExtractError, Message, Request, RequestId, Response}; -use tree_sitter::{Node, Query, QueryCursor}; fn main() -> Result<(), Box> { // Note that we must have our logging only write out to stderr. @@ -89,117 +92,6 @@ fn main_loop( Ok(()) } -#[derive(Debug)] -struct PHPClass { - fqn: String, - uri: Url, - range: Range, - methods: Vec, -} - -#[derive(Debug)] -struct PHPMethod { - name: String, - range: Range, -} - -fn get_range_from_node(node: Node) -> Range { - Range { - start: Position { - line: node.start_position().row as u32, - character: node.start_position().column as u32, - }, - end: Position { - line: node.end_position().row as u32, - character: node.end_position().column as u32, - }, - } -} - -fn get_location_from_node(path: PathBuf, node: Node) -> Location { - Location { - uri: Url::from_file_path(path.clone()).unwrap(), - range: get_range_from_node(node), - } -} - -fn parse_php_file(file_path: PathBuf) -> Option { - let query_string = " - (namespace_definition (namespace_name) @namespace) ; pattern: 0 - (class_declaration (name) @class) ; pattern: 1 - (interface_declaration (name) @class) ; pattern: 2 - ((method_declaration (visibility_modifier) - @_vis (name) @name) (#eq? @_vis \"public\")) ; pattern: 3 - "; - - let content = - std::fs::read_to_string(&file_path).expect("Should have been able to read the file"); - - let tree = tree_sitter_parsers::parse(&content, "php"); - let query = Query::new(tree.language(), &query_string) - .map_err(|e| eprintln!("Error creating query: {:?}", e)) - .unwrap(); - - let mut cursor = QueryCursor::new(); - let matches = cursor.matches(&query, tree.root_node(), content.as_bytes()); - - let mut ns: Option = None; - let mut cls: Option = None; - let mut methods: Vec = vec![]; - - for m in matches { - if m.pattern_index == 0 { - ns = Some(m.captures[0].node); - } - if m.pattern_index == 1 || m.pattern_index == 2 { - cls = Some(m.captures[0].node); - } - if m.pattern_index == 3 { - let method_node = m.captures[1].node; - let method_name = method_node.utf8_text(&content.as_bytes()).unwrap_or(""); - if method_name != "" { - methods.push(PHPMethod { - name: method_name.to_string(), - range: get_range_from_node(method_node), - }); - } - } - } - - if ns.is_none() || cls.is_none() { - return None; - } - - let ns_node = ns.expect("ns is some"); - let cls_node = cls.expect("cls is some"); - let ns_text = ns_node.utf8_text(&content.as_bytes()).unwrap_or(""); - let cls_text = cls_node.utf8_text(&content.as_bytes()).unwrap_or(""); - - let fqn = ns_text.to_string() + "\\" + cls_text; - if fqn == "\\" { - return None; - } - - let uri = Url::from_file_path(file_path.clone()).unwrap(); - let range = Range { - start: Position { - line: cls_node.start_position().row as u32, - character: cls_node.start_position().column as u32, - }, - end: Position { - line: cls_node.end_position().row as u32, - character: cls_node.end_position().column as u32, - }, - }; - - return Some(PHPClass { - fqn, - uri, - range, - methods, - }); -} - fn cast(req: Request) -> Result<(RequestId, R::Params), ExtractError> where R: lsp_types::request::Request, diff --git a/src/php.rs b/src/php.rs new file mode 100644 index 0000000..d60ff7c --- /dev/null +++ b/src/php.rs @@ -0,0 +1,97 @@ +use std::path::PathBuf; + +use lsp_types::{Position, Range, Url}; +use tree_sitter::{Node, Query, QueryCursor}; + +use crate::ts::get_range_from_node; + +#[derive(Debug)] +pub struct PHPClass { + pub fqn: String, + pub uri: Url, + pub range: Range, + pub methods: Vec, +} + +#[derive(Debug)] +pub struct PHPMethod { + pub name: String, + pub range: Range, +} + +pub fn parse_php_file(file_path: PathBuf) -> Option { + let query_string = " + (namespace_definition (namespace_name) @namespace) ; pattern: 0 + (class_declaration (name) @class) ; pattern: 1 + (interface_declaration (name) @class) ; pattern: 2 + ((method_declaration (visibility_modifier) + @_vis (name) @name) (#eq? @_vis \"public\")) ; pattern: 3 + "; + + let content = + std::fs::read_to_string(&file_path).expect("Should have been able to read the file"); + + let tree = tree_sitter_parsers::parse(&content, "php"); + let query = Query::new(tree.language(), &query_string) + .map_err(|e| eprintln!("Error creating query: {:?}", e)) + .unwrap(); + + let mut cursor = QueryCursor::new(); + let matches = cursor.matches(&query, tree.root_node(), content.as_bytes()); + + let mut ns: Option = None; + let mut cls: Option = None; + let mut methods: Vec = vec![]; + + for m in matches { + if m.pattern_index == 0 { + ns = Some(m.captures[0].node); + } + if m.pattern_index == 1 || m.pattern_index == 2 { + cls = Some(m.captures[0].node); + } + if m.pattern_index == 3 { + let method_node = m.captures[1].node; + let method_name = method_node.utf8_text(&content.as_bytes()).unwrap_or(""); + if method_name != "" { + methods.push(PHPMethod { + name: method_name.to_string(), + range: get_range_from_node(method_node), + }); + } + } + } + + if ns.is_none() || cls.is_none() { + return None; + } + + let ns_node = ns.expect("ns is some"); + let cls_node = cls.expect("cls is some"); + let ns_text = ns_node.utf8_text(&content.as_bytes()).unwrap_or(""); + let cls_text = cls_node.utf8_text(&content.as_bytes()).unwrap_or(""); + + let fqn = ns_text.to_string() + "\\" + cls_text; + if fqn == "\\" { + return None; + } + + let uri = Url::from_file_path(file_path.clone()).unwrap(); + let range = Range { + start: Position { + line: cls_node.start_position().row as u32, + character: cls_node.start_position().column as u32, + }, + end: Position { + line: cls_node.end_position().row as u32, + character: cls_node.end_position().column as u32, + }, + }; + + return Some(PHPClass { + fqn, + uri, + range, + methods, + }); +} diff --git a/src/ts.rs b/src/ts.rs new file mode 100644 index 0000000..0f5c758 --- /dev/null +++ b/src/ts.rs @@ -0,0 +1,15 @@ +use lsp_types::{Position, Range}; +use tree_sitter::Node; + +pub fn get_range_from_node(node: Node) -> Range { + Range { + start: Position { + line: node.start_position().row as u32, + character: node.start_position().column as u32, + }, + end: Position { + line: node.end_position().row as u32, + character: node.end_position().column as u32, + }, + } +} From 865cdb2e9de415745432a1641435ebeca87ad78a Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Mon, 18 Sep 2023 18:20:38 +0200 Subject: [PATCH 5/8] feat: add project indexer --- src/main.rs | 14 ++++++++++--- src/php.rs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index e4a566e..e9af579 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use lsp_types::{ request::GotoDefinition, GotoDefinitionResponse, InitializeParams, ServerCapabilities, }; -use lsp_types::{GotoDefinitionParams, Location, OneOf}; +use lsp_types::{GotoDefinitionParams, Location, OneOf, Url}; use lsp_server::{Connection, ExtractError, Message, Request, RequestId, Response}; @@ -38,9 +38,17 @@ fn main() -> Result<(), Box> { fn main_loop( connection: Connection, - params: serde_json::Value, + init_params: serde_json::Value, ) -> Result<(), Box> { - let _params: InitializeParams = serde_json::from_value(params).unwrap(); + let params: InitializeParams = serde_json::from_value(init_params).unwrap(); + + eprintln!("starting indexer"); + let mut map: HashMap = HashMap::new(); + // TODO make it in parallel or in separate thread + params.root_uri.map(|uri| { + parse_php_files(&mut map, PathBuf::from(uri.path())); + }); + eprintln!("starting example main loop"); for msg in &connection.receiver { eprintln!("got msg: {msg:?}"); diff --git a/src/php.rs b/src/php.rs index d60ff7c..45cc93b 100644 --- a/src/php.rs +++ b/src/php.rs @@ -1,5 +1,6 @@ -use std::path::PathBuf; +use std::{collections::HashMap, path::PathBuf}; +use glob::glob; use lsp_types::{Position, Range, Url}; use tree_sitter::{Node, Query, QueryCursor}; @@ -19,6 +20,61 @@ pub struct PHPMethod { pub range: Range, } +pub fn parse_php_files(map: &mut HashMap, path: PathBuf) { + let path_str = path.to_str().expect("Correct path is required").to_string(); + let tmp_modules = + glob((path_str + "/**/registration.php").as_str()).expect("Failed to read glob pattern"); + + let mut progress_max = 0; + let mut modules = vec![]; + for module in tmp_modules { + progress_max += 1; + modules.push(module); + } + let mut progress_cur = 0; + for module in modules { + progress_cur += 1; + eprintln!("Index Progress: {}/{}", progress_cur, progress_max); + match module { + Ok(path) => { + let path_str = path.to_str().expect("path error"); + let files = glob( + (path_str[..path_str.len() - "/registration.php".len()].to_string() + + "/**/*.php") + .as_str(), + ) + .expect("Failed to read glob pattern"); + for file in files { + match file { + Ok(path) => { + if path.to_str().unwrap_or("").ends_with("Test.php") { + continue; + } + if path.to_str().unwrap_or("").contains("/dev/tests/") { + continue; + } + // TODO get from settings or somethign + if path.to_str().unwrap_or("").contains("/vendor/") { + continue; + } + if path.is_file() { + match parse_php_file(path) { + Some(cls) => { + map.insert(cls.fqn.clone(), cls); + } + None => {} + } + } + } + Err(e) => eprintln!("{:?}", e), + } + } + } + Err(e) => eprintln!("{:?}", e), + } + } +} + pub fn parse_php_file(file_path: PathBuf) -> Option { let query_string = " (namespace_definition (namespace_name) @namespace) ; pattern: 0 From ec244e17ccf7b5045bdedb34a9c57e5bf568d7c7 Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Mon, 18 Sep 2023 20:24:08 +0200 Subject: [PATCH 6/8] feat: get class / method from curser position and return location --- Cargo.lock | 7 ++++ Cargo.toml | 1 + src/main.rs | 32 ++++++++-------- src/php.rs | 15 +++++--- src/ts.rs | 19 +++++++++ src/xml.rs | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 161 insertions(+), 21 deletions(-) create mode 100644 src/xml.rs diff --git a/Cargo.lock b/Cargo.lock index 5888699..e936681 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,6 +61,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "idna" version = "0.4.0" @@ -127,6 +133,7 @@ dependencies = [ name = "magento2-ls" version = "0.1.0" dependencies = [ + "glob", "lsp-server", "lsp-types", "serde", diff --git a/Cargo.toml b/Cargo.toml index 8cedf11..53b250a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +glob = "0.3.1" lsp-server = "0.7.4" lsp-types = "0.94.1" serde = { version = "1.0.188", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index e9af579..288327c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod php; mod ts; +mod xml; use php::*; use std::collections::HashMap; @@ -9,13 +10,13 @@ use std::path::PathBuf; use lsp_types::{ request::GotoDefinition, GotoDefinitionResponse, InitializeParams, ServerCapabilities, }; -use lsp_types::{GotoDefinitionParams, Location, OneOf, Url}; +use lsp_types::{GotoDefinitionParams, Location, OneOf}; use lsp_server::{Connection, ExtractError, Message, Request, RequestId, Response}; fn main() -> Result<(), Box> { // Note that we must have our logging only write out to stderr. - eprintln!("starting generic LSP server"); + eprintln!("Starting magento2-ls LSP server"); // Create the transport. Includes the stdio (stdin and stdout) versions but this could // also be implemented to use sockets or HTTP. @@ -28,6 +29,7 @@ fn main() -> Result<(), Box> { }) .unwrap(); let initialization_params = connection.initialize(server_capabilities)?; + main_loop(connection, initialization_params)?; io_threads.join()?; @@ -61,20 +63,10 @@ fn main_loop( match cast::(req) { Ok((id, params)) => { eprintln!("got gotoDefinition request #{id}: {params:?}"); - let loc = Location { - uri: Url::from_file_path("/tmp/foo.rs").unwrap(), - range: Range { - start: Position { - line: 0, - character: 0, - }, - end: Position { - line: 0, - character: 0, - }, - }, + let result = match get_location_from_params(&map, params) { + Some(loc) => Some(GotoDefinitionResponse::Array(vec![loc])), + None => Some(GotoDefinitionResponse::Array(vec![])), }; - let result = Some(GotoDefinitionResponse::Array(vec![loc])); let result = serde_json::to_value(&result).unwrap(); let resp = Response { id, @@ -100,6 +92,16 @@ fn main_loop( Ok(()) } +fn get_location_from_params( + map: &HashMap, + params: GotoDefinitionParams, +) -> Option { + let uri = params.text_document_position_params.text_document.uri; + let pos = params.text_document_position_params.position; + + xml::get_location_from_position(map, uri, pos) +} + fn cast(req: Request) -> Result<(RequestId, R::Params), ExtractError> where R: lsp_types::request::Request, diff --git a/src/php.rs b/src/php.rs index 45cc93b..1fb6199 100644 --- a/src/php.rs +++ b/src/php.rs @@ -11,7 +11,7 @@ pub struct PHPClass { pub fqn: String, pub uri: Url, pub range: Range, - pub methods: Vec, + pub methods: HashMap, } #[derive(Debug)] @@ -97,7 +97,7 @@ pub fn parse_php_file(file_path: PathBuf) -> Option { let mut ns: Option = None; let mut cls: Option = None; - let mut methods: Vec = vec![]; + let mut methods: HashMap = HashMap::new(); for m in matches { if m.pattern_index == 0 { @@ -110,10 +110,13 @@ pub fn parse_php_file(file_path: PathBuf) -> Option { let method_node = m.captures[1].node; let method_name = method_node.utf8_text(&content.as_bytes()).unwrap_or(""); if method_name != "" { - methods.push(PHPMethod { - name: method_name.to_string(), - range: get_range_from_node(method_node), - }); + methods.insert( + method_name.to_string(), + PHPMethod { + name: method_name.to_string(), + range: get_range_from_node(method_node), + }, + ); } } } diff --git a/src/ts.rs b/src/ts.rs index 0f5c758..a03bda6 100644 --- a/src/ts.rs +++ b/src/ts.rs @@ -13,3 +13,22 @@ pub fn get_range_from_node(node: Node) -> Range { }, } } + +pub fn get_node_text(node: Node, content: &str) -> String { + node.utf8_text(content.as_bytes()).unwrap_or("").to_string() +} + +pub fn node_at_position(node: Node, pos: Position) -> bool { + let start = node.start_position(); + let end = node.end_position(); + if pos.line < start.row as u32 || pos.line > end.row as u32 { + return false; + } + if pos.line == start.row as u32 && pos.character < start.column as u32 { + return false; + } + if pos.line == end.row as u32 && pos.character > end.column as u32 { + return false; + } + true +} diff --git a/src/xml.rs b/src/xml.rs new file mode 100644 index 0000000..2eb3c3d --- /dev/null +++ b/src/xml.rs @@ -0,0 +1,108 @@ +use std::collections::HashMap; + +use crate::ts::*; +use lsp_types::{Location, Position, Url}; +use tree_sitter::{Query, QueryCursor}; + +use crate::php::PHPClass; + +pub fn get_location_from_position( + map: &HashMap, + uri: Url, + pos: Position, +) -> Option { + let path = uri.path(); + + let query_string = " + (attribute_value) @attr + (text) @text + + (self_closing_tag (tag_name) + (attribute (attribute_name ) @_attr2 (#eq? @_attr2 \"class\") + (quoted_attribute_value (attribute_value) @class)) + ) @callable + (self_closing_tag (tag_name) + (attribute (attribute_name) @_attr (#eq? @_attr \"method\") + (quoted_attribute_value (attribute_value) @method)) + ) @callable + (self_closing_tag (tag_name) @_name + (attribute (attribute_name ) @_attr2 (#eq? @_attr2 \"instance\") + (quoted_attribute_value (attribute_value) @class)) + ) @callable + (start_tag (tag_name) + (attribute (attribute_name ) @_attr2 (#eq? @_attr2 \"class\") + (quoted_attribute_value (attribute_value) @class)) + ) @callable + (start_tag (tag_name) + (attribute (attribute_name) @_attr (#eq? @_attr \"method\") + (quoted_attribute_value (attribute_value) @method)) + ) @callable + (start_tag (tag_name) @_name + (attribute (attribute_name ) @_attr2 (#eq? @_attr2 \"instance\") + (quoted_attribute_value (attribute_value) @class)) + ) @callable + "; + + let content = std::fs::read_to_string(&path).expect("Should have been able to read the file"); + + let tree = tree_sitter_parsers::parse(&content, "html"); + let query = Query::new(tree.language(), &query_string) + .map_err(|e| eprintln!("Error creating query: {:?}", e)) + .unwrap(); + + let mut cursor = QueryCursor::new(); + let matches = cursor.matches(&query, tree.root_node(), content.as_bytes()); + + let mut class_name: Option = None; + let mut method_name: Option = None; + + // FIXME its ugly as fuck, figure out better way to get this data + for m in matches { + let node = m.captures[0].node; + if node_at_position(node, pos) { + if node.kind() == "attribute_value" || node.kind() == "text" { + class_name = Some(get_node_text(node, &content)); + } else if node.kind() == "self_closing_tag" || node.kind() == "start_tag" { + let mut cursor = node.walk(); + for child in node.named_children(&mut cursor) { + if child.kind() == "attribute" { + let attr_name = child + .named_child(0) + .map(|attr| get_node_text(attr, &content)) + .unwrap_or("".to_string()); + if attr_name == "class" || attr_name == "instance" { + class_name = Some(get_node_text( + child.named_child(1)?.named_child(0)?, + &content, + )); + } + if attr_name == "method" { + method_name = Some(get_node_text( + child.named_child(1)?.named_child(0)?, + &content, + )); + } + } + } + } + } + } + + match (class_name, method_name) { + (Some(class), Some(method)) => map.get(&class).map_or(None, |cls| { + cls.methods.get(&method).map_or(None, |m| { + Some(Location { + uri: cls.uri.clone(), + range: m.range.clone(), + }) + }) + }), + (Some(class), None) => map.get(&class).map_or(None, |cls| { + Some(Location { + uri: cls.uri.clone(), + range: cls.range.clone(), + }) + }), + _ => None, + } +} From 0f3bd2d327bcb57bb16595efc9dc581dc3082309 Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Tue, 19 Sep 2023 09:50:35 +0200 Subject: [PATCH 7/8] feat: cache vendor parsed data to speed up indexing --- Cargo.lock | 10 ++++++++ Cargo.toml | 1 + src/php.rs | 68 ++++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e936681..7606390 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -133,6 +142,7 @@ dependencies = [ name = "magento2-ls" version = "0.1.0" dependencies = [ + "bincode", "glob", "lsp-server", "lsp-types", diff --git a/Cargo.toml b/Cargo.toml index 53b250a..ec18271 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +bincode = "1.3.3" glob = "0.3.1" lsp-server = "0.7.4" lsp-types = "0.94.1" diff --git a/src/php.rs b/src/php.rs index 1fb6199..76e2065 100644 --- a/src/php.rs +++ b/src/php.rs @@ -2,11 +2,14 @@ use std::{collections::HashMap, path::PathBuf}; use glob::glob; use lsp_types::{Position, Range, Url}; +use serde::{Deserialize, Serialize}; use tree_sitter::{Node, Query, QueryCursor}; use crate::ts::get_range_from_node; -#[derive(Debug)] +const CACHE_FILE: &str = ".magento2-ls.index"; + +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PHPClass { pub fqn: String, pub uri: Url, @@ -14,14 +17,20 @@ pub struct PHPClass { pub methods: HashMap, } -#[derive(Debug)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PHPMethod { pub name: String, pub range: Range, } -pub fn parse_php_files(map: &mut HashMap, path: PathBuf) { - let path_str = path.to_str().expect("Correct path is required").to_string(); +pub fn parse_php_files(map: &mut HashMap, root_path: PathBuf) { + let vendor_map = load_vendor(&root_path); + + let path_str = root_path + .to_str() + .expect("Correct path is required") + .to_string(); + let tmp_modules = glob((path_str + "/**/registration.php").as_str()).expect("Failed to read glob pattern"); @@ -47,17 +56,23 @@ pub fn parse_php_files(map: &mut HashMap, path: PathBuf) { for file in files { match file { Ok(path) => { - if path.to_str().unwrap_or("").ends_with("Test.php") { + let path_str = path.to_str().unwrap_or(""); + if path_str.ends_with("Test.php") { continue; } - if path.to_str().unwrap_or("").contains("/dev/tests/") { + if path_str.contains("/dev/tests/") { continue; } - // TODO get from settings or somethign - if path.to_str().unwrap_or("").contains("/vendor/") { - continue; + if path_str.contains("/vendor/") { + if let Some(cls) = vendor_map.get(path_str) { + map.insert(cls.fqn.clone(), cls.clone()); + continue; + } } if path.is_file() { + if false { + continue; + } match parse_php_file(path) { Some(cls) => { map.insert(cls.fqn.clone(), cls); @@ -73,6 +88,41 @@ pub fn parse_php_files(map: &mut HashMap, path: PathBuf) { Err(e) => eprintln!("{:?}", e), } } + save_vendor(root_path, map); +} + +fn load_vendor(root_path: &PathBuf) -> HashMap { + let root_string = root_path + .to_str() + .expect("root path is required") + .to_string(); + std::fs::File::open(root_string.clone() + "/" + CACHE_FILE).map_or(HashMap::new(), |f| { + let reader = std::io::BufReader::new(f); + bincode::deserialize_from(reader).unwrap_or(HashMap::new()) + }) +} + +fn save_vendor(root_path: PathBuf, map: &HashMap) { + let root_string = root_path + .to_str() + .expect("root path is required") + .to_string(); + if let Ok(f) = std::fs::File::create(root_string.clone() + "/" + CACHE_FILE) { + let mut vendor_map: HashMap = HashMap::new(); + + for (_, value) in map { + if value + .uri + .path() + .starts_with((root_string.clone() + "/vendor/").as_str()) + { + vendor_map.insert(value.uri.path().to_string(), value.clone()); + } + } + bincode::serialize_into(f, &vendor_map) + .map_err(|e| eprintln!("Failed to write index file: {:?}", e)) + .expect("Failed to write index file"); + } } pub fn parse_php_file(file_path: PathBuf) -> Option { From 78fde5cdd9d89dd84823962b54cfafd379a3238f Mon Sep 17 00:00:00 2001 From: Pawel Bogut Date: Tue, 19 Sep 2023 12:38:00 +0200 Subject: [PATCH 8/8] feat: update docs and nvim integration for rust version --- README.md | 4 ++-- lua/magento2_ls.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6605725..0adf13b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The Magento 2 Language Server is a tool that acts as a bridge between Magento 2 XML and PHP files. It provides features such as jumping to the definition of PHP classes from XML definitions of plugins, observers, jobs, and similar entities. The goal is to also provide code completion suggestions in XML files when referencing PHP classes and functions, and potentially finding references of PHP classes/methods in XML in the future. -Please note that the current version of the language server is considered to be of alpha quality. While it works and can be used, it may have limited functionality and can be memory-intensive. +Please note that the current version of the language server is considered to be of alpha quality. While it works and can be used, it has limited functionality and things can break. ## Features - Jump to definition of PHP classes from XML definitions of plugins, observers, jobs, and similar entities. @@ -21,7 +21,7 @@ Add the following lines to your init.lua file if you are using Packer as your pl ```lua use({ 'pbogut/magento2-ls', - run = 'npm install && npm run build', + run = 'cargo build --release', config = "require'magento2_ls'.setup()" }) ``` diff --git a/lua/magento2_ls.lua b/lua/magento2_ls.lua index e846793..e31b827 100644 --- a/lua/magento2_ls.lua +++ b/lua/magento2_ls.lua @@ -14,7 +14,7 @@ M.setup = function(opts) opts = vim.tbl_deep_extend('keep', opts, { filetypes = { 'xml' }, name = 'magento2-ls', - cmd = { 'node', script_path('../out/server.js'), '--stdio' }, + cmd = { script_path('../target/release/magento2-ls') }, root_dir = vim.fn.getcwd(), }) @@ -35,7 +35,7 @@ M.setup = function(opts) end M.build = function() - local cmd = 'cd ' .. vim.fn.shellescape(script_path('..')) .. ' && npm install && npm run build' + local cmd = 'cd ' .. vim.fn.shellescape(script_path('..')) .. ' && cargo build --release' vim.fn.jobstart(cmd, { on_exit = function(_, code) if code == 0 then