Unnamed repository; edit this file 'description' to name the repository.
override language client
jprochazk 2023-10-28
parent f493207 · commit 3e4de96
-rw-r--r--editors/code/src/base_client.ts12
-rw-r--r--editors/code/src/client.ts3
2 files changed, 14 insertions, 1 deletions
diff --git a/editors/code/src/base_client.ts b/editors/code/src/base_client.ts
new file mode 100644
index 0000000000..085920fb66
--- /dev/null
+++ b/editors/code/src/base_client.ts
@@ -0,0 +1,12 @@
+import * as lc from "vscode-languageclient/node";
+
+export class RaLanguageClient extends lc.LanguageClient {
+ override error(message: string, data?: any, showNotification?: boolean | "force"): void {
+ // ignore `Request TYPE failed.` errors
+ if (message.startsWith("Request") && message.endsWith("failed.")) {
+ return;
+ }
+
+ super.error(message, data, showNotification);
+ }
+}
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 96e888402b..ed7066a1b7 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -10,6 +10,7 @@ import { type Config, prepareVSCodeConfig } from "./config";
import { randomUUID } from "crypto";
import { sep as pathSeparator } from "path";
import { unwrapUndefinable } from "./undefinable";
+import { RaLanguageClient } from "./base_client";
export interface Env {
[name: string]: string;
@@ -363,7 +364,7 @@ export async function createClient(
},
};
- const client = new lc.LanguageClient(
+ const client = new RaLanguageClient(
"rust-analyzer",
"Rust Analyzer Language Server",
serverOptions,