Skip to content

Commit

Permalink
add configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed Nov 7, 2023
1 parent 3e4de96 commit c566136
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion editors/code/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}

Expand Down

0 comments on commit c566136

Please sign in to comment.