aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-11 17:35:38 +0100
committerGitHub <[email protected]>2021-06-11 17:35:38 +0100
commit6ac3e666b7c62a9097d10c52636cfe75e7851806 (patch)
treeb1e4ab548d425287b2e5c74bbb16f8ce0da96e97 /crates/ide/src
parent5f69420ee3317f9c0e3cb774ccc0cb0e64af0b9a (diff)
parent99d40e7a3a22604690753322f9274bc91fa03de4 (diff)
Merge #9217
9217: internal: Don't stringify and reparse `cfg_attr`-gated attributes r=jonas-schievink a=jonas-schievink Bumps ungrammar to include https://github.com/rust-analyzer/ungrammar/pull/33 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/hover.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index ed4f18e1f..1c6d36939 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -208,7 +208,7 @@ pub(crate) fn hover(
208} 208}
209 209
210fn try_hover_for_attribute(token: &SyntaxToken) -> Option<RangeInfo<HoverResult>> { 210fn try_hover_for_attribute(token: &SyntaxToken) -> Option<RangeInfo<HoverResult>> {
211 let attr = token.ancestors().nth(1).and_then(ast::Attr::cast)?; 211 let attr = token.ancestors().find_map(ast::Attr::cast)?;
212 let (path, tt) = attr.as_simple_call()?; 212 let (path, tt) = attr.as_simple_call()?;
213 if !tt.syntax().text_range().contains(token.text_range().start()) { 213 if !tt.syntax().text_range().contains(token.text_range().start()) {
214 return None; 214 return None;