about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorEmil Lauridsen <mine809@gmail.com>2019-12-25 20:23:44 +0100
committerEmil Lauridsen <mine809@gmail.com>2019-12-25 20:26:06 +0100
commit0cdbd0814958e174c5481d6bf16bd2a7e53ec981 (patch)
treea58277467e67ebdf8584ad2edf398ca630d6fd35 /editors/code/src
parent71d2d81dcc879bbb7898df11ac00578e93b27ab5 (diff)
downloadrust-0cdbd0814958e174c5481d6bf16bd2a7e53ec981.tar.gz
rust-0cdbd0814958e174c5481d6bf16bd2a7e53ec981.zip
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 96532e2c9d5..4b388b80c54 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -4,10 +4,11 @@ import { Server } from './server';
 
 const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
 
-export interface CargoCheckOptions {
-    enabled: boolean;
+export interface CargoWatchOptions {
+    enable: boolean;
     arguments: string[];
-    command: null | string;
+    command: string;
+    allTargets: boolean;
 }
 
 export interface CargoFeatures {
@@ -29,10 +30,11 @@ export class Config {
     public featureFlags = {};
     // for internal use
     public withSysroot: null | boolean = null;
-    public cargoCheckOptions: CargoCheckOptions = {
-        enabled: true,
+    public cargoWatchOptions: CargoWatchOptions = {
+        enable: true,
         arguments: [],
-        command: null,
+        command: '',
+        allTargets: true,
     };
     public cargoFeatures: CargoFeatures = {
         noDefaultFeatures: false,
@@ -91,27 +93,34 @@ export class Config {
                 RA_LSP_DEBUG || (config.get('raLspServerPath') as string);
         }
 
-        if (config.has('enableCargoCheck')) {
-            this.cargoCheckOptions.enabled = config.get<boolean>(
-                'enableCargoCheck',
+        if (config.has('cargo-watch.enable')) {
+            this.cargoWatchOptions.enable = config.get<boolean>(
+                'cargo-watch.enable',
                 true,
             );
         }
 
         if (config.has('cargo-watch.arguments')) {
-            this.cargoCheckOptions.arguments = config.get<string[]>(
+            this.cargoWatchOptions.arguments = config.get<string[]>(
                 'cargo-watch.arguments',
                 [],
             );
         }
 
         if (config.has('cargo-watch.command')) {
-            this.cargoCheckOptions.command = config.get<string>(
+            this.cargoWatchOptions.command = config.get<string>(
                 'cargo-watch.command',
                 '',
             );
         }
 
+        if (config.has('cargo-watch.allTargets')) {
+            this.cargoWatchOptions.allTargets = config.get<boolean>(
+                'cargo-watch.allTargets',
+                true,
+            );
+        }
+
         if (config.has('lruCapacity')) {
             this.lruCapacity = config.get('lruCapacity') as number;
         }
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index 36163b6bb61..1da10ebd06f 100644
--- a/editors/code/src/extension.ts
+++ b/editors/code/src/extension.ts
@@ -85,7 +85,7 @@ export async function activate(context: vscode.ExtensionContext) {
     }
 
     const watchStatus = new StatusDisplay(
-        Server.config.cargoCheckOptions.command || 'check',
+        Server.config.cargoWatchOptions.command,
     );
     disposeOnDeactivation(watchStatus);
 
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 409d3b4b738..ae81af84835 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -55,9 +55,11 @@ export class Server {
                 publishDecorations: true,
                 lruCapacity: Server.config.lruCapacity,
                 maxInlayHintLength: Server.config.maxInlayHintLength,
-                cargoCheckEnable: Server.config.cargoCheckOptions.enabled,
-                cargoCheckCommand: Server.config.cargoCheckOptions.command,
-                cargoCheckArgs: Server.config.cargoCheckOptions.arguments,
+                cargoWatchEnable: Server.config.cargoWatchOptions.enable,
+                cargoWatchArgumets: Server.config.cargoWatchOptions.arguments,
+                cargoWatchCommand: Server.config.cargoWatchOptions.command,
+                cargoWatchAllTargets:
+                    Server.config.cargoWatchOptions.allTargets,
                 excludeGlobs: Server.config.excludeGlobs,
                 useClientWatching: Server.config.useClientWatching,
                 featureFlags: Server.config.featureFlags,