Skip to content

Commit e25cbf8

Browse files
committed
Auto merge of #12430 - Veykril:completions, r=Veykril
minor: Remove unused code
2 parents e107995 + 1234d86 commit e25cbf8

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

crates/ide-completion/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ impl<'a> CompletionContext<'a> {
383383
// FIXME: This shouldn't exist
384384
pub(crate) fn is_path_disallowed(&self) -> bool {
385385
!self.qualifier_ctx.none()
386-
|| matches!(self.prev_sibling, Some(ImmediatePrevSibling::Visibility))
387386
|| (matches!(self.name_ctx(), Some(NameContext { .. })) && self.pattern_ctx.is_none())
388387
|| matches!(self.pattern_ctx, Some(PatternContext { record_pat: Some(_), .. }))
389388
|| matches!(

crates/ide-completion/src/patterns.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub(crate) enum ImmediatePrevSibling {
2323
IfExpr,
2424
TraitDefName,
2525
ImplDefType,
26-
Visibility,
2726
}
2827

2928
#[derive(Clone, Debug, PartialEq, Eq)]
@@ -77,17 +76,6 @@ pub(crate) fn determine_prev_sibling(name_like: &ast::NameLike) -> Option<Immedi
7776
_ => node,
7877
};
7978
let prev_sibling = non_trivia_sibling(node.into(), Direction::Prev)?.into_node()?;
80-
if prev_sibling.kind() == ERROR {
81-
let prev_sibling = prev_sibling.first_child()?;
82-
let res = match_ast! {
83-
match prev_sibling {
84-
// vis followed by random ident will always error the parser
85-
ast::Visibility(_) => ImmediatePrevSibling::Visibility,
86-
_ => return None,
87-
}
88-
};
89-
return Some(res);
90-
}
9179
let res = match_ast! {
9280
match prev_sibling {
9381
ast::ExprStmt(it) => {
@@ -442,9 +430,4 @@ mod tests {
442430
check_prev_sibling(r"fn foo() { if true {} w$0", ImmediatePrevSibling::IfExpr);
443431
check_prev_sibling(r"fn foo() { if true {}; w$0", None);
444432
}
445-
446-
#[test]
447-
fn test_vis_prev_sibling() {
448-
check_prev_sibling(r"pub w$0", ImmediatePrevSibling::Visibility);
449-
}
450433
}

0 commit comments

Comments
 (0)