@@ -16,6 +16,41 @@ const exec = promisify(child_process.exec);
16
16
/** Rustup components required for the RLS to work correctly. */
17
17
const REQUIRED_COMPONENTS = [ 'rust-analysis' , 'rust-src' , 'rls' ] ;
18
18
19
+ /**
20
+ * VSCode settings to be observed and sent to RLS whenever they change.
21
+ * Previously we just used 'rust' but since RLS warns against unrecognized
22
+ * options and because we want to unify the options behind a single 'rust'
23
+ * namespace for both client/server configuration, we explicitly list the
24
+ * settings previously sent to the RLS.
25
+ * TODO: Replace RLS' configuration setup with workspace/configuration request.
26
+ */
27
+ const OBSERVED_SETTINGS = [
28
+ 'rust.sysroot' ,
29
+ 'rust.target' ,
30
+ 'rust.rustflags' ,
31
+ 'rust.clear_env_rust_log' ,
32
+ 'rust.build_lib' ,
33
+ 'rust.build_bin' ,
34
+ 'rust.cfg_test' ,
35
+ 'rust.unstable_features' ,
36
+ 'rust.wait_to_build' ,
37
+ 'rust.show_warnings' ,
38
+ 'rust.crate_blacklist' ,
39
+ 'rust.build_on_save' ,
40
+ 'rust.features' ,
41
+ 'rust.all_features' ,
42
+ 'rust.no_default_features' ,
43
+ 'rust.racer_completion' ,
44
+ 'rust.clippy_preference' ,
45
+ 'rust.jobs' ,
46
+ 'rust.all_targets' ,
47
+ 'rust.target_dir' ,
48
+ 'rust.rustfmt_path' ,
49
+ 'rust.build_command' ,
50
+ 'rust.full_docs' ,
51
+ 'rust.show_hover_context' ,
52
+ ] ;
53
+
19
54
/**
20
55
* Parameter type to `window/progress` request as issued by the RLS.
21
56
* https://github.com/rust-lang/rls/blob/17a439440e6b00b1f014a49c6cf47752ecae5bb7/rls/src/lsp_data.rs#L395-L419
@@ -59,7 +94,7 @@ export function createLanguageClient(
59
94
documentFilter ( folder ) ,
60
95
] ,
61
96
diagnosticCollectionName : `rust-${ folder . uri } ` ,
62
- synchronize : { configurationSection : 'rust' } ,
97
+ synchronize : { configurationSection : OBSERVED_SETTINGS } ,
63
98
// Controls when to focus the channel rather than when to reveal it in the drop-down list
64
99
revealOutputChannelOn : config . revealOutputChannelOn ,
65
100
initializationOptions : {
0 commit comments