mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Render matched macro arm on hover of macro calls
This commit is contained in:
parent
062e1b9b81
commit
6bfdd38c69
11 changed files with 133 additions and 65 deletions
|
@ -251,7 +251,7 @@ impl DeclarativeMacro {
|
|||
new_meta_vars: bool,
|
||||
call_site: Span,
|
||||
def_site_edition: Edition,
|
||||
) -> ExpandResult<tt::Subtree<Span>> {
|
||||
) -> ExpandResult<(tt::Subtree<Span>, Option<u32>)> {
|
||||
expander::expand_rules(&self.rules, tt, marker, new_meta_vars, call_site, def_site_edition)
|
||||
}
|
||||
}
|
||||
|
@ -330,6 +330,10 @@ impl<T, E> ValueResult<T, E> {
|
|||
Self { value: Default::default(), err: Some(err) }
|
||||
}
|
||||
|
||||
pub fn zip_val<U>(self, other: U) -> ValueResult<(T, U), E> {
|
||||
ValueResult { value: (self.value, other), err: self.err }
|
||||
}
|
||||
|
||||
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> ValueResult<U, E> {
|
||||
ValueResult { value: f(self.value), err: self.err }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue