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
|
@ -38,16 +38,17 @@ use language::{
|
|||
proto::{deserialize_anchor, deserialize_version, serialize_anchor, serialize_version},
|
||||
range_from_lsp, Bias, Buffer, BufferSnapshot, CachedLspAdapter, CodeLabel, Diagnostic,
|
||||
DiagnosticEntry, DiagnosticSet, Diff, Documentation, File as _, Language, LanguageName,
|
||||
LanguageRegistry, LanguageServerBinaryStatus, LanguageServerName, LanguageToolchainStore,
|
||||
LocalFile, LspAdapter, LspAdapterDelegate, Patch, PointUtf16, TextBufferSnapshot, ToOffset,
|
||||
ToPointUtf16, Transaction, Unclipped,
|
||||
LanguageRegistry, LanguageServerBinaryStatus, LanguageToolchainStore, LocalFile, LspAdapter,
|
||||
LspAdapterDelegate, Patch, PointUtf16, TextBufferSnapshot, ToOffset, ToPointUtf16, Transaction,
|
||||
Unclipped,
|
||||
};
|
||||
use lsp::{
|
||||
CodeActionKind, CompletionContext, DiagnosticSeverity, DiagnosticTag,
|
||||
DidChangeWatchedFilesRegistrationOptions, Edit, FileSystemWatcher, InsertTextFormat,
|
||||
LanguageServer, LanguageServerBinary, LanguageServerBinaryOptions, LanguageServerId,
|
||||
LspRequestFuture, MessageActionItem, MessageType, OneOf, ServerHealthStatus, ServerStatus,
|
||||
SymbolKind, TextEdit, Url, WorkDoneProgressCancelParams, WorkspaceFolder,
|
||||
LanguageServerName, LspRequestFuture, MessageActionItem, MessageType, OneOf,
|
||||
ServerHealthStatus, ServerStatus, SymbolKind, TextEdit, Url, WorkDoneProgressCancelParams,
|
||||
WorkspaceFolder,
|
||||
};
|
||||
use node_runtime::read_package_installed_version;
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
|
@ -5598,6 +5599,7 @@ impl LspStore {
|
|||
|
||||
let pending_server = cx.spawn({
|
||||
let adapter = adapter.clone();
|
||||
let server_name = adapter.name.clone();
|
||||
let stderr_capture = stderr_capture.clone();
|
||||
|
||||
move |_lsp_store, cx| async move {
|
||||
|
@ -5608,7 +5610,7 @@ impl LspStore {
|
|||
.update(&mut cx.clone(), |this, cx| {
|
||||
this.languages.create_fake_language_server(
|
||||
server_id,
|
||||
&adapter.name,
|
||||
&server_name,
|
||||
binary.clone(),
|
||||
cx.to_async(),
|
||||
)
|
||||
|
@ -5622,6 +5624,7 @@ impl LspStore {
|
|||
lsp::LanguageServer::new(
|
||||
stderr_capture,
|
||||
server_id,
|
||||
server_name,
|
||||
binary,
|
||||
&root_path,
|
||||
adapter.code_action_kinds(),
|
||||
|
@ -6617,7 +6620,7 @@ impl LspStore {
|
|||
|
||||
cx.emit(LspStoreEvent::LanguageServerAdded(
|
||||
server_id,
|
||||
language_server.name().into(),
|
||||
language_server.name(),
|
||||
Some(key.0),
|
||||
));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue