aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/completion/patterns.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs
index b55f23fbe..145f01786 100644
--- a/crates/ra_ide/src/completion/patterns.rs
+++ b/crates/ra_ide/src/completion/patterns.rs
@@ -100,7 +100,8 @@ fn previous_non_triva_element(element: SyntaxElement) -> Option<SyntaxElement> {
100 })?; 100 })?;
101 non_trivia_sibling(NodeOrToken::Node(prev_sibling_node), Direction::Prev)? 101 non_trivia_sibling(NodeOrToken::Node(prev_sibling_node), Direction::Prev)?
102 }; 102 };
103 //I think you can avoid this loop if you use SyntaxToken::prev_token -- unlike prev_sibling_or_token, it works across parents. 103 // TODO: Check if this can be simplified
104 // Matklad: I think you can avoid this loop if you use SyntaxToken::prev_token -- unlike prev_sibling_or_token, it works across parents.
104 // traversing the tree down to get the last token or node, i.e. the closest one 105 // traversing the tree down to get the last token or node, i.e. the closest one
105 loop { 106 loop {
106 if let Some(token) = wrapped.as_token() { 107 if let Some(token) = wrapped.as_token() {