Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/patterns.rs')
-rw-r--r--crates/ide_completion/src/patterns.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/crates/ide_completion/src/patterns.rs b/crates/ide_completion/src/patterns.rs
index 13c739325c..b50f76b911 100644
--- a/crates/ide_completion/src/patterns.rs
+++ b/crates/ide_completion/src/patterns.rs
@@ -33,8 +33,6 @@ pub(crate) enum ImmediatePrevSibling {
/// from which file the nodes are.
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) enum ImmediateLocation {
- Use,
- UseTree,
Rename,
Impl,
Trait,
@@ -47,10 +45,7 @@ pub(crate) enum ImmediateLocation {
TypeBound,
Variant,
/// Fake file ast node
- Attribute(ast::Attr),
- /// Fake file ast node
ModDeclaration(ast::Module),
- Visibility(ast::Visibility),
/// Original file ast node
MethodCall {
receiver: Option<ast::Expr>,
@@ -206,9 +201,6 @@ pub(crate) fn determine_location(
let res = match_ast! {
match parent {
ast::IdentPat(_it) => ImmediateLocation::IdentPat,
- ast::Use(_it) => ImmediateLocation::Use,
- ast::UseTree(_it) => ImmediateLocation::UseTree,
- ast::UseTreeList(_it) => ImmediateLocation::UseTree,
ast::Rename(_it) => ImmediateLocation::Rename,
ast::StmtList(_it) => ImmediateLocation::StmtList,
ast::SourceFile(_it) => ImmediateLocation::ItemList,
@@ -242,7 +234,6 @@ pub(crate) fn determine_location(
return None;
}
},
- ast::Attr(it) => ImmediateLocation::Attribute(it),
ast::FieldExpr(it) => {
let receiver = it
.expr()
@@ -268,8 +259,6 @@ pub(crate) fn determine_location(
.and_then(|r| find_node_with_range(original_file, r)),
has_parens: it.arg_list().map_or(false, |it| it.l_paren_token().is_some())
},
- ast::Visibility(it) => it.pub_token()
- .and_then(|t| (t.text_range().end() < offset).then(|| ImmediateLocation::Visibility(it)))?,
_ => return None,
}
};
@@ -418,14 +407,6 @@ mod tests {
}
#[test]
- fn test_use_loc() {
- check_location(r"use f$0", ImmediateLocation::Use);
- check_location(r"use f$0;", ImmediateLocation::Use);
- check_location(r"use f::{f$0}", ImmediateLocation::UseTree);
- check_location(r"use {f$0}", ImmediateLocation::UseTree);
- }
-
- #[test]
fn test_record_field_loc() {
check_location(r"struct Foo { f$0 }", ImmediateLocation::RecordField);
check_location(r"struct Foo { f$0 pub f: i32}", ImmediateLocation::RecordField);