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

@ -5,7 +5,7 @@ use gpui::{
Size, StrikethroughStyle, StyledText, UniformListScrollHandle, WeakEntity,
};
use language::Buffer;
use language::{CodeLabel, Documentation};
use language::{CodeLabel, CompletionDocumentation};
use lsp::LanguageServerId;
use multi_buffer::{Anchor, ExcerptId};
use ordered_float::OrderedFloat;
@ -474,7 +474,7 @@ impl CompletionsMenu {
let documentation = &completion.documentation;
let mut len = completion.label.text.chars().count();
if let Some(Documentation::SingleLine(text)) = documentation {
if let Some(CompletionDocumentation::SingleLine(text)) = documentation {
if show_completion_documentation {
len += text.chars().count();
}
@ -558,7 +558,9 @@ impl CompletionsMenu {
StyledText::new(completion.label.text.clone())
.with_highlights(&style.text, highlights);
let documentation_label =
if let Some(Documentation::SingleLine(text)) = documentation {
if let Some(CompletionDocumentation::SingleLine(text)) =
documentation
{
if text.trim().is_empty() {
None
} else {
@ -710,20 +712,23 @@ impl CompletionsMenu {
.documentation
.as_ref()?
{
Documentation::MultiLinePlainText(text) => {
CompletionDocumentation::MultiLinePlainText(text) => {
div().child(SharedString::from(text.clone()))
}
Documentation::MultiLineMarkdown(parsed) if !parsed.text.is_empty() => div()
.child(render_parsed_markdown(
CompletionDocumentation::MultiLineMarkdown(parsed)
if !parsed.text.is_empty() =>
{
div().child(render_parsed_markdown(
"completions_markdown",
parsed,
&style,
workspace,
cx,
)),
Documentation::MultiLineMarkdown(_) => return None,
Documentation::SingleLine(_) => return None,
Documentation::Undocumented => return None,
))
}
CompletionDocumentation::MultiLineMarkdown(_) => return None,
CompletionDocumentation::SingleLine(_) => return None,
CompletionDocumentation::Undocumented => return None,
}
}
CompletionEntry::InlineCompletionHint(InlineCompletionMenuHint::Loaded { text }) => {

View file

@ -96,9 +96,9 @@ use itertools::Itertools;
use language::{
language_settings::{self, all_language_settings, language_settings, InlayHintSettings},
markdown, point_from_lsp, AutoindentMode, BracketPair, Buffer, Capability, CharKind, CodeLabel,
CursorShape, Diagnostic, Documentation, EditPreview, HighlightedText, IndentKind, IndentSize,
Language, OffsetRangeExt, Point, Selection, SelectionGoal, TextObject, TransactionId,
TreeSitterOptions,
CompletionDocumentation, CursorShape, Diagnostic, EditPreview, HighlightedText, IndentKind,
IndentSize, Language, OffsetRangeExt, Point, Selection, SelectionGoal, TextObject,
TransactionId, TreeSitterOptions,
};
use language::{point_to_lsp, BufferRow, CharClassifier, Runnable, RunnableRange};
use linked_editing_ranges::refresh_linked_ranges;
@ -14723,7 +14723,10 @@ fn snippet_completions(
filter_range: 0..matching_prefix.len(),
},
server_id: LanguageServerId(usize::MAX),
documentation: snippet.description.clone().map(Documentation::SingleLine),
documentation: snippet
.description
.clone()
.map(CompletionDocumentation::SingleLine),
lsp_completion: lsp::CompletionItem {
label: snippet.prefix.first().unwrap().clone(),
kind: Some(CompletionItemKind::SNIPPET),