aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/package-lock.json46
-rw-r--r--editors/code/package.json16
-rw-r--r--editors/code/src/commands/cargo_watch.ts7
-rw-r--r--editors/code/src/config.ts11
4 files changed, 48 insertions, 32 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index e4b706ce6..e6bcbfa60 100644
--- a/editors/code/package-lock.json
+++ b/editors/code/package-lock.json
@@ -87,9 +87,9 @@
87 "dev": true 87 "dev": true
88 }, 88 },
89 "acorn": { 89 "acorn": {
90 "version": "7.0.0", 90 "version": "7.1.0",
91 "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", 91 "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
92 "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", 92 "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
93 "dev": true 93 "dev": true
94 }, 94 },
95 "agent-base": { 95 "agent-base": {
@@ -1212,22 +1212,14 @@
1212 } 1212 }
1213 }, 1213 },
1214 "rollup": { 1214 "rollup": {
1215 "version": "1.21.4", 1215 "version": "1.23.1",
1216 "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.21.4.tgz", 1216 "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.23.1.tgz",
1217 "integrity": "sha512-Pl512XVCmVzgcBz5h/3Li4oTaoDcmpuFZ+kdhS/wLreALz//WuDAMfomD3QEYl84NkDu6Z6wV9twlcREb4qQsw==", 1217 "integrity": "sha512-95C1GZQpr/NIA0kMUQmSjuMDQ45oZfPgDBcN0yZwBG7Kee//m7H68vgIyg+SPuyrTZ5PrXfyLK80OzXeKG5dAA==",
1218 "dev": true, 1218 "dev": true,
1219 "requires": { 1219 "requires": {
1220 "@types/estree": "0.0.39", 1220 "@types/estree": "*",
1221 "@types/node": "^12.7.5", 1221 "@types/node": "*",
1222 "acorn": "^7.0.0" 1222 "acorn": "^7.1.0"
1223 },
1224 "dependencies": {
1225 "@types/node": {
1226 "version": "12.7.5",
1227 "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
1228 "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==",
1229 "dev": true
1230 }
1231 } 1223 }
1232 }, 1224 },
1233 "rollup-plugin-commonjs": { 1225 "rollup-plugin-commonjs": {
@@ -1315,9 +1307,9 @@
1315 } 1307 }
1316 }, 1308 },
1317 "safe-buffer": { 1309 "safe-buffer": {
1318 "version": "5.1.2", 1310 "version": "5.2.0",
1319 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1311 "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
1320 "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 1312 "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
1321 "dev": true 1313 "dev": true
1322 }, 1314 },
1323 "seedrandom": { 1315 "seedrandom": {
@@ -1410,12 +1402,12 @@
1410 } 1402 }
1411 }, 1403 },
1412 "string_decoder": { 1404 "string_decoder": {
1413 "version": "1.2.0", 1405 "version": "1.3.0",
1414 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", 1406 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
1415 "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", 1407 "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
1416 "dev": true, 1408 "dev": true,
1417 "requires": { 1409 "requires": {
1418 "safe-buffer": "~5.1.0" 1410 "safe-buffer": "~5.2.0"
1419 } 1411 }
1420 }, 1412 },
1421 "strip-ansi": { 1413 "strip-ansi": {
@@ -1546,9 +1538,9 @@
1546 "dev": true 1538 "dev": true
1547 }, 1539 },
1548 "vsce": { 1540 "vsce": {
1549 "version": "1.66.0", 1541 "version": "1.67.1",
1550 "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.66.0.tgz", 1542 "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.67.1.tgz",
1551 "integrity": "sha512-Zf4+WD4PhEcOr7jkU08SI9lwFqDhmhk73YOCGQ/tNLaBy+PnnX4eSdqj9LdzDLuI2dsyomJLXzDSNgxuaInxCQ==", 1543 "integrity": "sha512-Y/0fnfaLs2cCfytTGmy4Cp1bf9BaxHO7020YePdUwxjAlPlZ9+lm74M9yEFEWXTIug0L0sMax1WMz0TnozIqxg==",
1552 "dev": true, 1544 "dev": true,
1553 "requires": { 1545 "requires": {
1554 "azure-devops-node-api": "^7.2.0", 1546 "azure-devops-node-api": "^7.2.0",
diff --git a/editors/code/package.json b/editors/code/package.json
index 35211bcc2..4b719aada 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -39,11 +39,11 @@
39 "@types/mocha": "^5.2.7", 39 "@types/mocha": "^5.2.7",
40 "@types/node": "^10.14.13", 40 "@types/node": "^10.14.13",
41 "@types/seedrandom": "^2.4.28", 41 "@types/seedrandom": "^2.4.28",
42 "@types/vscode": "^1.36.0", 42 "@types/vscode": "^1.37.0",
43 "glob": "^7.1.4", 43 "glob": "^7.1.4",
44 "mocha": "^6.2.0", 44 "mocha": "^6.2.0",
45 "prettier": "^1.18.2", 45 "prettier": "^1.18.2",
46 "rollup": "^1.21.4", 46 "rollup": "^1.23.1",
47 "rollup-plugin-commonjs": "^10.1.0", 47 "rollup-plugin-commonjs": "^10.1.0",
48 "rollup-plugin-node-resolve": "^5.2.0", 48 "rollup-plugin-node-resolve": "^5.2.0",
49 "rollup-plugin-typescript": "^1.0.1", 49 "rollup-plugin-typescript": "^1.0.1",
@@ -51,7 +51,7 @@
51 "tslint": "^5.18.0", 51 "tslint": "^5.18.0",
52 "tslint-config-prettier": "^1.18.0", 52 "tslint-config-prettier": "^1.18.0",
53 "typescript": "^3.5.3", 53 "typescript": "^3.5.3",
54 "vsce": "^1.66.0", 54 "vsce": "^1.67.0",
55 "vscode-test": "^1.2.0" 55 "vscode-test": "^1.2.0"
56 }, 56 },
57 "activationEvents": [ 57 "activationEvents": [
@@ -224,6 +224,16 @@
224 "description": "`cargo-watch` command. (e.g: `clippy` will run as `cargo watch -x clippy` )", 224 "description": "`cargo-watch` command. (e.g: `clippy` will run as `cargo watch -x clippy` )",
225 "default": "check" 225 "default": "check"
226 }, 226 },
227 "rust-analyzer.cargo-watch.ignore": {
228 "type": "array",
229 "description": "A list of patterns for cargo-watch to ignore (will be passed as `--ignore`)",
230 "default": []
231 },
232 "rust-analyzer.showWorkspaceLoadedNotification": {
233 "type": "boolean",
234 "description": "Controls whether rust-analyzer displays a notification when a project is loaded.",
235 "default": false
236 },
227 "rust-analyzer.trace.server": { 237 "rust-analyzer.trace.server": {
228 "type": "string", 238 "type": "string",
229 "scope": "window", 239 "scope": "window",
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts
index 00b24dbce..59d4ba97a 100644
--- a/editors/code/src/commands/cargo_watch.ts
+++ b/editors/code/src/commands/cargo_watch.ts
@@ -93,10 +93,15 @@ export class CargoWatchProvider implements vscode.Disposable {
93 args = '"' + args + '"'; 93 args = '"' + args + '"';
94 } 94 }
95 95
96 const ignoreFlags = Server.config.cargoWatchOptions.ignore.reduce(
97 (flags, pattern) => [...flags, '--ignore', pattern],
98 [] as string[]
99 );
100
96 // Start the cargo watch with json message 101 // Start the cargo watch with json message
97 this.cargoProcess = child_process.spawn( 102 this.cargoProcess = child_process.spawn(
98 'cargo', 103 'cargo',
99 ['watch', '-x', args], 104 ['watch', '-x', args, ...ignoreFlags],
100 { 105 {
101 stdio: ['ignore', 'pipe', 'pipe'], 106 stdio: ['ignore', 'pipe', 'pipe'],
102 cwd: vscode.workspace.rootPath, 107 cwd: vscode.workspace.rootPath,
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 2578bc6d1..331936b5e 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -12,6 +12,7 @@ export interface CargoWatchOptions {
12 arguments: string; 12 arguments: string;
13 command: string; 13 command: string;
14 trace: CargoWatchTraceOptions; 14 trace: CargoWatchTraceOptions;
15 ignore: string[];
15} 16}
16 17
17export class Config { 18export class Config {
@@ -30,7 +31,8 @@ export class Config {
30 enableOnStartup: 'ask', 31 enableOnStartup: 'ask',
31 trace: 'off', 32 trace: 'off',
32 arguments: '', 33 arguments: '',
33 command: '' 34 command: '',
35 ignore: []
34 }; 36 };
35 37
36 private prevEnhancedTyping: null | boolean = null; 38 private prevEnhancedTyping: null | boolean = null;
@@ -125,6 +127,13 @@ export class Config {
125 ); 127 );
126 } 128 }
127 129
130 if (config.has('cargo-watch.ignore')) {
131 this.cargoWatchOptions.ignore = config.get<string[]>(
132 'cargo-watch.ignore',
133 []
134 );
135 }
136
128 if (config.has('lruCapacity')) { 137 if (config.has('lruCapacity')) {
129 this.lruCapacity = config.get('lruCapacity') as number; 138 this.lruCapacity = config.get('lruCapacity') as number;
130 } 139 }