project: Fine-grained language server management (#24038)

Closes #ISSUE
https://github.com/zed-industries/zed/pull/23804
Release Notes:

- Improved detection of project roots for use by language servers.

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: smit <0xtimsb@gmail.com>
Co-authored-by: Henrikh Kantuni <henrikh.kantuni@gmail.com>
Co-authored-by: Caleb! <48127194+kaf-lamed-beyt@users.noreply.github.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
This commit is contained in:
Piotr Osiewicz 2025-02-14 15:41:49 +01:00 committed by GitHub
parent 8d839fca06
commit a618830aea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 2350 additions and 962 deletions

View file

@ -370,6 +370,7 @@ mod tests {
use language::{Language, LanguageConfig, LanguageMatcher};
use project::{FakeFs, Project};
use serde_json::json;
use util::path;
use workspace::{AppState, Workspace};
#[gpui::test]
@ -377,7 +378,7 @@ mod tests {
init_test(cx);
let fs = FakeFs::new(cx.executor());
fs.insert_tree(
"/dir",
path!("/dir"),
json!({
"a.rs": indoc!{"
struct SingleLine; // display line 0
@ -391,7 +392,7 @@ mod tests {
)
.await;
let project = Project::test(fs, ["/dir".as_ref()], cx).await;
let project = Project::test(fs, [path!("/dir").as_ref()], cx).await;
project.read_with(cx, |project, _| project.languages().add(rust_lang()));
let (workspace, cx) =
@ -402,7 +403,9 @@ mod tests {
})
});
let _buffer = project
.update(cx, |project, cx| project.open_local_buffer("/dir/a.rs", cx))
.update(cx, |project, cx| {
project.open_local_buffer(path!("/dir/a.rs"), cx)
})
.await
.unwrap();
let editor = workspace