diff --git a/package-lock.json b/package-lock.json index eaea58913..fac734ae1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1868,9 +1868,9 @@ "dev": true }, "@types/vscode": { - "version": "1.46.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.46.0.tgz", - "integrity": "sha512-8m9wPEB2mcRqTWNKs9A9Eqs8DrQZt0qNFO8GkxBOnyW6xR//3s77SoMgb/nY1ctzACsZXwZj3YRTDsn4bAoaUw==", + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.55.0.tgz", + "integrity": "sha512-49hysH7jneTQoSC8TWbAi7nKK9Lc5osQNjmDHVosrcU8o3jecD9GrK0Qyul8q4aGPSXRfNGqIp9CBdb13akETg==", "dev": true }, "@types/ws": { @@ -1940,8 +1940,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base64-js": { "version": "1.5.1", @@ -1983,7 +1982,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2104,8 +2102,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0", @@ -2494,6 +2491,14 @@ "yallist": "^4.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "map-stream": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", @@ -2561,7 +2566,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2843,7 +2847,8 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true }, "set-blocking": { "version": "2.0.0", @@ -3154,32 +3159,43 @@ "integrity": "sha512-Sxp7kDDuhpEZiDaIfhM0jLF3RtMqvc6CpoESANE77t351uezsd/oDoqALLcOnmmsDzTgQ3W0sCvM4gErnjDFpA==" }, "vscode-jsonrpc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", - "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==" + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" }, "vscode-languageclient": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz", - "integrity": "sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", + "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", "requires": { - "semver": "^5.5.0", - "vscode-languageserver-protocol": "3.14.1" + "minimatch": "^3.0.4", + "semver": "^7.3.4", + "vscode-languageserver-protocol": "3.16.0" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "vscode-languageserver-protocol": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz", - "integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==", + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", "requires": { - "vscode-jsonrpc": "^4.0.0", - "vscode-languageserver-types": "3.14.0" + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" } }, "vscode-languageserver-types": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz", - "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==" + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" }, "wide-align": { "version": "1.1.5", @@ -3224,6 +3240,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/package.json b/package.json index 73bac805b..6280f0e6b 100644 --- a/package.json +++ b/package.json @@ -318,7 +318,7 @@ "net": "^1.0.2", "terminate": "^2.5.0", "vscode-debugadapter": "^1.38.0", - "vscode-languageclient": "^5.2.1", + "vscode-languageclient": "^7.0.0", "ws": "^8.4.2" } } diff --git a/src/godot-tools.ts b/src/godot-tools.ts index 899c51385..8d1c815b6 100644 --- a/src/godot-tools.ts +++ b/src/godot-tools.ts @@ -47,7 +47,7 @@ export class GodotTools { private open_workspace_with_editor(params = "") { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { let valid = false; if (this.workspace_dir) { let cfg = path.join(this.workspace_dir, this.project_file); @@ -79,7 +79,7 @@ export class GodotTools { private run_editor(params = "") { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const run_godot = (path: string, params: string) => { const is_powershell_path = (path?: string) => { const POWERSHELL = "powershell.exe"; diff --git a/src/lsp/GDScriptLanguageClient.ts b/src/lsp/GDScriptLanguageClient.ts index 80722b09e..850334fce 100644 --- a/src/lsp/GDScriptLanguageClient.ts +++ b/src/lsp/GDScriptLanguageClient.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode'; -import { LanguageClient, LanguageClientOptions, ServerOptions, RequestMessage } from "vscode-languageclient"; +import { LanguageClient, LanguageClientOptions, ServerOptions, RequestMessage } from "vscode-languageclient/node"; import { is_debug_mode, get_configuration } from "../utils"; import { MessageIO, MessageIOReader, MessageIOWriter, Message, WebsocktMessageIO, TCPMessageIO } from "./MessageIO"; import logger from "../loggger"; diff --git a/src/lsp/MessageIO.ts b/src/lsp/MessageIO.ts index e40f84eea..c2cd422be 100644 --- a/src/lsp/MessageIO.ts +++ b/src/lsp/MessageIO.ts @@ -1,11 +1,11 @@ -import { AbstractMessageReader, MessageReader, DataCallback } from "vscode-jsonrpc/lib/messageReader"; +import { AbstractMessageReader, MessageReader, DataCallback, Disposable } from "vscode-jsonrpc"; import { EventEmitter } from "events"; import * as WebSocket from 'ws'; import { Socket } from 'net'; import MessageBuffer from "./MessageBuffer"; -import { AbstractMessageWriter, MessageWriter } from "vscode-jsonrpc/lib/messageWriter"; -import { RequestMessage, ResponseMessage, NotificationMessage } from "vscode-jsonrpc/lib/messages"; +import { AbstractMessageWriter, MessageWriter } from "vscode-jsonrpc"; +import { RequestMessage, ResponseMessage, NotificationMessage } from "vscode-jsonrpc"; export type Message = RequestMessage | ResponseMessage | NotificationMessage; export class MessageIO extends EventEmitter { @@ -127,7 +127,7 @@ export class MessageIOReader extends AbstractMessageReader implements MessageRea return this._partialMessageTimeout; } - public listen(callback: DataCallback): void { + public listen(callback: DataCallback): Disposable { this.nextMessageLength = -1; this.messageToken = 0; this.partialMessageTimer = undefined; @@ -137,6 +137,8 @@ export class MessageIOReader extends AbstractMessageReader implements MessageRea }); this.io.on('error', (error: any) => this.fireError(error)); this.io.on('close', () => this.fireClose()); + + return; } private onData(data: Buffer | String): void { @@ -214,8 +216,12 @@ export class MessageIOWriter extends AbstractMessageWriter implements MessageWri this.io.on('error', (error: any) => this.fireError(error)); this.io.on('close', () => this.fireClose()); } + + public end(): void { + + } - public write(msg: Message): void { + public write(msg: Message): Promise { let json = JSON.stringify(msg); let contentLength = Buffer.byteLength(json, this.encoding); @@ -235,5 +241,7 @@ export class MessageIOWriter extends AbstractMessageWriter implements MessageWri this.errorCount++; this.fireError(error, msg, this.errorCount); } + + return; } } diff --git a/src/lsp/NativeDocumentManager.ts b/src/lsp/NativeDocumentManager.ts index 9a18f8419..dbccbb734 100644 --- a/src/lsp/NativeDocumentManager.ts +++ b/src/lsp/NativeDocumentManager.ts @@ -33,7 +33,7 @@ export default class NativeDocumentManager extends EventEmitter { this.io = io; io.on("message", (message: NotificationMessage) => { if (message.method == Methods.SHOW_NATIVE_SYMBOL) { - this.show_native_symbol(message.params); + this.show_native_symbol(message.params as GodotNativeSymbol); } else if (message.method == Methods.GDSCRIPT_CAPABILITIES) { for (const gdclass of (message.params as GodotCapabilities) .native_classes) {