diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-30 22:08:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-30 22:08:25 +0000 |
| commit | fd3942eb620e37a4e4bfdd587d8a2893ccf6fea0 (patch) | |
| tree | f9f387ca6d71551eecda7ca359be7322456f249b /crates/syntax/src/ast/node_ext.rs | |
| parent | c08df0f1f5e188e2e1e8f1715ff3a6d583cfb9f3 (diff) | |
| parent | ddf7b70a0f8f7fc1e49d2bf0365752be3b4aab8b (diff) | |
| download | rust-fd3942eb620e37a4e4bfdd587d8a2893ccf6fea0.tar.gz rust-fd3942eb620e37a4e4bfdd587d8a2893ccf6fea0.zip | |
Merge #11382
11382: fix: Fix `cfg_attr` invalidating derive identifier IDE functionalities r=Veykril a=Veykril Proper fix for https://github.com/rust-analyzer/rust-analyzer/issues/11298 bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
| -rw-r--r-- | crates/syntax/src/ast/node_ext.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index 705aa5edac4..7211c77e880 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs @@ -160,14 +160,9 @@ impl ast::Attr { } pub fn kind(&self) -> AttrKind { - let first_token = self.syntax().first_token(); - let first_token_kind = first_token.as_ref().map(SyntaxToken::kind); - let second_token_kind = - first_token.and_then(|token| token.next_token()).as_ref().map(SyntaxToken::kind); - - match (first_token_kind, second_token_kind) { - (Some(T![#]), Some(T![!])) => AttrKind::Inner, - _ => AttrKind::Outer, + match self.excl_token() { + Some(_) => AttrKind::Inner, + None => AttrKind::Outer, } } |
