aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2020-12-08 22:30:51 +0000
committerLukas Wirth <[email protected]>2020-12-09 08:22:41 +0000
commitf8823e8cbcd4364db4155f5e20989c02b68cf855 (patch)
tree098de556093b2b8361dd2265511182f2c09ea460 /crates/syntax
parenteac77997bfedd55fa572e3fdcf0058f12a0ebb63 (diff)
Properly fetch inner and outer docs on hir-level
Diffstat (limited to 'crates/syntax')
-rw-r--r--crates/syntax/src/ast/token_ext.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs
index a10b14778..52b7285dd 100644
--- a/crates/syntax/src/ast/token_ext.rs
+++ b/crates/syntax/src/ast/token_ext.rs
@@ -17,6 +17,14 @@ impl ast::Comment {
17 CommentKind::from_text(self.text()) 17 CommentKind::from_text(self.text())
18 } 18 }
19 19
20 pub fn is_inner(&self) -> bool {
21 self.kind().doc == Some(CommentPlacement::Inner)
22 }
23
24 pub fn is_outer(&self) -> bool {
25 self.kind().doc == Some(CommentPlacement::Outer)
26 }
27
20 pub fn prefix(&self) -> &'static str { 28 pub fn prefix(&self) -> &'static str {
21 let &(prefix, _kind) = CommentKind::BY_PREFIX 29 let &(prefix, _kind) = CommentKind::BY_PREFIX
22 .iter() 30 .iter()