aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/indent.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-01-08 07:31:19 +0000
committerBlaž Hrastnik2021-01-08 07:37:36 +0000
commit777a80917db01e658139da11a20ff08256667cfe (patch)
treebe813dfd5f59a6f4c4db937c12769927d8d42c13 /helix-core/src/indent.rs
parent7d41550a23fc3506a37016d5bc362144fb00c080 (diff)
Address clippy lints.
Diffstat (limited to 'helix-core/src/indent.rs')
-rw-r--r--helix-core/src/indent.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs
index 7fbe7f82..5a416147 100644
--- a/helix-core/src/indent.rs
+++ b/helix-core/src/indent.rs
@@ -44,7 +44,7 @@ fn get_highest_syntax_node_at_bytepos(syntax: &Syntax, pos: usize) -> Option<Nod
Some(node)
}
-fn walk(node: Option<Node>, newline: bool) -> usize {
+fn calculate_indentation(node: Option<Node>, newline: bool) -> usize {
let mut increment = 0;
// Hardcoded for rust for now
@@ -183,13 +183,9 @@ pub fn suggested_indent_for_pos(
let byte_start = state.doc.char_to_byte(pos);
let node = get_highest_syntax_node_at_bytepos(syntax, byte_start);
- let indentation = walk(node, new_line);
- // special case for comments
-
- // println!("------------");
- // if preserve_leading_whitespace
-
- indentation
+ // TODO: special case for comments
+ // TODO: if preserve_leading_whitespace
+ calculate_indentation(node, new_line)
} else {
// TODO: heuristics for non-tree sitter grammars
0