aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r--editors/code/src/config.ts36
1 files changed, 17 insertions, 19 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index ccb0ee2b7..ec2790b63 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -16,25 +16,25 @@ export interface CargoFeatures {
16} 16}
17 17
18export class Config { 18export class Config {
19 public highlightingOn = true; 19 highlightingOn = true;
20 public rainbowHighlightingOn = false; 20 rainbowHighlightingOn = false;
21 public enableEnhancedTyping = true; 21 enableEnhancedTyping = true;
22 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; 22 raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
23 public lruCapacity: null | number = null; 23 lruCapacity: null | number = null;
24 public displayInlayHints = true; 24 displayInlayHints = true;
25 public maxInlayHintLength: null | number = null; 25 maxInlayHintLength: null | number = null;
26 public excludeGlobs = []; 26 excludeGlobs = [];
27 public useClientWatching = true; 27 useClientWatching = true;
28 public featureFlags = {}; 28 featureFlags = {};
29 // for internal use 29 // for internal use
30 public withSysroot: null | boolean = null; 30 withSysroot: null | boolean = null;
31 public cargoWatchOptions: CargoWatchOptions = { 31 cargoWatchOptions: CargoWatchOptions = {
32 enable: true, 32 enable: true,
33 arguments: [], 33 arguments: [],
34 command: '', 34 command: '',
35 allTargets: true, 35 allTargets: true,
36 }; 36 };
37 public cargoFeatures: CargoFeatures = { 37 cargoFeatures: CargoFeatures = {
38 noDefaultFeatures: false, 38 noDefaultFeatures: false,
39 allFeatures: true, 39 allFeatures: true,
40 features: [], 40 features: [],
@@ -43,14 +43,12 @@ export class Config {
43 private prevEnhancedTyping: null | boolean = null; 43 private prevEnhancedTyping: null | boolean = null;
44 private prevCargoFeatures: null | CargoFeatures = null; 44 private prevCargoFeatures: null | CargoFeatures = null;
45 45
46 constructor() { 46 constructor(ctx: vscode.ExtensionContext) {
47 vscode.workspace.onDidChangeConfiguration(_ => 47 vscode.workspace.onDidChangeConfiguration(_ => this.refresh(), ctx.subscriptions);
48 this.userConfigChanged(), 48 this.refresh();
49 );
50 this.userConfigChanged();
51 } 49 }
52 50
53 public userConfigChanged() { 51 private refresh() {
54 const config = vscode.workspace.getConfiguration('rust-analyzer'); 52 const config = vscode.workspace.getConfiguration('rust-analyzer');
55 53
56 let requireReloadMessage = null; 54 let requireReloadMessage = null;