language servers: Fix wrong language server name (#20428)
This fixes the issue of multiple language servers showing up as `node` in the language server logs dropdown. It does this by changing `language_server.name()` to return the adapter's name, not the binary name, and changing types to make sure that we always use this. Release Notes: - Fixed language server names showing up only as `"node"` --------- Co-authored-by: Sam Rose <hello@samwho.dev> Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
parent
f4024cc602
commit
a97ab5eb3d
39 changed files with 172 additions and 151 deletions
|
@ -1243,7 +1243,7 @@ async fn test_disk_based_diagnostics_progress(cx: &mut gpui::TestAppContext) {
|
|||
events.next().await.unwrap(),
|
||||
Event::LanguageServerAdded(
|
||||
LanguageServerId(0),
|
||||
fake_server.server.name().into(),
|
||||
fake_server.server.name(),
|
||||
Some(worktree_id)
|
||||
),
|
||||
);
|
||||
|
@ -1378,7 +1378,7 @@ async fn test_restarting_server_with_diagnostics_running(cx: &mut gpui::TestAppC
|
|||
events.next().await.unwrap(),
|
||||
Event::LanguageServerAdded(
|
||||
LanguageServerId(1),
|
||||
fake_server.server.name().into(),
|
||||
fake_server.server.name(),
|
||||
Some(worktree_id)
|
||||
)
|
||||
);
|
||||
|
@ -4865,11 +4865,10 @@ async fn test_multiple_language_server_hovers(cx: &mut gpui::TestAppContext) {
|
|||
});
|
||||
let new_server_name = new_server.server.name();
|
||||
assert!(
|
||||
!servers_with_hover_requests.contains_key(new_server_name),
|
||||
!servers_with_hover_requests.contains_key(&new_server_name),
|
||||
"Unexpected: initialized server with the same name twice. Name: `{new_server_name}`"
|
||||
);
|
||||
let new_server_name = new_server_name.to_string();
|
||||
match new_server_name.as_str() {
|
||||
match new_server_name.as_ref() {
|
||||
"TailwindServer" | "TypeScriptServer" => {
|
||||
servers_with_hover_requests.insert(
|
||||
new_server_name.clone(),
|
||||
|
@ -5089,11 +5088,10 @@ async fn test_multiple_language_server_actions(cx: &mut gpui::TestAppContext) {
|
|||
let new_server_name = new_server.server.name();
|
||||
|
||||
assert!(
|
||||
!servers_with_actions_requests.contains_key(new_server_name),
|
||||
!servers_with_actions_requests.contains_key(&new_server_name),
|
||||
"Unexpected: initialized server with the same name twice. Name: `{new_server_name}`"
|
||||
);
|
||||
let new_server_name = new_server_name.to_string();
|
||||
match new_server_name.as_str() {
|
||||
match new_server_name.0.as_ref() {
|
||||
"TailwindServer" | "TypeScriptServer" => {
|
||||
servers_with_actions_requests.insert(
|
||||
new_server_name.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue