parent
39d45bcbc1
commit
5bd7eaa173
35 changed files with 99 additions and 89 deletions
|
@ -36,7 +36,7 @@ use language::{
|
|||
markdown, point_to_lsp, prepare_completion_documentation,
|
||||
proto::{deserialize_anchor, deserialize_version, serialize_anchor, serialize_version},
|
||||
range_from_lsp, range_to_lsp, Bias, Buffer, BufferSnapshot, CachedLspAdapter, CodeLabel,
|
||||
Diagnostic, DiagnosticEntry, DiagnosticSet, Diff, Documentation, File as _, Language,
|
||||
CompletionDocumentation, Diagnostic, DiagnosticEntry, DiagnosticSet, Diff, File as _, Language,
|
||||
LanguageName, LanguageRegistry, LanguageServerBinaryStatus, LanguageToolchainStore, LocalFile,
|
||||
LspAdapter, LspAdapterDelegate, Patch, PointUtf16, TextBufferSnapshot, ToOffset, ToPointUtf16,
|
||||
Transaction, Unclipped,
|
||||
|
@ -4359,7 +4359,7 @@ impl LspStore {
|
|||
} else {
|
||||
let mut completions = completions.borrow_mut();
|
||||
let completion = &mut completions[completion_index];
|
||||
completion.documentation = Some(Documentation::Undocumented);
|
||||
completion.documentation = Some(CompletionDocumentation::Undocumented);
|
||||
}
|
||||
|
||||
// NB: Zed does not have `details` inside the completion resolve capabilities, but certain language servers violate the spec and do not return `details` immediately, e.g. https://github.com/yioneko/vtsls/issues/213
|
||||
|
@ -4434,16 +4434,16 @@ impl LspStore {
|
|||
let lsp_completion = serde_json::from_slice(&response.lsp_completion)?;
|
||||
|
||||
let documentation = if response.documentation.is_empty() {
|
||||
Documentation::Undocumented
|
||||
CompletionDocumentation::Undocumented
|
||||
} else if response.documentation_is_markdown {
|
||||
Documentation::MultiLineMarkdown(
|
||||
CompletionDocumentation::MultiLineMarkdown(
|
||||
markdown::parse_markdown(&response.documentation, Some(&language_registry), None)
|
||||
.await,
|
||||
)
|
||||
} else if response.documentation.lines().count() <= 1 {
|
||||
Documentation::SingleLine(response.documentation)
|
||||
CompletionDocumentation::SingleLine(response.documentation)
|
||||
} else {
|
||||
Documentation::MultiLinePlainText(response.documentation)
|
||||
CompletionDocumentation::MultiLinePlainText(response.documentation)
|
||||
};
|
||||
|
||||
let mut completions = completions.borrow_mut();
|
||||
|
|
|
@ -56,9 +56,9 @@ use gpui::{
|
|||
use itertools::Itertools;
|
||||
use language::{
|
||||
language_settings::InlayHintKind, proto::split_operations, Buffer, BufferEvent,
|
||||
CachedLspAdapter, Capability, CodeLabel, Documentation, File as _, Language, LanguageName,
|
||||
LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList, Transaction,
|
||||
Unclipped,
|
||||
CachedLspAdapter, Capability, CodeLabel, CompletionDocumentation, File as _, Language,
|
||||
LanguageName, LanguageRegistry, PointUtf16, ToOffset, ToPointUtf16, Toolchain, ToolchainList,
|
||||
Transaction, Unclipped,
|
||||
};
|
||||
use lsp::{
|
||||
CodeActionKind, CompletionContext, CompletionItemKind, DocumentHighlightKind, LanguageServer,
|
||||
|
@ -368,7 +368,7 @@ pub struct Completion {
|
|||
/// The id of the language server that produced this completion.
|
||||
pub server_id: LanguageServerId,
|
||||
/// The documentation for this completion.
|
||||
pub documentation: Option<Documentation>,
|
||||
pub documentation: Option<CompletionDocumentation>,
|
||||
/// The raw completion provided by the language server.
|
||||
pub lsp_completion: lsp::CompletionItem,
|
||||
/// Whether this completion has been resolved, to ensure it happens once per completion.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue