},
"rust-analyzer.cargo-watch.check-arguments": {
"type": "string",
- "description": "`cargo-watch` check arguments. (e.g: `--features=\"shumway,pdf\"` will run as `cargo watch -x \"check --features=\"shumway,pdf\"\"` )",
+ "description": "`cargo-watch` arguments. (e.g: `--features=\"shumway,pdf\"` will run as `cargo watch -x \"check --features=\"shumway,pdf\"\"` )",
"default": ""
},
+ "rust-analyzer.cargo-watch.check-command": {
+ "type": "string",
+ "description": "`cargo-watch` command. (e.g: `clippy` will run as `cargo watch -x clippy` )",
+ "default": "check"
+ },
"rust-analyzer.trace.server": {
"type": "string",
"scope": "window",
this.diagnosticCollection = vscode.languages.createDiagnosticCollection(
'rustc'
);
- this.statusDisplay = new StatusDisplay();
+ this.statusDisplay = new StatusDisplay(Server.config.cargoWatchOptions.checkCommand);
this.outputChannel = vscode.window.createOutputChannel(
'Cargo Watch Trace'
);
return;
}
- let args = 'check --all-targets --message-format json';
+ let command = Server.config.cargoWatchOptions.checkCommand;
+
+ let args = command + ' --all-targets --message-format json';
if (Server.config.cargoWatchOptions.checkArguments.length > 0) {
// Excape the double quote string:
args += ' ' + Server.config.cargoWatchOptions.checkArguments;
private i = 0;
private statusBarItem: vscode.StatusBarItem;
+ private command: string;
private timer?: NodeJS.Timeout;
- constructor() {
+ constructor(command: string) {
this.statusBarItem = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Left,
10
);
+ this.command = command;
this.statusBarItem.hide();
}
this.timer ||
setInterval(() => {
if (this.packageName) {
- this.statusBarItem!.text = `cargo check [${
+ this.statusBarItem!.text = `cargo ${this.command} [${
this.packageName
}] ${this.frame()}`;
} else {
- this.statusBarItem!.text = `cargo check ${this.frame()}`;
+ this.statusBarItem!.text = `cargo ${this.command} ${this.frame()}`;
}
}, 300);
import * as vscode from 'vscode';
import { Server } from './server';
+import { strict } from 'assert';
const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
export interface CargoWatchOptions {
enableOnStartup: CargoWatchStartupOptions;
checkArguments: string;
+ checkCommand: string;
trace: CargoWatchTraceOptions;
}
public cargoWatchOptions: CargoWatchOptions = {
enableOnStartup: 'ask',
trace: 'off',
- checkArguments: ''
+ checkArguments: '',
+ checkCommand: ''
};
private prevEnhancedTyping: null | boolean = null;
''
);
}
+
+ if (config.has('cargo-watch.check-command')) {
+ this.cargoWatchOptions.checkCommand = config.get<string>(
+ 'cargo-watch.check-command',
+ ''
+ );
+ }
+
if (config.has('lruCapacity')) {
this.lruCapacity = config.get('lruCapacity') as number;
}