diff options
author | uHOOCCOOHu <[email protected]> | 2019-09-26 18:59:38 +0100 |
---|---|---|
committer | uHOOCCOOHu <[email protected]> | 2019-09-26 19:05:06 +0100 |
commit | 2ecb126f5caeb248e333f8559eb1b7dfd34cc744 (patch) | |
tree | 02ca4f902520e3d2ec98fe8ce71be8a319bcdc66 /crates/ra_hir/src/source_binder.rs | |
parent | 8cd23a4fb8c6a1012ba3e40dd3329a5abaed06b7 (diff) |
Support `$crate` in item and expr place.
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index bd4be8430..6e89bfc76 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -203,6 +203,7 @@ impl SourceAnalyzer { | |||
203 | db: &impl HirDatabase, | 203 | db: &impl HirDatabase, |
204 | macro_call: &ast::MacroCall, | 204 | macro_call: &ast::MacroCall, |
205 | ) -> Option<MacroDef> { | 205 | ) -> Option<MacroDef> { |
206 | // This must be a normal source file rather than macro file. | ||
206 | let path = macro_call.path().and_then(Path::from_ast)?; | 207 | let path = macro_call.path().and_then(Path::from_ast)?; |
207 | self.resolver.resolve_path_as_macro(db, &path) | 208 | self.resolver.resolve_path_as_macro(db, &path) |
208 | } | 209 | } |
@@ -261,6 +262,7 @@ impl SourceAnalyzer { | |||
261 | return Some(PathResolution::AssocItem(assoc)); | 262 | return Some(PathResolution::AssocItem(assoc)); |
262 | } | 263 | } |
263 | } | 264 | } |
265 | // This must be a normal source file rather than macro file. | ||
264 | let hir_path = crate::Path::from_ast(path.clone())?; | 266 | let hir_path = crate::Path::from_ast(path.clone())?; |
265 | self.resolve_hir_path(db, &hir_path) | 267 | self.resolve_hir_path(db, &hir_path) |
266 | } | 268 | } |