aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/Cargo.toml1
-rw-r--r--crates/ra_ide_db/src/defs.rs10
2 files changed, 9 insertions, 2 deletions
diff --git a/crates/ra_ide_db/Cargo.toml b/crates/ra_ide_db/Cargo.toml
index c3921bd40..bcddad60c 100644
--- a/crates/ra_ide_db/Cargo.toml
+++ b/crates/ra_ide_db/Cargo.toml
@@ -3,6 +3,7 @@ edition = "2018"
3name = "ra_ide_db" 3name = "ra_ide_db"
4version = "0.1.0" 4version = "0.1.0"
5authors = ["rust-analyzer developers"] 5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0"
6 7
7[lib] 8[lib]
8doctest = false 9doctest = false
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 3ef5e74b6..bcaabca92 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -255,8 +255,14 @@ pub fn classify_name_ref(
255 } 255 }
256 256
257 if let Some(macro_call) = parent.ancestors().find_map(ast::MacroCall::cast) { 257 if let Some(macro_call) = parent.ancestors().find_map(ast::MacroCall::cast) {
258 if let Some(macro_def) = sema.resolve_macro_call(&macro_call) { 258 if let Some(path) = macro_call.path() {
259 return Some(NameRefClass::Definition(Definition::Macro(macro_def))); 259 if path.qualifier().is_none() {
260 // Only use this to resolve single-segment macro calls like `foo!()`. Multi-segment
261 // paths are handled below (allowing `log<|>::info!` to resolve to the log crate).
262 if let Some(macro_def) = sema.resolve_macro_call(&macro_call) {
263 return Some(NameRefClass::Definition(Definition::Macro(macro_def)));
264 }
265 }
260 } 266 }
261 } 267 }
262 268