rust-analyzer/crates/project-model/src
Wilfred Hughes 3cf28f1fc6 fix: Updating settings should not clobber discovered projects
`linkedProjects` is owned by the user's configuration, so when users
update this setting, `linkedProjects` is reset. This is problematic when
`linkedProjects` also contains projects discovered with `discoverCommand`.

The buggy behaviour occurred when:

(1) The user configures `discoverCommand` and loads a Rust project.

(2) The user changes any setting in VS Code, so rust-analyzer receives
`workspace/didChangeConfiguration`.

(3) `handle_did_change_configuration` ultimately calls
`Client::apply_change_with_sink()`, which updates `config.user_config`
and discards any items we added in `linkedProjects`.

Instead, separate out `discovered_projects_from_filesystem` and
`discovered_projects_from_command` from user configuration, so user
settings cannot affect any type of discovered project.

This fixes the subtle issue mentioned here:
https://github.com/rust-lang/rust-analyzer/pull/17246#issuecomment-2185259122
2024-09-05 15:46:03 -07:00
..
build_dependencies.rs Improve documentation for InvocationStrategy 2024-08-19 14:23:05 +02:00
cargo_workspace.rs Auto merge of #17973 - Veykril:proc-macro-curr-dir, r=Veykril 2024-08-27 11:53:04 +00:00
env.rs Fix cwd used for proc macro expansion 2024-08-28 13:20:21 +03:00
lib.rs fix: Updating settings should not clobber discovered projects 2024-09-05 15:46:03 -07:00
manifest_path.rs feat: Load sysroot library via cargo metadata 2024-08-05 12:18:19 +02:00
project_json.rs fix: Updating settings should not clobber discovered projects 2024-09-05 15:46:03 -07:00
rustc_cfg.rs Remove unnecessary CfgFlag definition in project-model 2024-08-07 14:27:59 +02:00
sysroot.rs fix: Fix metadata retrying eating original errors 2024-08-25 09:28:47 +02:00
target_data_layout.rs Allow sysroots to only consist of the source root dir 2024-05-23 20:12:31 +02:00
tests.rs Fix cwd used for proc macro expansion 2024-08-28 13:20:21 +03:00
workspace.rs minor: Downgrade cyclic deps error to warning 2024-09-01 10:02:41 +02:00