diff options
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/defs.rs | 10 | ||||
-rw-r--r-- | crates/ide_db/src/symbol_index.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index 1dcccbb8b..a54f2c323 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs | |||
@@ -357,9 +357,9 @@ impl NameRefClass { | |||
357 | } | 357 | } |
358 | } | 358 | } |
359 | 359 | ||
360 | if let Some(macro_call) = parent.ancestors().find_map(ast::MacroCall::cast) { | 360 | if let Some(path) = name_ref.syntax().ancestors().find_map(ast::Path::cast) { |
361 | if let Some(path) = macro_call.path() { | 361 | if path.qualifier().is_none() { |
362 | if path.qualifier().is_none() { | 362 | if let Some(macro_call) = path.syntax().parent().and_then(ast::MacroCall::cast) { |
363 | // Only use this to resolve single-segment macro calls like `foo!()`. Multi-segment | 363 | // Only use this to resolve single-segment macro calls like `foo!()`. Multi-segment |
364 | // paths are handled below (allowing `log$0::info!` to resolve to the log crate). | 364 | // paths are handled below (allowing `log$0::info!` to resolve to the log crate). |
365 | if let Some(macro_def) = sema.resolve_macro_call(¯o_call) { | 365 | if let Some(macro_def) = sema.resolve_macro_call(¯o_call) { |
@@ -367,11 +367,9 @@ impl NameRefClass { | |||
367 | } | 367 | } |
368 | } | 368 | } |
369 | } | 369 | } |
370 | } | ||
371 | 370 | ||
372 | if let Some(path) = name_ref.syntax().ancestors().find_map(ast::Path::cast) { | ||
373 | if let Some(resolved) = sema.resolve_path(&path) { | 371 | if let Some(resolved) = sema.resolve_path(&path) { |
374 | if path.syntax().parent().and_then(ast::Attr::cast).is_some() { | 372 | if path.syntax().ancestors().find_map(ast::Attr::cast).is_some() { |
375 | if let PathResolution::Def(ModuleDef::Function(func)) = resolved { | 373 | if let PathResolution::Def(ModuleDef::Function(func)) = resolved { |
376 | if func.attrs(sema.db).by_key("proc_macro_attribute").exists() { | 374 | if func.attrs(sema.db).by_key("proc_macro_attribute").exists() { |
377 | return Some(NameRefClass::Definition(resolved.into())); | 375 | return Some(NameRefClass::Definition(resolved.into())); |
diff --git a/crates/ide_db/src/symbol_index.rs b/crates/ide_db/src/symbol_index.rs index 5c372a7e5..000f87a85 100644 --- a/crates/ide_db/src/symbol_index.rs +++ b/crates/ide_db/src/symbol_index.rs | |||
@@ -197,6 +197,7 @@ pub fn world_symbols(db: &RootDatabase, query: Query) -> Vec<FileSymbol> { | |||
197 | } | 197 | } |
198 | 198 | ||
199 | pub fn crate_symbols(db: &RootDatabase, krate: CrateId, query: Query) -> Vec<FileSymbol> { | 199 | pub fn crate_symbols(db: &RootDatabase, krate: CrateId, query: Query) -> Vec<FileSymbol> { |
200 | let _p = profile::span("crate_symbols").detail(|| format!("{:?}", query)); | ||
200 | // FIXME(#4842): This now depends on CrateDefMap, why not build the entire symbol index from | 201 | // FIXME(#4842): This now depends on CrateDefMap, why not build the entire symbol index from |
201 | // that instead? | 202 | // that instead? |
202 | 203 | ||
@@ -321,6 +322,7 @@ impl SymbolIndex { | |||
321 | 322 | ||
322 | impl Query { | 323 | impl Query { |
323 | pub(crate) fn search(self, indices: &[&SymbolIndex]) -> Vec<FileSymbol> { | 324 | pub(crate) fn search(self, indices: &[&SymbolIndex]) -> Vec<FileSymbol> { |
325 | let _p = profile::span("symbol_index::Query::search"); | ||
324 | let mut op = fst::map::OpBuilder::new(); | 326 | let mut op = fst::map::OpBuilder::new(); |
325 | for file_symbols in indices.iter() { | 327 | for file_symbols in indices.iter() { |
326 | let automaton = fst::automaton::Subsequence::new(&self.lowercased); | 328 | let automaton = fst::automaton::Subsequence::new(&self.lowercased); |