This commit is contained in:
Lukas Wirth 2023-02-15 13:38:42 +01:00
parent 89b9940491
commit 026a8c976d
5 changed files with 91 additions and 107 deletions

View file

@ -156,13 +156,15 @@ pub fn completions(
// prevent `(` from triggering unwanted completion noise
if trigger_character == Some('(') {
if let CompletionAnalysis::NameRef(NameRefContext { kind, .. }) = &analysis {
if let NameRefKind::Path(
path_ctx @ PathCompletionCtx { kind: PathKind::Vis { has_in_token }, .. },
) = kind
{
completions::vis::complete_vis_path(&mut completions, ctx, path_ctx, has_in_token);
}
if let CompletionAnalysis::NameRef(NameRefContext {
kind:
NameRefKind::Path(
path_ctx @ PathCompletionCtx { kind: PathKind::Vis { has_in_token }, .. },
),
..
}) = analysis
{
completions::vis::complete_vis_path(&mut completions, ctx, path_ctx, has_in_token);
}
return Some(completions.into());
}
@ -170,7 +172,7 @@ pub fn completions(
{
let acc = &mut completions;
match &analysis {
match analysis {
CompletionAnalysis::Name(name_ctx) => completions::complete_name(acc, ctx, name_ctx),
CompletionAnalysis::NameRef(name_ref_ctx) => {
completions::complete_name_ref(acc, ctx, name_ref_ctx)