Add language server control tool into the status bar (#32490)

Release Notes:

- Added the language server control tool into the status bar

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
This commit is contained in:
Kirill Bulatov 2025-06-25 19:57:28 +03:00 committed by GitHub
parent 91c9281cea
commit c0acd8e8b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 1992 additions and 312 deletions

View file

@ -4,13 +4,13 @@ use crate::{
GrammarManifestEntry, RELOAD_DEBOUNCE_DURATION, SchemaVersion,
};
use async_compression::futures::bufread::GzipEncoder;
use collections::BTreeMap;
use collections::{BTreeMap, HashSet};
use extension::ExtensionHostProxy;
use fs::{FakeFs, Fs, RealFs};
use futures::{AsyncReadExt, StreamExt, io::BufReader};
use gpui::{AppContext as _, SemanticVersion, TestAppContext};
use http_client::{FakeHttpClient, Response};
use language::{BinaryStatus, LanguageMatcher, LanguageRegistry, LanguageServerStatusUpdate};
use language::{BinaryStatus, LanguageMatcher, LanguageRegistry};
use lsp::LanguageServerName;
use node_runtime::NodeRuntime;
use parking_lot::Mutex;
@ -720,20 +720,22 @@ async fn test_extension_store_with_test_extension(cx: &mut TestAppContext) {
status_updates.next().await.unwrap(),
status_updates.next().await.unwrap(),
status_updates.next().await.unwrap(),
status_updates.next().await.unwrap(),
],
[
(
LanguageServerName::new_static("gleam"),
LanguageServerStatusUpdate::Binary(BinaryStatus::CheckingForUpdate)
BinaryStatus::Starting
),
(
LanguageServerName::new_static("gleam"),
LanguageServerStatusUpdate::Binary(BinaryStatus::Downloading)
BinaryStatus::CheckingForUpdate
),
(
LanguageServerName::new_static("gleam"),
LanguageServerStatusUpdate::Binary(BinaryStatus::None)
)
BinaryStatus::Downloading
),
(LanguageServerName::new_static("gleam"), BinaryStatus::None)
]
);
@ -794,7 +796,7 @@ async fn test_extension_store_with_test_extension(cx: &mut TestAppContext) {
// Start a new instance of the language server.
project.update(cx, |project, cx| {
project.restart_language_servers_for_buffers(vec![buffer.clone()], cx)
project.restart_language_servers_for_buffers(vec![buffer.clone()], HashSet::default(), cx)
});
cx.executor().run_until_parked();
@ -816,7 +818,7 @@ async fn test_extension_store_with_test_extension(cx: &mut TestAppContext) {
cx.executor().run_until_parked();
project.update(cx, |project, cx| {
project.restart_language_servers_for_buffers(vec![buffer.clone()], cx)
project.restart_language_servers_for_buffers(vec![buffer.clone()], HashSet::default(), cx)
});
// The extension re-fetches the latest version of the language server.