|
53 | 53 | || cursor_prepared_to_write_token_after_last_node(¶ms.text, params.position)
|
54 | 54 | || cursor_before_semicolon(params.tree, params.position)
|
55 | 55 | || cursor_on_a_dot(¶ms.text, params.position)
|
56 |
| - || cursor_between_double_quotes(¶ms.text, params.position) |
57 | 56 | {
|
58 | 57 | SanitizedCompletionParams::with_adjusted_sql(params)
|
59 | 58 | } else {
|
@@ -160,13 +159,6 @@ fn cursor_on_a_dot(sql: &str, position: TextSize) -> bool {
|
160 | 159 | sql.chars().nth(position - 1).is_some_and(|c| c == '.')
|
161 | 160 | }
|
162 | 161 |
|
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 |
| - |
170 | 162 | fn cursor_before_semicolon(tree: &tree_sitter::Tree, position: TextSize) -> bool {
|
171 | 163 | let mut cursor = tree.walk();
|
172 | 164 | let mut leaf_node = tree.root_node();
|
@@ -216,8 +208,8 @@ mod tests {
|
216 | 208 | use pgt_text_size::TextSize;
|
217 | 209 |
|
218 | 210 | 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, |
221 | 213 | };
|
222 | 214 |
|
223 | 215 | #[test]
|
@@ -314,18 +306,4 @@ mod tests {
|
314 | 306 | assert!(cursor_before_semicolon(&tree, TextSize::new(16)));
|
315 | 307 | assert!(cursor_before_semicolon(&tree, TextSize::new(17)));
|
316 | 308 | }
|
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 |
| - } |
331 | 309 | }
|
0 commit comments