add configuration option

This commit is contained in:
jprochazk 2023-11-07 16:33:45 +01:00
parent 3e4de963a2
commit c566136854
3 changed files with 11 additions and 2 deletions

View file

@ -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,

View file

@ -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;

View file

@ -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;
}