aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/config.ts59
-rw-r--r--editors/code/src/server.ts3
2 files changed, 18 insertions, 44 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index e131f09df..96532e2c9 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -4,16 +4,10 @@ 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 type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled'; 7export interface CargoCheckOptions {
8export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose'; 8 enabled: boolean;
9 9 arguments: string[];
10export interface CargoWatchOptions { 10 command: null | string;
11 enableOnStartup: CargoWatchStartupOptions;
12 arguments: string;
13 command: string;
14 trace: CargoWatchTraceOptions;
15 ignore: string[];
16 allTargets: boolean;
17} 11}
18 12
19export interface CargoFeatures { 13export interface CargoFeatures {
@@ -35,13 +29,10 @@ export class Config {
35 public featureFlags = {}; 29 public featureFlags = {};
36 // for internal use 30 // for internal use
37 public withSysroot: null | boolean = null; 31 public withSysroot: null | boolean = null;
38 public cargoWatchOptions: CargoWatchOptions = { 32 public cargoCheckOptions: CargoCheckOptions = {
39 enableOnStartup: 'ask', 33 enabled: true,
40 trace: 'off', 34 arguments: [],
41 arguments: '', 35 command: null,
42 command: '',
43 ignore: [],
44 allTargets: true,
45 }; 36 };
46 public cargoFeatures: CargoFeatures = { 37 public cargoFeatures: CargoFeatures = {
47 noDefaultFeatures: false, 38 noDefaultFeatures: false,
@@ -100,47 +91,27 @@ export class Config {
100 RA_LSP_DEBUG || (config.get('raLspServerPath') as string); 91 RA_LSP_DEBUG || (config.get('raLspServerPath') as string);
101 } 92 }
102 93
103 if (config.has('enableCargoWatchOnStartup')) { 94 if (config.has('enableCargoCheck')) {
104 this.cargoWatchOptions.enableOnStartup = config.get< 95 this.cargoCheckOptions.enabled = config.get<boolean>(
105 CargoWatchStartupOptions 96 'enableCargoCheck',
106 >('enableCargoWatchOnStartup', 'ask'); 97 true,
107 }
108
109 if (config.has('trace.cargo-watch')) {
110 this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>(
111 'trace.cargo-watch',
112 'off',
113 ); 98 );
114 } 99 }
115 100
116 if (config.has('cargo-watch.arguments')) { 101 if (config.has('cargo-watch.arguments')) {
117 this.cargoWatchOptions.arguments = config.get<string>( 102 this.cargoCheckOptions.arguments = config.get<string[]>(
118 'cargo-watch.arguments', 103 'cargo-watch.arguments',
119 '', 104 [],
120 ); 105 );
121 } 106 }
122 107
123 if (config.has('cargo-watch.command')) { 108 if (config.has('cargo-watch.command')) {
124 this.cargoWatchOptions.command = config.get<string>( 109 this.cargoCheckOptions.command = config.get<string>(
125 'cargo-watch.command', 110 'cargo-watch.command',
126 '', 111 '',
127 ); 112 );
128 } 113 }
129 114
130 if (config.has('cargo-watch.ignore')) {
131 this.cargoWatchOptions.ignore = config.get<string[]>(
132 'cargo-watch.ignore',
133 [],
134 );
135 }
136
137 if (config.has('cargo-watch.allTargets')) {
138 this.cargoWatchOptions.allTargets = config.get<boolean>(
139 'cargo-watch.allTargets',
140 true,
141 );
142 }
143
144 if (config.has('lruCapacity')) { 115 if (config.has('lruCapacity')) {
145 this.lruCapacity = config.get('lruCapacity') as number; 116 this.lruCapacity = config.get('lruCapacity') as number;
146 } 117 }
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 5ace1d0fa..409d3b4b7 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -55,6 +55,9 @@ 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,
59 cargoCheckCommand: Server.config.cargoCheckOptions.command,
60 cargoCheckArgs: Server.config.cargoCheckOptions.arguments,
58 excludeGlobs: Server.config.excludeGlobs, 61 excludeGlobs: Server.config.excludeGlobs,
59 useClientWatching: Server.config.useClientWatching, 62 useClientWatching: Server.config.useClientWatching,
60 featureFlags: Server.config.featureFlags, 63 featureFlags: Server.config.featureFlags,