Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/active_parameter.rs')
| -rw-r--r-- | crates/ide-db/src/active_parameter.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide-db/src/active_parameter.rs b/crates/ide-db/src/active_parameter.rs index 7482491fc6..11808fed3b 100644 --- a/crates/ide-db/src/active_parameter.rs +++ b/crates/ide-db/src/active_parameter.rs @@ -4,7 +4,7 @@ use either::Either; use hir::{InFile, Semantics, Type}; use parser::T; use syntax::{ - ast::{self, HasArgList, HasName}, + ast::{self, AstChildren, HasArgList, HasAttrs, HasName}, match_ast, AstNode, NodeOrToken, SyntaxToken, }; @@ -37,6 +37,10 @@ impl ActiveParameter { _ => None, }) } + + pub fn attrs(&self) -> Option<AstChildren<ast::Attr>> { + self.src.as_ref().and_then(|param| Some(param.value.as_ref().right()?.attrs())) + } } /// Returns a [`hir::Callable`] this token is a part of and its argument index of said callable. |