Load worktree settings when loading options for language servers (#7615)

Previously we only looked at the global settings, this changes that to
start looking in local settings first and then fall back to global ones.

Fixes #4279.

Release Notes:

- Fixed language server configurations not being picked up from local,
worktree-specific settings.
([#4279](https://github.com/zed-industries/zed/issues/4279)).

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
This commit is contained in:
Thorsten Ball 2024-02-09 16:06:29 +01:00 committed by GitHub
parent f3bfa11148
commit ad97e447f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2787,7 +2787,8 @@ impl Project {
None => return,
};
let project_settings = ProjectSettings::get_global(cx);
let project_settings =
ProjectSettings::get(Some((worktree_id.to_proto() as usize, Path::new(""))), cx);
let lsp = project_settings.lsp.get(&adapter.name.0);
let override_options = lsp.map(|s| s.initialization_options.clone()).flatten();