From deea8f52d9803bb8a93d5dbd935970a20f07a51e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Aug 2019 13:34:28 +0200 Subject: allow to exclude certain files and directories --- editors/code/package.json | 5 +++++ editors/code/src/config.ts | 4 ++++ editors/code/src/server.ts | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 808dc5dc1..48ab886bf 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -197,6 +197,11 @@ ], "description": "Whether to run `cargo watch` on startup" }, + "rust-analyzer.excludeGlobs": { + "type": "array", + "default": "[]", + "description": "Paths to exclude from analysis" + }, "rust-analyzer.cargo-watch.arguments": { "type": "string", "description": "`cargo-watch` arguments. (e.g: `--features=\"shumway,pdf\"` will run as `cargo watch -x \"check --features=\"shumway,pdf\"\"` )", diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 4d58a1a93..4df6b50ef 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -22,6 +22,7 @@ export class Config { public showWorkspaceLoadedNotification = true; public lruCapacity: null | number = null; public displayInlayHints = true; + public excludeGlobs = []; public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off', @@ -128,5 +129,8 @@ export class Config { if (config.has('displayInlayHints')) { this.displayInlayHints = config.get('displayInlayHints') as boolean; } + if (config.has('excludeGlobs')) { + this.excludeGlobs = config.get('excludeGlobs') || []; + } } } diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index 7029142fd..2b4c25c28 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts @@ -36,7 +36,8 @@ export class Server { publishDecorations: true, showWorkspaceLoaded: Server.config.showWorkspaceLoadedNotification, - lruCapacity: Server.config.lruCapacity + lruCapacity: Server.config.lruCapacity, + excludeGlobs: Server.config.excludeGlobs }, traceOutputChannel }; -- cgit v1.2.3