mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
add configuration option
This commit is contained in:
parent
3e4de963a2
commit
c566136854
3 changed files with 11 additions and 2 deletions
|
@ -502,6 +502,11 @@
|
|||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.showRequestFailedErrorNotification": {
|
||||
"markdownDescription": "Whether to show panic error notifications.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.showDependenciesExplorer": {
|
||||
"markdownDescription": "Whether to show the dependencies view.",
|
||||
"default": true,
|
||||
|
|
|
@ -10,7 +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";
|
||||
import { RaLanguageClient } from "./lang_client";
|
||||
|
||||
export interface Env {
|
||||
[name: string]: string;
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import * as lc from "vscode-languageclient/node";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
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.")) {
|
||||
const showError = vscode.workspace
|
||||
.getConfiguration("rust-analyzer")
|
||||
.get("showRequestFailedErrorNotification");
|
||||
if (!showError && message.startsWith("Request") && message.endsWith("failed.")) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in a new issue