@@ -16,6 +16,41 @@ const exec = promisify(child_process.exec);
1616/** Rustup components required for the RLS to work correctly. */
1717const REQUIRED_COMPONENTS = [ 'rust-analysis' , 'rust-src' , 'rls' ] ;
1818
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+
1954/**
2055 * Parameter type to `window/progress` request as issued by the RLS.
2156 * https://github.com/rust-lang/rls/blob/17a439440e6b00b1f014a49c6cf47752ecae5bb7/rls/src/lsp_data.rs#L395-L419
@@ -59,7 +94,7 @@ export function createLanguageClient(
5994 documentFilter ( folder ) ,
6095 ] ,
6196 diagnosticCollectionName : `rust-${ folder . uri } ` ,
62- synchronize : { configurationSection : 'rust' } ,
97+ synchronize : { configurationSection : OBSERVED_SETTINGS } ,
6398 // Controls when to focus the channel rather than when to reveal it in the drop-down list
6499 revealOutputChannelOn : config . revealOutputChannelOn ,
65100 initializationOptions : {
0 commit comments