diff --git a/client/package-lock.json b/client/package-lock.json index 31d9063c2..46f38961d 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -13,16 +13,16 @@ ], "dependencies": { "find": "^0.2.7", - "node-pty": "^1.0.0", - "vscode-languageclient": "^8.1.0" + "language-server-bitbake": "^2.2.0" }, "devDependencies": { "@types/find": "^0.2.2", "@types/node": "^20.6.2", - "@types/vscode": "^1.75.1" + "coc.nvim": "^0.0.83-next.18", + "typescript": "^5.3.3" }, "engines": { - "vscode": "^1.75.0" + "coc": "^0.0.82" } }, "../lib": { @@ -68,20 +68,20 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/vscode": { - "version": "1.83.1", + "node_modules/coc.nvim": { + "version": "0.0.83-next.18", + "resolved": "https://registry.npmjs.org/coc.nvim/-/coc.nvim-0.0.83-next.18.tgz", + "integrity": "sha512-BZ1a+lnvQ/l7WzoRy97oYubDnYkX+vyAN2GhrKzWMc4d8YujOcOCjaeRv6Ogn7Bvoc5rM9X88CPuOoE0iP1ceQ==", "dev": true, - "license": "MIT" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=16.18.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/cocnvim" + }, + "peerDependencies": { + "@types/node": "^16.18.0" } }, "node_modules/find": { @@ -92,51 +92,21 @@ "traverse-chain": "~0.1.0" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/minimatch": { - "version": "5.1.6", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/nan": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", - "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==" - }, - "node_modules/node-pty": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.0.0.tgz", - "integrity": "sha512-wtBMWWS7dFZm/VgqElrTvtfMq4GzJ6+edFI0Y0zyzygUSZMgZdraDUMUhCIvkjhJjme15qWmbyJbtAx4ot4uZA==", - "hasInstallScript": true, - "dependencies": { - "nan": "^2.17.0" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "license": "ISC", + "node_modules/language-server-bitbake": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/language-server-bitbake/-/language-server-bitbake-2.2.0.tgz", + "integrity": "sha512-OcPa8NBBvPqQ8EWRDkT988TiyeNPNsGhu4+W+UZgUpHHS67bxn7Oo1P7rldRw9QfypNUE9aZS7w8Bo5/ieRxgw==", "dependencies": { - "lru-cache": "^6.0.0" + "find": "^0.2.7", + "vscode-languageserver": "^8.1.0", + "vscode-languageserver-textdocument": "^1.0.8", + "web-tree-sitter": "^0.20.8" }, "bin": { - "semver": "bin/semver.js" + "language-server-bitbake": "out/server.js" }, "engines": { - "node": ">=10" + "node": "*" } }, "node_modules/traverse-chain": { @@ -144,6 +114,19 @@ "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", "integrity": "sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg==" }, + "node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undici-types": { "version": "5.26.5", "dev": true, @@ -160,16 +143,15 @@ "node": ">=14.0.0" } }, - "node_modules/vscode-languageclient": { + "node_modules/vscode-languageserver": { "version": "8.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", "dependencies": { - "minimatch": "^5.1.0", - "semver": "^7.3.7", "vscode-languageserver-protocol": "3.17.3" }, - "engines": { - "vscode": "^1.67.0" + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { @@ -180,13 +162,19 @@ "vscode-languageserver-types": "3.17.3" } }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + }, "node_modules/vscode-languageserver-types": { "version": "3.17.3", "license": "MIT" }, - "node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" + "node_modules/web-tree-sitter": { + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.20.8.tgz", + "integrity": "sha512-weOVgZ3aAARgdnb220GqYuh7+rZU0Ka9k9yfKtGAzEYMa6GgiCzW9JjQRJyCJakvibQW+dfjJdihjInKuuCAUQ==" }, "src/lib": { "name": "vscode-bitbake-lib", diff --git a/client/package.json b/client/package.json index 128fdc9c3..3497a0f12 100644 --- a/client/package.json +++ b/client/package.json @@ -827,7 +827,8 @@ "package": "npm run vscode:prepublish && vsce package" }, "dependencies": { - "find": "^0.2.7" + "find": "^0.2.7", + "language-server-bitbake": "^2.2.0" }, "devDependencies": { "@types/find": "^0.2.2", diff --git a/client/src/language/languageClient.ts b/client/src/language/languageClient.ts index 912aee9fe..3a2f7c380 100644 --- a/client/src/language/languageClient.ts +++ b/client/src/language/languageClient.ts @@ -36,7 +36,7 @@ import * as vscode from 'coc.nvim' // import { middlewareProvideReferences } from './middlewareReferences' export async function activateLanguageServer (context: ExtensionContext, bitBakeProjectScanner: BitBakeProjectScanner): Promise { - const serverModule = context.asAbsolutePath(path.join('server', 'server.js')) + const serverModule = path.join(__dirname, 'server.js') // The debug options for the server // Use --inspect-brk instead of --inspect if you want to debug the server startup code const debugOptions = { execArgv: ['--nolazy', '--inspect=localhost:6010'] } diff --git a/client/src/language/server.ts b/client/src/language/server.ts new file mode 100644 index 000000000..299b7f2f8 --- /dev/null +++ b/client/src/language/server.ts @@ -0,0 +1,6 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) 2023 Savoir-faire Linux. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +import 'language-server-bitbake/out/server'