mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
override language client
This commit is contained in:
parent
f493207744
commit
3e4de963a2
12
editors/code/src/base_client.ts
Normal file
12
editors/code/src/base_client.ts
Normal file
@ -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);
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user