aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/folding_ranges.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-04-02 08:23:18 +0100
committerAleksey Kladov <[email protected]>2019-04-02 08:23:29 +0100
commitae282d8da63a82077361bc142b2b9a272a2eac64 (patch)
treecdb7b23e4abf9623286fbf5ef34a0108c0b5f25e /crates/ra_ide_api/src/folding_ranges.rs
parentf874d372bb7f756dfa6ebc22ca838657c8ff1539 (diff)
add ast::tokens
Diffstat (limited to 'crates/ra_ide_api/src/folding_ranges.rs')
-rw-r--r--crates/ra_ide_api/src/folding_ranges.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide_api/src/folding_ranges.rs
index a6fe8a5d5..eada0b7de 100644
--- a/crates/ra_ide_api/src/folding_ranges.rs
+++ b/crates/ra_ide_api/src/folding_ranges.rs
@@ -1,9 +1,9 @@
1use rustc_hash::FxHashSet; 1use rustc_hash::FxHashSet;
2 2
3use ra_syntax::{ 3use ra_syntax::{
4 AstNode, SourceFile, SyntaxNode, TextRange, Direction, SyntaxElement, 4 SourceFile, SyntaxNode, TextRange, Direction, SyntaxElement,
5 SyntaxKind::{self, *}, 5 SyntaxKind::{self, *},
6 ast::{self, VisibilityOwner, Comment}, 6 ast::{self, AstNode, AstToken, VisibilityOwner},
7}; 7};
8 8
9#[derive(Debug, PartialEq, Eq)] 9#[derive(Debug, PartialEq, Eq)]
@@ -139,8 +139,8 @@ fn contiguous_range_for_group_unless<'a>(
139} 139}
140 140
141fn contiguous_range_for_comment<'a>( 141fn contiguous_range_for_comment<'a>(
142 first: Comment<'a>, 142 first: ast::Comment<'a>,
143 visited: &mut FxHashSet<Comment<'a>>, 143 visited: &mut FxHashSet<ast::Comment<'a>>,
144) -> Option<TextRange> { 144) -> Option<TextRange> {
145 visited.insert(first); 145 visited.insert(first);
146 146
@@ -157,7 +157,7 @@ fn contiguous_range_for_comment<'a>(
157 continue; 157 continue;
158 } 158 }
159 } 159 }
160 if let Some(c) = Comment::cast(token) { 160 if let Some(c) = ast::Comment::cast(token) {
161 if c.flavor() == group_flavor { 161 if c.flavor() == group_flavor {
162 visited.insert(c); 162 visited.insert(c);
163 last = c; 163 last = c;