add configuration option
This commit is contained in:
parent
3e4de963a2
commit
c566136854
@ -502,6 +502,11 @@
|
|||||||
"default": true,
|
"default": true,
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"rust-analyzer.showRequestFailedErrorNotification": {
|
||||||
|
"markdownDescription": "Whether to show panic error notifications.",
|
||||||
|
"default": true,
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"rust-analyzer.showDependenciesExplorer": {
|
"rust-analyzer.showDependenciesExplorer": {
|
||||||
"markdownDescription": "Whether to show the dependencies view.",
|
"markdownDescription": "Whether to show the dependencies view.",
|
||||||
"default": true,
|
"default": true,
|
||||||
|
@ -10,7 +10,7 @@ import { type Config, prepareVSCodeConfig } from "./config";
|
|||||||
import { randomUUID } from "crypto";
|
import { randomUUID } from "crypto";
|
||||||
import { sep as pathSeparator } from "path";
|
import { sep as pathSeparator } from "path";
|
||||||
import { unwrapUndefinable } from "./undefinable";
|
import { unwrapUndefinable } from "./undefinable";
|
||||||
import { RaLanguageClient } from "./base_client";
|
import { RaLanguageClient } from "./lang_client";
|
||||||
|
|
||||||
export interface Env {
|
export interface Env {
|
||||||
[name: string]: string;
|
[name: string]: string;
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
import * as lc from "vscode-languageclient/node";
|
import * as lc from "vscode-languageclient/node";
|
||||||
|
import * as vscode from "vscode";
|
||||||
|
|
||||||
export class RaLanguageClient extends lc.LanguageClient {
|
export class RaLanguageClient extends lc.LanguageClient {
|
||||||
override error(message: string, data?: any, showNotification?: boolean | "force"): void {
|
override error(message: string, data?: any, showNotification?: boolean | "force"): void {
|
||||||
// ignore `Request TYPE failed.` errors
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user