aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_db/src')
-rw-r--r--crates/ra_ide_db/src/defs.rs20
-rw-r--r--crates/ra_ide_db/src/search.rs2
-rw-r--r--crates/ra_ide_db/src/symbol_index.rs14
3 files changed, 18 insertions, 18 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 1464c5f2a..b908bd741 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -142,7 +142,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
142 142
143 Some(NameClass::Definition(Definition::Local(local))) 143 Some(NameClass::Definition(Definition::Local(local)))
144 }, 144 },
145 ast::RecordFieldDef(it) => { 145 ast::RecordField(it) => {
146 let field: hir::Field = sema.to_def(&it)?; 146 let field: hir::Field = sema.to_def(&it)?;
147 Some(NameClass::Definition(Definition::Field(field))) 147 Some(NameClass::Definition(Definition::Field(field)))
148 }, 148 },
@@ -150,15 +150,15 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
150 let def = sema.to_def(&it)?; 150 let def = sema.to_def(&it)?;
151 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 151 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
152 }, 152 },
153 ast::StructDef(it) => { 153 ast::Struct(it) => {
154 let def: hir::Struct = sema.to_def(&it)?; 154 let def: hir::Struct = sema.to_def(&it)?;
155 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 155 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
156 }, 156 },
157 ast::UnionDef(it) => { 157 ast::Union(it) => {
158 let def: hir::Union = sema.to_def(&it)?; 158 let def: hir::Union = sema.to_def(&it)?;
159 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 159 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
160 }, 160 },
161 ast::EnumDef(it) => { 161 ast::Enum(it) => {
162 let def: hir::Enum = sema.to_def(&it)?; 162 let def: hir::Enum = sema.to_def(&it)?;
163 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 163 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
164 }, 164 },
@@ -166,23 +166,23 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
166 let def: hir::Trait = sema.to_def(&it)?; 166 let def: hir::Trait = sema.to_def(&it)?;
167 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 167 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
168 }, 168 },
169 ast::StaticDef(it) => { 169 ast::Static(it) => {
170 let def: hir::Static = sema.to_def(&it)?; 170 let def: hir::Static = sema.to_def(&it)?;
171 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 171 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
172 }, 172 },
173 ast::EnumVariant(it) => { 173 ast::Variant(it) => {
174 let def: hir::EnumVariant = sema.to_def(&it)?; 174 let def: hir::EnumVariant = sema.to_def(&it)?;
175 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 175 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
176 }, 176 },
177 ast::FnDef(it) => { 177 ast::Fn(it) => {
178 let def: hir::Function = sema.to_def(&it)?; 178 let def: hir::Function = sema.to_def(&it)?;
179 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 179 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
180 }, 180 },
181 ast::ConstDef(it) => { 181 ast::Const(it) => {
182 let def: hir::Const = sema.to_def(&it)?; 182 let def: hir::Const = sema.to_def(&it)?;
183 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 183 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
184 }, 184 },
185 ast::TypeAliasDef(it) => { 185 ast::TypeAlias(it) => {
186 let def: hir::TypeAlias = sema.to_def(&it)?; 186 let def: hir::TypeAlias = sema.to_def(&it)?;
187 Some(NameClass::Definition(Definition::ModuleDef(def.into()))) 187 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
188 }, 188 },
@@ -236,7 +236,7 @@ pub fn classify_name_ref(
236 } 236 }
237 } 237 }
238 238
239 if let Some(record_field) = ast::RecordField::for_field_name(name_ref) { 239 if let Some(record_field) = ast::RecordExprField::for_field_name(name_ref) {
240 if let Some((field, local)) = sema.resolve_record_field(&record_field) { 240 if let Some((field, local)) = sema.resolve_record_field(&record_field) {
241 let field = Definition::Field(field); 241 let field = Definition::Field(field);
242 let res = match local { 242 let res = match local {
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs
index a7cae37b0..0b862b449 100644
--- a/crates/ra_ide_db/src/search.rs
+++ b/crates/ra_ide_db/src/search.rs
@@ -315,7 +315,7 @@ fn is_record_lit_name_ref(name_ref: &ast::NameRef) -> bool {
315 name_ref 315 name_ref
316 .syntax() 316 .syntax()
317 .ancestors() 317 .ancestors()
318 .find_map(ast::RecordLit::cast) 318 .find_map(ast::RecordExpr::cast)
319 .and_then(|l| l.path()) 319 .and_then(|l| l.path())
320 .and_then(|p| p.segment()) 320 .and_then(|p| p.segment())
321 .map(|p| p.name_ref().as_ref() == Some(name_ref)) 321 .map(|p| p.name_ref().as_ref() == Some(name_ref))
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs
index 131e2a128..41b8d07f4 100644
--- a/crates/ra_ide_db/src/symbol_index.rs
+++ b/crates/ra_ide_db/src/symbol_index.rs
@@ -344,7 +344,7 @@ impl Query {
344} 344}
345 345
346fn is_type(kind: SyntaxKind) -> bool { 346fn is_type(kind: SyntaxKind) -> bool {
347 matches!(kind, STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS_DEF) 347 matches!(kind, STRUCT | ENUM | TRAIT_DEF | TYPE_ALIAS)
348} 348}
349 349
350/// The actual data that is stored in the index. It should be as compact as 350/// The actual data that is stored in the index. It should be as compact as
@@ -397,14 +397,14 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> {
397 } 397 }
398 match_ast! { 398 match_ast! {
399 match node { 399 match node {
400 ast::FnDef(it) => decl(it), 400 ast::Fn(it) => decl(it),
401 ast::StructDef(it) => decl(it), 401 ast::Struct(it) => decl(it),
402 ast::EnumDef(it) => decl(it), 402 ast::Enum(it) => decl(it),
403 ast::TraitDef(it) => decl(it), 403 ast::TraitDef(it) => decl(it),
404 ast::Module(it) => decl(it), 404 ast::Module(it) => decl(it),
405 ast::TypeAliasDef(it) => decl(it), 405 ast::TypeAlias(it) => decl(it),
406 ast::ConstDef(it) => decl(it), 406 ast::Const(it) => decl(it),
407 ast::StaticDef(it) => decl(it), 407 ast::Static(it) => decl(it),
408 ast::MacroCall(it) => { 408 ast::MacroCall(it) => {
409 if it.is_macro_rules().is_some() { 409 if it.is_macro_rules().is_some() {
410 decl(it) 410 decl(it)