aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2019-12-25 19:23:44 +0000
committerEmil Lauridsen <[email protected]>2019-12-25 19:26:06 +0000
commit0cdbd0814958e174c5481d6bf16bd2a7e53ec981 (patch)
treea58277467e67ebdf8584ad2edf398ca630d6fd35 /editors/code/src
parent71d2d81dcc879bbb7898df11ac00578e93b27ab5 (diff)
Keep VSCode config mostly backwards compatible
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/config.ts31
-rw-r--r--editors/code/src/extension.ts2
-rw-r--r--editors/code/src/server.ts8
3 files changed, 26 insertions, 15 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 96532e2c9..4b388b80c 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -4,10 +4,11 @@ import { Server } from './server';
4 4
5const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; 5const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
6 6
7export interface CargoCheckOptions { 7export interface CargoWatchOptions {
8 enabled: boolean; 8 enable: boolean;
9 arguments: string[]; 9 arguments: string[];
10 command: null | string; 10 command: string;
11 allTargets: boolean;
11} 12}
12 13
13export interface CargoFeatures { 14export interface CargoFeatures {
@@ -29,10 +30,11 @@ export class Config {
29 public featureFlags = {}; 30 public featureFlags = {};
30 // for internal use 31 // for internal use
31 public withSysroot: null | boolean = null; 32 public withSysroot: null | boolean = null;
32 public cargoCheckOptions: CargoCheckOptions = { 33 public cargoWatchOptions: CargoWatchOptions = {
33 enabled: true, 34 enable: true,
34 arguments: [], 35 arguments: [],
35 command: null, 36 command: '',
37 allTargets: true,
36 }; 38 };
37 public cargoFeatures: CargoFeatures = { 39 public cargoFeatures: CargoFeatures = {
38 noDefaultFeatures: false, 40 noDefaultFeatures: false,
@@ -91,27 +93,34 @@ export class Config {
91 RA_LSP_DEBUG || (config.get('raLspServerPath') as string); 93 RA_LSP_DEBUG || (config.get('raLspServerPath') as string);
92 } 94 }
93 95
94 if (config.has('enableCargoCheck')) { 96 if (config.has('cargo-watch.enable')) {
95 this.cargoCheckOptions.enabled = config.get<boolean>( 97 this.cargoWatchOptions.enable = config.get<boolean>(
96 'enableCargoCheck', 98 'cargo-watch.enable',
97 true, 99 true,
98 ); 100 );
99 } 101 }
100 102
101 if (config.has('cargo-watch.arguments')) { 103 if (config.has('cargo-watch.arguments')) {
102 this.cargoCheckOptions.arguments = config.get<string[]>( 104 this.cargoWatchOptions.arguments = config.get<string[]>(
103 'cargo-watch.arguments', 105 'cargo-watch.arguments',
104 [], 106 [],
105 ); 107 );
106 } 108 }
107 109
108 if (config.has('cargo-watch.command')) { 110 if (config.has('cargo-watch.command')) {
109 this.cargoCheckOptions.command = config.get<string>( 111 this.cargoWatchOptions.command = config.get<string>(
110 'cargo-watch.command', 112 'cargo-watch.command',
111 '', 113 '',
112 ); 114 );
113 } 115 }
114 116
117 if (config.has('cargo-watch.allTargets')) {
118 this.cargoWatchOptions.allTargets = config.get<boolean>(
119 'cargo-watch.allTargets',
120 true,
121 );
122 }
123
115 if (config.has('lruCapacity')) { 124 if (config.has('lruCapacity')) {
116 this.lruCapacity = config.get('lruCapacity') as number; 125 this.lruCapacity = config.get('lruCapacity') as number;
117 } 126 }
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index 36163b6bb..1da10ebd0 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -85,7 +85,7 @@ export async function activate(context: vscode.ExtensionContext) {
85 } 85 }
86 86
87 const watchStatus = new StatusDisplay( 87 const watchStatus = new StatusDisplay(
88 Server.config.cargoCheckOptions.command || 'check', 88 Server.config.cargoWatchOptions.command,
89 ); 89 );
90 disposeOnDeactivation(watchStatus); 90 disposeOnDeactivation(watchStatus);
91 91
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 409d3b4b7..ae81af848 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -55,9 +55,11 @@ export class Server {
55 publishDecorations: true, 55 publishDecorations: true,
56 lruCapacity: Server.config.lruCapacity, 56 lruCapacity: Server.config.lruCapacity,
57 maxInlayHintLength: Server.config.maxInlayHintLength, 57 maxInlayHintLength: Server.config.maxInlayHintLength,
58 cargoCheckEnable: Server.config.cargoCheckOptions.enabled, 58 cargoWatchEnable: Server.config.cargoWatchOptions.enable,
59 cargoCheckCommand: Server.config.cargoCheckOptions.command, 59 cargoWatchArgumets: Server.config.cargoWatchOptions.arguments,
60 cargoCheckArgs: Server.config.cargoCheckOptions.arguments, 60 cargoWatchCommand: Server.config.cargoWatchOptions.command,
61 cargoWatchAllTargets:
62 Server.config.cargoWatchOptions.allTargets,
61 excludeGlobs: Server.config.excludeGlobs, 63 excludeGlobs: Server.config.excludeGlobs,
62 useClientWatching: Server.config.useClientWatching, 64 useClientWatching: Server.config.useClientWatching,
63 featureFlags: Server.config.featureFlags, 65 featureFlags: Server.config.featureFlags,