-
Notifications
You must be signed in to change notification settings - Fork 11
/
LSP-rust-analyzer.sublime-settings
620 lines (617 loc) · 32.4 KB
/
LSP-rust-analyzer.sublime-settings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
{
"settings": {
// Settings Not Related to rust-analyzer Server
// Whether or not to automatically close terminus panel/tab upon completion.
"rust-analyzer.terminusAutoClose": false,
// Whether or not to spawn a panel at the bottom, or a new tab
"rust-analyzer.terminusUsePanel": false,
// Rust-Analyzer Server Settings
// Whether to show the test explorer.
"rust-analyzer.testExplorer": false,
// Whether to insert #[must_use] when generating as_ methods for enum variants.
"rust-analyzer.assist.emitMustUse": false,
// Placeholder expression to use for missing expressions in assists.
// possible values: todo, default
"rust-analyzer.assist.expressionFillDefault": "todo",
// Enable borrow checking for term search code assists. If set to false, also there will be more suggestions,
// but some of them may not borrow-check.
"rust-analyzer.assist.termSearch.borrowcheck": true,
// Term search fuel in "units of work" for assists (Defaults to 1800).
"rust-analyzer.assist.termSearch.fuel": 1800,
// Warm up caches on project load.
"rust-analyzer.cachePriming.enable": true,
// How many worker threads to handle priming caches. The default `0` means to pick automatically.
"rust-analyzer.cachePriming.numThreads": 0,
// Pass `--all-targets` to cargo invocation.
"rust-analyzer.cargo.allTargets": true,
// Automatically refresh project info via `cargo metadata` on
// `Cargo.toml` or `.cargo/config.toml` changes.
"rust-analyzer.cargo.autoreload": true,
// Run build scripts (`build.rs`) for more precise code analysis.
"rust-analyzer.cargo.buildScripts.enable": true,
// Specifies the invocation strategy to use when running the build scripts command.
// If `per_workspace` is set, the command will be executed for each Rust workspace with the
// workspace as the working directory.
// If `once` is set, the command will be executed once with the opened project as the
// working directory.
// This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#` is set.
"rust-analyzer.cargo.buildScripts.invocationStrategy": "per_workspace",
// Override the command rust-analyzer uses to run build scripts and
// build procedural macros. The command is required to output json
// and should therefore include `--message-format=json` or a similar option.
// If there are multiple linked projects/workspaces, this command is invoked for
// each of them, with the working directory being the workspace root
// (i.e., the folder containing the `Cargo.toml`). This can be overwritten
// by changing `#rust-analyzer.cargo.buildScripts.invocationStrategy#`.
// By default, a cargo invocation will be constructed for the configured
// targets and features, with the following base command line:
// ```bash
// cargo check --quiet --workspace --message-format=json --all-targets --keep-going
// ```
"rust-analyzer.cargo.buildScripts.overrideCommand": null,
// Rerun proc-macros building/build-scripts running when proc-macro
// or build-script sources change and are saved.
"rust-analyzer.cargo.buildScripts.rebuildOnSave": true,
// Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
// avoid checking unnecessary things.
"rust-analyzer.cargo.buildScripts.useRustcWrapper": true,
// List of cfg options to enable with the given values.
"rust-analyzer.cargo.cfgs": {
"miri": null,
"debug_assertions": null
},
// Extra arguments that are passed to every cargo invocation.
//
// ```json
// "rust-analyzer.cargo.extraArgs": ["--all-features"],
// ```
"rust-analyzer.cargo.extraArgs": [],
// Extra environment variables that will be set when running cargo,
// rustc or other commands within the workspace. Useful for setting RUSTFLAGS.
"rust-analyzer.cargo.extraEnv": {},
// List of features to activate.
// Set this to `"all"` to pass `--all-features` to cargo.
"rust-analyzer.cargo.features": [],
// Whether to pass `--no-default-features` to cargo.
"rust-analyzer.cargo.noDefaultFeatures": false,
// Relative path to the sysroot, or "discover" to try to automatically find
// it via "rustc --print sysroot". Unsetting this disables sysroot loading.
"rust-analyzer.cargo.sysroot": "discover",
// Relative path to the sysroot library sources. If left unset, this will default to
// `{cargo.sysroot}/lib/rustlib/src/rust/library`.
//
// ```json
// "rust-analyzer.cargo.sysrootSrc": "/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library",
// ```
"rust-analyzer.cargo.sysrootSrc": null,
// Compilation target override (target triple).
"rust-analyzer.cargo.target": null,
// Optional path to a rust-analyzer specific target directory.
// This prevents rust-analyzer's `cargo check` and initial build-script and proc-macro
// building from locking the `Cargo.lock` at the expense of duplicating build artifacts.
// Set to `true` to use a subdirectory of the existing target directory or
// set to a path relative to the workspace to use that path.
"rust-analyzer.cargo.targetDir": null,
// Set `cfg(test)` for local crates. Defaults to true.
"rust-analyzer.cfg.setTest": true,
// Run the check command for diagnostics on save.
"rust-analyzer.checkOnSave": true,
// Check all targets and tests (`--all-targets`).
// Defaults to `#rust-analyzer.cargo.allTargets#`
"rust-analyzer.check.allTargets": true,
// Cargo command to use for `cargo check`.
"rust-analyzer.check.command": "check",
// Extra arguments for `cargo check`.
"rust-analyzer.check.extraArgs": [],
// Extra environment variables that will be set when running cargo check.
// Extends rust-analyzer.cargo.extraEnv.
"rust-analyzer.check.extraEnv": {},
// List of features to activate. Defaults to `rust-analyzer.cargo.features`.
// Set to `"all"` to pass `--all-features` to Cargo.
"rust-analyzer.check.features": null,
// List of `cargo check` (or other command specified in `check.command`) diagnostics to ignore.
// For example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`,...
"rust-analyzer.check.ignore": [],
// Specifies the invocation strategy to use when running the check command.
// If `per_workspace` is set, the command will be executed for each workspace.
// If `once` is set, the command will be executed once.
// This config only has an effect when `rust-analyzer.check.overrideCommand` is set.
"rust-analyzer.check.invocationStrategy": "per_workspace",
// Whether to pass `--no-default-features` to Cargo. Defaults to `rust-analyzer.cargo.noDefaultFeatures`.
"rust-analyzer.check.noDefaultFeatures": null,
// Override the command rust-analyzer uses instead of `cargo check` for
// diagnostics on save. The command is required to output json and
// should therefore include `--message-format=json` or a similar option
// (if your client supports the `colorDiagnosticOutput` experimental
// capability, you can use `--message-format=json-diagnostic-rendered-ansi`).
// If you're changing this because you're using some tool wrapping
// Cargo, you might also want to change
// `#rust-analyzer.cargo.buildScripts.overrideCommand#`.
// If there are multiple linked projects/workspaces, this command is invoked for
// each of them, with the working directory being the workspace root
// (i.e., the folder containing the `Cargo.toml`). This can be overwritten
// by changing `#rust-analyzer.check.invocationStrategy#`.
// If `$saved_file` is part of the command, rust-analyzer will pass
// the absolute path of the saved file to the provided command. This is
// intended to be used with non-Cargo build systems.
// Note that `$saved_file` is experimental and may be removed in the future.
// An example command would be:
// ```bash
// cargo check --workspace --message-format=json --all-targets
// ```
"rust-analyzer.check.overrideCommand": null,
// Check for a specific target. Defaults to `rust-analyzer.cargo.target`.
//
// Can be a single target, e.g. `\"x86_64-unknown-linux-gnu\"` or a list of targets, e.g.
//`[\"aarch64-apple-darwin\", \"x86_64-apple-darwin\"]`
"rust-analyzer.check.targets": null,
// Whether `--workspace` should be passed to `cargo check`.
// If false, `-p <package>` will be passed instead.
"rust-analyzer.check.workspace": true,
// Whether to automatically add a semicolon when completing unit-returning functions.
//
// In `match` arms it completes a comma instead.
"rust-analyzer.completion.addSemicolonToUnit": true,
// Toggles the additional completions that automatically add imports when completed.
// Note that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.
"rust-analyzer.completion.autoimport.enable": true,
// Toggles the additional completions that automatically show method calls and field accesses
// with `self` prefixed to them when inside a method.
"rust-analyzer.completion.autoself.enable": true,
// Whether to add parenthesis and argument snippets when completing function.
// possible values: fill_arguments, add_parentheses, none
"rust-analyzer.completion.callable.snippets": "fill_arguments",
// Whether to show full function/method signatures in completion docs.
"rust-analyzer.completion.fullFunctionSignatures.enable": false,
// Whether to omit deprecated items from autocompletion. By default they are marked as deprecated but not hidden.
"rust-analyzer.completion.hideDeprecated": false,
// Maximum number of completions to return. If `null`, the limit is infinite.
//
// For a maximum of 5, use:
//
// ```json
// "rust-analyzer.completion.limit": 5,
// ```
"rust-analyzer.completion.limit": null,
// Whether to show postfix snippets like `dbg`, `if`, `not`, etc.
"rust-analyzer.completion.postfix.enable": true,
// Enables completions of private items and fields that are defined in the current workspace even if they are not visible
// at the current position.
"rust-analyzer.completion.privateEditable.enable": false,
// Custom completion snippets.
"rust-analyzer.completion.snippets.custom": {
"Ok": {
"postfix": "ok",
"body": "Ok(${receiver})",
"description": "Wrap the expression in a `Result::Ok`",
"scope": "expr"
},
"Box::pin": {
"postfix": "pinbox",
"body": "Box::pin(${receiver})",
"requires": "std::boxed::Box",
"description": "Put the expression into a pinned `Box`",
"scope": "expr"
},
"Arc::new": {
"postfix": "arc",
"body": "Arc::new(${receiver})",
"requires": "std::sync::Arc",
"description": "Put the expression into an `Arc`",
"scope": "expr"
},
"Some": {
"postfix": "some",
"body": "Some(${receiver})",
"description": "Wrap the expression in an `Option::Some`",
"scope": "expr"
},
"Err": {
"postfix": "err",
"body": "Err(${receiver})",
"description": "Wrap the expression in a `Result::Err`",
"scope": "expr"
},
"Rc::new": {
"postfix": "rc",
"body": "Rc::new(${receiver})",
"requires": "std::rc::Rc",
"description": "Put the expression into an `Rc`",
"scope": "expr"
}
},
// Whether to enable term search based snippets like `Some(foo.bar().baz())`.
"rust-analyzer.completion.termSearch.enable": false,
// Term search fuel in "units of work" for autocompletion (Defaults to 1000).
"rust-analyzer.completion.termSearch.fuel": 1000,
// List of rust-analyzer diagnostics to disable.
"rust-analyzer.diagnostics.disabled": [],
// Whether to show native rust-analyzer diagnostics.
"rust-analyzer.diagnostics.enable": true,
// Whether to show experimental rust-analyzer diagnostics that might
// have more false positives than usual.
"rust-analyzer.diagnostics.experimental.enable": false,
// Map of prefixes to be substituted when parsing diagnostic file paths.
// This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
"rust-analyzer.diagnostics.remapPrefix": {},
// Whether to show diagnostics using the original rustc error code. If this is false, all rustc diagnostics
// will have the code 'rustc(Click for full compiler diagnostics)'
"rust-analyzer.diagnostics.useRustcErrorCode": false,
// Whether to run additional style lints.
"rust-analyzer.diagnostics.styleLints.enable": false,
// List of warnings that should be displayed with hint severity.
// The warnings will be indicated by faded text or three dots in code
// and will not show up in the `Problems Panel`.
"rust-analyzer.diagnostics.warningsAsHint": [],
// List of warnings that should be displayed with info severity.
// The warnings will be indicated by a blue squiggly underline in code
// and a blue icon in the `Problems Panel`.
"rust-analyzer.diagnostics.warningsAsInfo": [],
// These directories will be ignored by rust-analyzer. They are
// relative to the workspace root, and globs are not supported. You may
// also need to add the folders to Code's `files.watcherExclude`.
"rust-analyzer.files.excludeDirs": [],
// Controls file watching implementation.
// possible values: client, server
"rust-analyzer.files.watcher": "client",
// Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
"rust-analyzer.highlightRelated.breakPoints.enable": true,
// Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure.
"rust-analyzer.highlightRelated.closureCaptures.enable": true,
// Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).
"rust-analyzer.highlightRelated.exitPoints.enable": true,
// Enables highlighting of related references while the cursor is on any identifier.
"rust-analyzer.highlightRelated.references.enable": true,
// Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await`
// keywords.
"rust-analyzer.highlightRelated.yieldPoints.enable": true,
// Whether to show `Debug` action. Only applies when `rust-analyzer.hover.actions.enable` is set.
"rust-analyzer.hover.actions.debug.enable": true,
// Whether to show HoverActions in Rust files.
"rust-analyzer.hover.actions.enable": true,
// Whether to show `Go to Type Definition` action. Only applies when `rust-analyzer.hover.actions.enable` is set.
"rust-analyzer.hover.actions.gotoTypeDef.enable": true,
// Whether to show `Implementations` action. Only applies when `rust-analyzer.hover.actions.enable` is set.
"rust-analyzer.hover.actions.implementations.enable": true,
// Whether to show `References` action. Only applies when `rust-analyzer.hover.actions.enable` is set.
"rust-analyzer.hover.actions.references.enable": false,
// Whether to show `Run` action. Only applies when `rust-analyzer.hover.actions.enable` is set.
"rust-analyzer.hover.actions.run.enable": true,
// Whether to show documentation on hover.
"rust-analyzer.hover.documentation.enable": true,
// Whether to show keyword hover popups. Only applies when `rust-analyzer.hover.documentation.enable` is set.
"rust-analyzer.hover.documentation.keywords.enable": true,
// Use markdown syntax for links on hover.
"rust-analyzer.hover.links.enable": true,
// How to render the align information in a memory layout hover.
"rust-analyzer.hover.memoryLayout.alignment": "hexadecimal",
// Whether to show memory layout data on hover.
"rust-analyzer.hover.memoryLayout.enable": true,
// How to render the niche information in a memory layout hover.
"rust-analyzer.hover.memoryLayout.niches": false,
// How to render the offset information in a memory layout hover.
"rust-analyzer.hover.memoryLayout.offset": "hexadecimal",
// How to render the size information in a memory layout hover.
"rust-analyzer.hover.memoryLayout.size": "both",
// How many variants of an enum to display when hovering on. Show none if empty.
"rust-analyzer.hover.show.enumVariants": 5,
// How many fields of a struct, variant or union to display when hovering on. Show none if empty.
"rust-analyzer.hover.show.fields": 5,
// How many associated items of a trait to display when hovering a trait.
"rust-analyzer.hover.show.traitAssocItems": null,
// Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import
// styles consistent per file.
"rust-analyzer.imports.granularity.enforce": false,
// How imports should be grouped into use statements.
// possible values: preserve, crate, module, item, one
"rust-analyzer.imports.granularity.group": "crate",
// Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are
// separated by newlines.
"rust-analyzer.imports.group.enable": true,
// Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
"rust-analyzer.imports.merge.glob": true,
// Prefer to unconditionally use imports of the core and alloc crate, over the std crate.
"rust-analyzer.imports.preferNoStd": false,
// Whether to prefer import paths containing a `prelude` module.
"rust-analyzer.imports.preferPrelude": false,
// The path structure for newly inserted paths to use.
// possible values: plain, self, crate
"rust-analyzer.imports.prefix": "plain",
// Whether to prefix external (including std, core) crate imports with `::`. e.g. "use ::std::io::Read;".
"rust-analyzer.imports.prefixExternPrelude": false,
// Whether to show inlay type hints for binding modes.
"rust-analyzer.inlayHints.bindingModeHints.enable": false,
// Whether to show inlay type hints for method chains.
"rust-analyzer.inlayHints.chainingHints.enable": true,
// Whether to show inlay hints after a closing `}` to indicate what item it belongs to.
"rust-analyzer.inlayHints.closingBraceHints.enable": true,
// Minimum number of lines required before the `}` until the hint is shown (set to 0 or 1
// to always show them).
"rust-analyzer.inlayHints.closingBraceHints.minLines": 25,
// Whether to show inlay hints for closure captures.
"rust-analyzer.inlayHints.closureCaptureHints.enable": false,
// Whether to show inlay type hints for return types of closures.
// possible values: always, never, with_block
"rust-analyzer.inlayHints.closureReturnTypeHints.enable": "never",
// Closure notation in type and chaining inlay hints.
"rust-analyzer.inlayHints.closureStyle": "impl_fn",
// Whether to show enum variant discriminant hints.
"rust-analyzer.inlayHints.discriminantHints.enable": "never",
// Whether to show inlay hints for type adjustments.
"rust-analyzer.inlayHints.expressionAdjustmentHints.enable": "never",
// Whether to hide inlay hints for type adjustments outside of unsafe blocks.
"rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe": false,
// Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc).
"rust-analyzer.inlayHints.expressionAdjustmentHints.mode": "prefix",
// Whether to show const generic parameter name inlay hints.
"rust-analyzer.inlayHints.genericParameterHints.const.enable": true,
// Whether to show generic lifetime parameter name inlay hints.
"rust-analyzer.inlayHints.genericParameterHints.lifetime.enable": false,
// Whether to show generic type parameter name inlay hints.
"rust-analyzer.inlayHints.genericParameterHints.type.enable": false,
// Whether to show implicit drop hints.
"rust-analyzer.inlayHints.implicitDrops.enable": false,
// Whether to show inlay type hints for elided lifetimes in function signatures.
// possible values: always, never, skip_trivial
"rust-analyzer.inlayHints.lifetimeElisionHints.enable": "never",
// Whether to prefer using parameter names as the name for elided lifetime hints if possible.
"rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames": false,
// Maximum length for inlay hints. Set to null to have an unlimited length.
"rust-analyzer.inlayHints.maxLength": 25,
// Whether to show function parameter name inlay hints at the call site.
"rust-analyzer.inlayHints.parameterHints.enable": true,
// Whether to show exclusive range inlay hints.
"rust-analyzer.inlayHints.rangeExclusiveHints.enable": false,
// Whether to show inlay type hints for compiler inserted reborrows.
// possible values: always, never, mutable
"rust-analyzer.inlayHints.reborrowHints.enable": "never",
// Whether to render leading colons for type hints, and trailing colons for parameter hints.
"rust-analyzer.inlayHints.renderColons": true,
// Whether to show inlay type hints for variables.
"rust-analyzer.inlayHints.typeHints.enable": true,
// Whether to hide inlay type hints for `let` statements that initialize to a closure.
// Only applies to closures with blocks, same as `rust-analyzer.inlayHints.closureReturnTypeHints.enable`.
"rust-analyzer.inlayHints.typeHints.hideClosureInitialization": false,
// Whether to hide inlay type hints for constructors.
"rust-analyzer.inlayHints.typeHints.hideNamedConstructor": false,
// Enables the experimental support for interpreting tests.
"rust-analyzer.interpret.tests": false,
// Join lines merges consecutive declaration and initialization of an assignment.
"rust-analyzer.joinLines.joinAssignments": true,
// Join lines inserts else between consecutive ifs.
"rust-analyzer.joinLines.joinElseIf": true,
// Join lines removes trailing commas.
"rust-analyzer.joinLines.removeTrailingComma": true,
// Join lines unwraps trivial blocks.
"rust-analyzer.joinLines.unwrapTrivialBlock": true,
// Whether to show `Debug` lens. Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.debug.enable": false,
// Whether to show CodeLens in Rust files.
"rust-analyzer.lens.enable": true,
// Whether to show `Implementations` lens. Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.implementations.enable": true,
// Where to render annotations.
"rust-analyzer.lens.location": "above_name",
// Whether to show `References` lens for Struct, Enum, and Union.
// Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.references.adt.enable": false,
// Whether to show `References` lens for Enum Variants. Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.references.enumVariant.enable": false,
// Whether to show `Method References` lens. Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.references.method.enable": false,
// Whether to show `References` lens for Trait. Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.references.trait.enable": false,
// Whether to show `Run` lens. Only applies when `rust-analyzer.lens.enable` is set.
"rust-analyzer.lens.run.enable": true,
// Disable project auto-discovery in favor of explicitly specified set
// of projects.
// Elements must be paths pointing to `Cargo.toml`,
// `rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON
// objects in `rust-project.json` format.
"rust-analyzer.linkedProjects": [],
// Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
"rust-analyzer.lru.capacity": null,
// Sets the LRU capacity of the specified queries.
"rust-analyzer.lru.query.capacities": {},
// Whether to show `can't find Cargo.toml` error message.
"rust-analyzer.notifications.cargoTomlNotFound": true,
// How many worker threads in the main loop. The default `null` means to pick automatically.
"rust-analyzer.numThreads": null,
// Expand attribute macros. Requires `rust-analyzer.procMacro.enable` to be set.
"rust-analyzer.procMacro.attributes.enable": true,
// Enable support for procedural macros, implies `rust-analyzer.cargo.buildScripts.enable`.
"rust-analyzer.procMacro.enable": true,
// These proc-macros will be ignored when trying to expand them.
// This config takes a map of crate names with the exported proc-macro names to ignore as values.
"rust-analyzer.procMacro.ignored": {},
// Internal config, path to proc-macro server executable.
"rust-analyzer.procMacro.server": null,
// Exclude imports from find-all-references.
"rust-analyzer.references.excludeImports": false,
// Exclude tests from find-all-references and call-hierarchy.
"rust-analyzer.references.excludeTests": false,
// Whether to restart the server automatically when certain settings that require a restart are changed.
"rust-analyzer.restartServerOnConfigChange": false,
// Command to be executed instead of 'cargo' for runnables.
"rust-analyzer.runnables.command": null,
// Additional arguments to be passed to cargo for runnables such as
// tests or binaries. For example, it may be `--release`.
"rust-analyzer.runnables.extraArgs": [],
// Environment variables passed to the runnable launched using `Test` or `Debug` lens or `rust-analyzer.run` command.
"rust-analyzer.runnables.extraEnv": null,
// Additional arguments to be passed through Cargo to launched tests, benchmarks, or
// doc-tests.
// Unless the launched target uses a
// [custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),
// they will end up being interpreted as options to
// [`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments).
"rust-analyzer.runnables.extraTestBinaryArgs": [
"--show-output"
],
// Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
// projects, or "discover" to try to automatically find it if the `rustc-dev` component
// is installed.
// Any project which uses rust-analyzer with the rustcPrivate
// crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
// This option does not take effect until rust-analyzer is restarted.
"rust-analyzer.rustc.source": null,
// Additional arguments to `rustfmt`.
"rust-analyzer.rustfmt.extraArgs": [],
// Advanced option, fully override the command rust-analyzer uses for formatting. This should be the equivalent
// of `rustfmt` here, and not that of `cargo fmt`. The file contents will be passed on the standard input and
// the formatted result will be read from the standard output.
"rust-analyzer.rustfmt.overrideCommand": null,
// Enables the use of rustfmt's unstable range formatting command for the
// `textDocument/rangeFormatting` request. The rustfmt option is unstable and only
// available on a nightly build.
"rust-analyzer.rustfmt.rangeFormatting.enable": false,
// Inject additional highlighting into doc comments.
// When enabled, rust-analyzer will highlight rust source in doc comments as well as intra
// doc links.
"rust-analyzer.semanticHighlighting.doc.comment.inject.enable": true,
// Whether the server is allowed to emit non-standard tokens and modifiers.
"rust-analyzer.semanticHighlighting.nonStandardTokens": true,
// Use semantic tokens for operators.
// When disabled, rust-analyzer will emit semantic tokens only for operator tokens when
// they are tagged with modifiers.
"rust-analyzer.semanticHighlighting.operator.enable": true,
// Use specialized semantic tokens for operators.
// When enabled, rust-analyzer will emit special token types for operator tokens instead
// of the generic `operator` token type.
"rust-analyzer.semanticHighlighting.operator.specialization.enable": false,
// Use semantic tokens for punctuation.
// When disabled, rust-analyzer will emit semantic tokens only for punctuation tokens when
// they are tagged with modifiers or have a special role.
"rust-analyzer.semanticHighlighting.punctuation.enable": false,
// When enabled, rust-analyzer will emit a punctuation semantic token for the `!` of macro
// calls.
"rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang": false,
// Use specialized semantic tokens for punctuation.
// When enabled, rust-analyzer will emit special token types for punctuation tokens instead
// of the generic `punctuation` token type.
"rust-analyzer.semanticHighlighting.punctuation.specialization.enable": false,
// Use semantic tokens for strings.
// In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
// By disabling semantic tokens for strings, other grammars can be used to highlight
// their contents.
"rust-analyzer.semanticHighlighting.strings.enable": true,
// Show full signature of the callable. Only shows parameters if disabled.
// possible values: full, parameters
"rust-analyzer.signatureInfo.detail": "full",
// Show documentation.
"rust-analyzer.signatureInfo.documentation.enable": true,
// Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
"rust-analyzer.typing.autoClosingAngleBrackets.enable": false,
// Enables automatic discovery of projects using [`DiscoverWorkspaceConfig::command`].
//
// [`DiscoverWorkspaceConfig`] also requires setting `progress_label` and `files_to_watch`.
// `progress_label` is used for the title in progress indicators, whereas `files_to_watch`
// is used to determine which build system-specific files should be watched in order to
// reload rust-analyzer.
//
// Below is an example of a valid configuration:
// ```json
// "rust-analyzer.workspace.discoverConfig": {
// "command": [
// "rust-project",
// "develop-json"
// ],
// "progressLabel": "rust-analyzer",
// "filesToWatch": [
// "BUCK"
// ]
// }
// ```
//
// ## On `DiscoverWorkspaceConfig::command`
//
// **Warning**: This format is provisional and subject to change.
//
// [`DiscoverWorkspaceConfig::command`] *must* return a JSON object
// corresponding to `DiscoverProjectData::Finished`:
//
// ```norun
// #[derive(Debug, Clone, Deserialize, Serialize)]
// #[serde(tag = "kind")]
// #[serde(rename_all = "snake_case")]
// enum DiscoverProjectData {
// Finished { buildfile: Utf8PathBuf, project: ProjectJsonData },
// Error { error: String, source: Option<String> },
// Progress { message: String },
// }
// ```
//
// As JSON, `DiscoverProjectData::Finished` is:
//
// ```json
// {
// // the internally-tagged representation of the enum.
// "kind": "finished",
// // the file used by a non-Cargo build system to define
// // a package or target.
// "buildfile": "rust-analyzer/BUILD",
// // the contents of a rust-project.json, elided for brevity
// "project": {
// "sysroot": "foo",
// "crates": []
// }
// }
//```
//
// It is encouraged, but not required, to use the other variants on
// `DiscoverProjectData` to provide a more polished end-user experience.
//
// `DiscoverWorkspaceConfig::command` may *optionally* include an `{arg}`,
// which will be substituted with the JSON-serialized form of the following
// enum:
//
// ```norun
// #[derive(PartialEq, Clone, Debug, Serialize)]
// #[serde(rename_all = "camelCase")]
// pub enum DiscoverArgument {
// Path(AbsPathBuf),
// Buildfile(AbsPathBuf),
// }
// ```
//
// The JSON representation of `DiscoverArgument::Path` is:
//
// ```json
// {
// "path": "src/main.rs"
// }
// ```
//
// Similarly, the JSON representation of `DiscoverArgument::Buildfile` is:
//
// ```
// {
// "buildfile": "BUILD"
// }
// ```
//
// `DiscoverArgument::Path` is used to find and generate a `rust-project.json`,
// and therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to
// to update an existing workspace. As a reference for implementors,
// buck2's `rust-project` will likely be useful:
// https://github.com/facebook/buck2/tree/main/integrations/rust-project.
"rust-analyzer.workspace.discoverConfig": null,
// Whether to prefix newlines after comments with the corresponding comment prefix.
"rust-analyzer.typing.continueCommentsOnNewline": true,
// Workspace symbol search kind.
// possible values: only_types, all_symbols
"rust-analyzer.workspace.symbol.search.kind": "only_types",
// Limits the number of items returned from a workspace symbol search (Defaults to 128).
// Some clients like vs-code issue new searches on result filtering and don't require all results to be returned in the
// initial search.
// Other clients requires all results upfront and might require a higher limit.
"rust-analyzer.workspace.symbol.search.limit": 128,
// Workspace symbol search scope.
// possible values: workspace, workspace_and_dependencies
"rust-analyzer.workspace.symbol.search.scope": "workspace",
},
"selector": "source.rust",
"command": [
"${storage_path}/LSP-rust-analyzer/rust-analyzer"
],
}