Solve 50+ cargo doc warnings (#24071)

Release Notes:

- N/A
This commit is contained in:
João Marcos 2025-02-01 03:19:29 -03:00 committed by GitHub
parent 39d45bcbc1
commit 5bd7eaa173
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 99 additions and 89 deletions

View file

@ -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();