mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
Update client to v7.0.0 to use of 3.16.0 spec
This commit is contained in:
1900
package-lock.json
generated
1900
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class GodotTools {
|
||||
|
||||
private open_workspace_with_editor(params = "") {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise<void>((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<void>((resolve, reject) => {
|
||||
const run_godot = (path: string, params: string) => {
|
||||
const is_powershell_path = (path?: string) => {
|
||||
const POWERSHELL = "powershell.exe";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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<void> {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DocumentSymbol } from "vscode-languageclient";
|
||||
import { DocumentSymbol, Range, SymbolKind } from "vscode-languageclient";
|
||||
|
||||
|
||||
export const enum Methods {
|
||||
GDSCRIPT_CAPABILITIES = 'gdscript/capabilities',
|
||||
@@ -11,7 +12,15 @@ export interface NativeSymbolInspectParams {
|
||||
symbol_name: string;
|
||||
}
|
||||
|
||||
export class GodotNativeSymbol extends DocumentSymbol {
|
||||
export class GodotNativeSymbol implements DocumentSymbol {
|
||||
name: string;
|
||||
detail?: string;
|
||||
kind: SymbolKind;
|
||||
tags?: 1[];
|
||||
deprecated?: boolean;
|
||||
range: Range;
|
||||
selectionRange: Range;
|
||||
children?: DocumentSymbol[];
|
||||
documentation: string;
|
||||
native_class: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user