Skip to content

Commit 809aa84

Browse files
unnecessary
1 parent d29d16e commit 809aa84

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

crates/pgt_completions/src/sanitization.rs

+2-24
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ where
5353
|| cursor_prepared_to_write_token_after_last_node(&params.text, params.position)
5454
|| cursor_before_semicolon(params.tree, params.position)
5555
|| cursor_on_a_dot(&params.text, params.position)
56-
|| cursor_between_double_quotes(&params.text, params.position)
5756
{
5857
SanitizedCompletionParams::with_adjusted_sql(params)
5958
} else {
@@ -160,13 +159,6 @@ fn cursor_on_a_dot(sql: &str, position: TextSize) -> bool {
160159
sql.chars().nth(position - 1).is_some_and(|c| c == '.')
161160
}
162161

163-
fn cursor_between_double_quotes(sql: &str, position: TextSize) -> bool {
164-
return false;
165-
let position: usize = position.into();
166-
let mut chars = sql.chars();
167-
chars.nth(position - 1).is_some_and(|c| c == '"') && chars.next().is_some_and(|c| c == '"')
168-
}
169-
170162
fn cursor_before_semicolon(tree: &tree_sitter::Tree, position: TextSize) -> bool {
171163
let mut cursor = tree.walk();
172164
let mut leaf_node = tree.root_node();
@@ -216,8 +208,8 @@ mod tests {
216208
use pgt_text_size::TextSize;
217209

218210
use crate::sanitization::{
219-
cursor_before_semicolon, cursor_between_double_quotes, cursor_inbetween_nodes,
220-
cursor_on_a_dot, cursor_prepared_to_write_token_after_last_node,
211+
cursor_before_semicolon, cursor_inbetween_nodes, cursor_on_a_dot,
212+
cursor_prepared_to_write_token_after_last_node,
221213
};
222214

223215
#[test]
@@ -314,18 +306,4 @@ mod tests {
314306
assert!(cursor_before_semicolon(&tree, TextSize::new(16)));
315307
assert!(cursor_before_semicolon(&tree, TextSize::new(17)));
316308
}
317-
318-
#[test]
319-
fn between_quotations() {
320-
let input = "select * from \"\"";
321-
322-
// select * from "|" <-- between quotations
323-
assert!(cursor_between_double_quotes(input, TextSize::new(15)));
324-
325-
// select * from "r|" <-- between quotations, but there's
326-
// a letter inside
327-
let input = "select * from \"r\"";
328-
329-
assert!(!cursor_between_double_quotes(input, TextSize::new(16)));
330-
}
331309
}

0 commit comments

Comments
 (0)