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
|
@ -154,7 +154,7 @@ impl Prettier {
|
|||
node: NodeRuntime,
|
||||
cx: AsyncAppContext,
|
||||
) -> anyhow::Result<Self> {
|
||||
use lsp::LanguageServerBinary;
|
||||
use lsp::{LanguageServerBinary, LanguageServerName};
|
||||
|
||||
let executor = cx.background_executor().clone();
|
||||
anyhow::ensure!(
|
||||
|
@ -170,14 +170,17 @@ impl Prettier {
|
|||
let node_path = executor
|
||||
.spawn(async move { node.binary_path().await })
|
||||
.await?;
|
||||
let server_name = LanguageServerName("prettier".into());
|
||||
let server_binary = LanguageServerBinary {
|
||||
path: node_path,
|
||||
arguments: vec![prettier_server.into(), prettier_dir.as_path().into()],
|
||||
env: None,
|
||||
};
|
||||
let server = LanguageServer::new(
|
||||
Arc::new(parking_lot::Mutex::new(None)),
|
||||
server_id,
|
||||
LanguageServerBinary {
|
||||
path: node_path,
|
||||
arguments: vec![prettier_server.into(), prettier_dir.as_path().into()],
|
||||
env: None,
|
||||
},
|
||||
server_name,
|
||||
server_binary,
|
||||
&prettier_dir,
|
||||
None,
|
||||
cx.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue