aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-06 12:23:26 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-06 12:23:26 +0000
commit736a55c97e69f95e6ff4a0c3dafb2018e8ea05f9 (patch)
tree4f82dda9b02ca33d154cefd46ced58596bc2065c /crates/ra_syntax/src/ast.rs
parent569e1e871e737ade80616288241d63e1531dbb8d (diff)
parentd107926f8621dfc08010ffc5bf4a1ac6356c6c87 (diff)
Merge #748
748: Fill deprecation for LSP r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]> Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r--crates/ra_syntax/src/ast.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index 3d22a88f3..d6237532b 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -177,6 +177,16 @@ impl Attr {
177 None 177 None
178 } 178 }
179 } 179 }
180
181 pub fn as_named(&self) -> Option<SmolStr> {
182 let tt = self.value()?;
183 let attr = tt.syntax().children().nth(1)?;
184 if attr.kind() == IDENT {
185 Some(attr.leaf_text().unwrap().clone())
186 } else {
187 None
188 }
189 }
180} 190}
181 191
182impl Comment { 192impl Comment {