internal: Simplify some completions

This commit is contained in:
Lukas Wirth 2022-06-20 21:55:33 +02:00
parent 8b078986dc
commit 7a0774defa
11 changed files with 147 additions and 222 deletions

View file

@ -148,7 +148,7 @@ pub fn completions(
config: &CompletionConfig,
position: FilePosition,
trigger_character: Option<char>,
) -> Option<Completions> {
) -> Option<Vec<CompletionItem>> {
let (ctx, analysis) = &CompletionContext::new(db, position, config)?;
let mut completions = Completions::default();
@ -163,7 +163,7 @@ pub fn completions(
}
}
// prevent `(` from triggering unwanted completion noise
return Some(completions);
return Some(completions.into());
}
{
@ -197,7 +197,7 @@ pub fn completions(
}
}
Some(completions)
Some(completions.into())
}
/// Resolves additional completion data at the position given.