Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 5f13286

Browse files
committed
Only synchronize options relevant to RLS
1 parent 5e5712c commit 5f13286

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Unreleased
22

3+
* Only synchronize relevant workspace settings for RLS
34
* Rename configuration section to just "Rust"
45

56
### 0.7.6 - 2020-05-12

src/rls.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,41 @@ const exec = promisify(child_process.exec);
1616
/** Rustup components required for the RLS to work correctly. */
1717
const 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

Comments
 (0)