diff options
| author | Ilya Titkov <ilya@titkov.me> | 2020-02-17 11:44:58 +0300 |
|---|---|---|
| committer | Ilya Titkov <ilya@titkov.me> | 2020-02-17 11:44:58 +0300 |
| commit | a2b0bdcc24a64061364aaa017bf6caef1810da7c (patch) | |
| tree | e434da0a4a0d6f8413be638d6c5d98a215e98792 /editors/code | |
| parent | 32fc890de87e25c342b7c141ef98b07cb1471128 (diff) | |
| download | rust-a2b0bdcc24a64061364aaa017bf6caef1810da7c.tar.gz rust-a2b0bdcc24a64061364aaa017bf6caef1810da7c.zip | |
Add arguments to rustfmt
Diffstat (limited to 'editors/code')
| -rw-r--r-- | editors/code/package.json | 18 | ||||
| -rw-r--r-- | editors/code/src/client.ts | 1 | ||||
| -rw-r--r-- | editors/code/src/config.ts | 3 |
3 files changed, 19 insertions, 3 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index ed1cae2ab27..46acbfe76cd 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -188,6 +188,14 @@ "default": [], "description": "Paths to exclude from analysis" }, + "rust-analyzer.rustfmtArgs": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Additional arguments to rustfmt" + }, "rust-analyzer.useClientWatching": { "type": "boolean", "default": true, @@ -233,7 +241,10 @@ "description": "Trace requests to the ra_lsp_server" }, "rust-analyzer.lruCapacity": { - "type": [ "null", "integer" ], + "type": [ + "null", + "integer" + ], "default": null, "minimum": 0, "exclusiveMinimum": true, @@ -245,7 +256,10 @@ "description": "Display additional type and parameter information in the editor" }, "rust-analyzer.maxInlayHintLength": { - "type": [ "null", "integer" ], + "type": [ + "null", + "integer" + ], "default": 20, "minimum": 0, "exclusiveMinimum": true, diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index efef820abfa..11894973cd7 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -42,6 +42,7 @@ export async function createClient(config: Config): Promise<null | lc.LanguageCl featureFlags: config.featureFlags, withSysroot: config.withSysroot, cargoFeatures: config.cargoFeatures, + rustfmtArgs: config.rustfmtArgs, }, traceOutputChannel, }; diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 70cb0a612a0..5fffd1fa714 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -149,7 +149,8 @@ export class Config { get excludeGlobs() { return this.cfg.get("excludeGlobs") as string[]; } get useClientWatching() { return this.cfg.get("useClientWatching") as boolean; } get featureFlags() { return this.cfg.get("featureFlags") as Record<string, boolean>; } - + get rustfmtArgs() { return this.cfg.get("rustfmtArgs") as string[]; } + get cargoWatchOptions(): CargoWatchOptions { return { enable: this.cfg.get("cargo-watch.enable") as boolean, |
