mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2026-02-26 00:53:27 +03:00
Add ability to suppress LSP error messages (#823)
This commit is contained in:
@@ -3,6 +3,7 @@ import * as path from "node:path";
|
|||||||
import * as vscode from "vscode";
|
import * as vscode from "vscode";
|
||||||
import {
|
import {
|
||||||
LanguageClient,
|
LanguageClient,
|
||||||
|
MessageSignature,
|
||||||
type LanguageClientOptions,
|
type LanguageClientOptions,
|
||||||
type NotificationMessage,
|
type NotificationMessage,
|
||||||
type RequestMessage,
|
type RequestMessage,
|
||||||
@@ -139,6 +140,22 @@ export default class GDScriptLanguageClient extends LanguageClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleFailedRequest<T>(
|
||||||
|
type: MessageSignature,
|
||||||
|
token: vscode.CancellationToken | undefined,
|
||||||
|
error: any,
|
||||||
|
defaultValue: T,
|
||||||
|
showNotification?: boolean,
|
||||||
|
): T {
|
||||||
|
if (type.method === "textDocument/documentSymbol") {
|
||||||
|
if (error.message.includes("selectionRange must be contained in fullRange")) {
|
||||||
|
log.warn(`Request failed for method "${type.method}", suppressing notification - see issue #820`);
|
||||||
|
return super.handleFailedRequest(type, token, error, defaultValue, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.handleFailedRequest(type, token, error, defaultValue, showNotification);
|
||||||
|
}
|
||||||
|
|
||||||
private request_filter(message: RequestMessage) {
|
private request_filter(message: RequestMessage) {
|
||||||
if (this.rejected) {
|
if (this.rejected) {
|
||||||
if (message.method === "shutdown") {
|
if (message.method === "shutdown") {
|
||||||
|
|||||||
Reference in New Issue
Block a user