mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +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 {
|
||||
LanguageClient,
|
||||
MessageSignature,
|
||||
type LanguageClientOptions,
|
||||
type NotificationMessage,
|
||||
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) {
|
||||
if (this.rejected) {
|
||||
if (message.method === "shutdown") {
|
||||
|
||||
Reference in New Issue
Block a user