diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/display/navigation_target.rs | 10 | ||||
-rw-r--r-- | crates/ide/src/hover.rs | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index 522607cb7..48acb8c93 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -155,7 +155,15 @@ impl ToNav for FileSymbol { | |||
155 | impl TryToNav for Definition { | 155 | impl TryToNav for Definition { |
156 | fn try_to_nav(&self, db: &RootDatabase) -> Option<NavigationTarget> { | 156 | fn try_to_nav(&self, db: &RootDatabase) -> Option<NavigationTarget> { |
157 | match self { | 157 | match self { |
158 | Definition::Macro(it) => Some(it.to_nav(db)), | 158 | Definition::Macro(it) => { |
159 | // FIXME: Currently proc-macro do not have ast-node, | ||
160 | // such that it does not have source | ||
161 | // more discussion: https://github.com/rust-analyzer/rust-analyzer/issues/6913 | ||
162 | if it.is_proc_macro() { | ||
163 | return None; | ||
164 | } | ||
165 | Some(it.to_nav(db)) | ||
166 | } | ||
159 | Definition::Field(it) => Some(it.to_nav(db)), | 167 | Definition::Field(it) => Some(it.to_nav(db)), |
160 | Definition::ModuleDef(it) => it.try_to_nav(db), | 168 | Definition::ModuleDef(it) => it.try_to_nav(db), |
161 | Definition::SelfType(it) => Some(it.to_nav(db)), | 169 | Definition::SelfType(it) => Some(it.to_nav(db)), |
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index e82aad6d5..da6bb726a 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -324,6 +324,12 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> { | |||
324 | let mod_path = definition_mod_path(db, &def); | 324 | let mod_path = definition_mod_path(db, &def); |
325 | return match def { | 325 | return match def { |
326 | Definition::Macro(it) => { | 326 | Definition::Macro(it) => { |
327 | // FIXME: Currently proc-macro do not have ast-node, | ||
328 | // such that it does not have source | ||
329 | // more discussion: https://github.com/rust-analyzer/rust-analyzer/issues/6913 | ||
330 | if it.is_proc_macro() { | ||
331 | return None; | ||
332 | } | ||
327 | let label = macro_label(&it.source(db).value); | 333 | let label = macro_label(&it.source(db).value); |
328 | from_def_source_labeled(db, it, Some(label), mod_path) | 334 | from_def_source_labeled(db, it, Some(label), mod_path) |
329 | } | 335 | } |