Skip to content

Commit 3e4de96

Browse files
committed
override language client
1 parent f493207 commit 3e4de96

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

editors/code/src/base_client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as lc from "vscode-languageclient/node";
2+
3+
export class RaLanguageClient extends lc.LanguageClient {
4+
override error(message: string, data?: any, showNotification?: boolean | "force"): void {
5+
// ignore `Request TYPE failed.` errors
6+
if (message.startsWith("Request") && message.endsWith("failed.")) {
7+
return;
8+
}
9+
10+
super.error(message, data, showNotification);
11+
}
12+
}

editors/code/src/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { type Config, prepareVSCodeConfig } from "./config";
1010
import { randomUUID } from "crypto";
1111
import { sep as pathSeparator } from "path";
1212
import { unwrapUndefinable } from "./undefinable";
13+
import { RaLanguageClient } from "./base_client";
1314

1415
export interface Env {
1516
[name: string]: string;
@@ -363,7 +364,7 @@ export async function createClient(
363364
},
364365
};
365366

366-
const client = new lc.LanguageClient(
367+
const client = new RaLanguageClient(
367368
"rust-analyzer",
368369
"Rust Analyzer Language Server",
369370
serverOptions,

0 commit comments

Comments
 (0)