|
1 | 1 | use pgt_schema_cache::ProcKind; |
2 | | -use pgt_treesitter::context::{NodeUnderCursor, TreesitterContext, WrappingClause, WrappingNode}; |
| 2 | +use pgt_treesitter::context::{TreesitterContext, WrappingClause, WrappingNode}; |
3 | 3 |
|
4 | 4 | use super::CompletionRelevanceData; |
5 | 5 |
|
@@ -67,23 +67,20 @@ impl CompletionFilter<'_> { |
67 | 67 | } |
68 | 68 |
|
69 | 69 | // No autocompletions if there are two identifiers without a separator. |
70 | | - if ctx.node_under_cursor.as_ref().is_some_and(|n| match n { |
71 | | - NodeUnderCursor::TsNode(node) => node.prev_sibling().is_some_and(|p| { |
| 70 | + if ctx.node_under_cursor.as_ref().is_some_and(|node| { |
| 71 | + node.prev_sibling().is_some_and(|p| { |
72 | 72 | (p.kind() == "identifier" || p.kind() == "object_reference") |
73 | | - && n.kind() == "identifier" |
74 | | - }), |
75 | | - NodeUnderCursor::CustomNode { .. } => false, |
| 73 | + && node.kind() == "identifier" |
| 74 | + }) |
76 | 75 | }) { |
77 | 76 | return None; |
78 | 77 | } |
79 | 78 |
|
80 | 79 | // no completions if we're right after an asterisk: |
81 | 80 | // `select * {}` |
82 | | - if ctx.node_under_cursor.as_ref().is_some_and(|n| match n { |
83 | | - NodeUnderCursor::TsNode(node) => node |
84 | | - .prev_sibling() |
85 | | - .is_some_and(|p| (p.kind() == "all_fields") && n.kind() == "identifier"), |
86 | | - NodeUnderCursor::CustomNode { .. } => false, |
| 81 | + if ctx.node_under_cursor.as_ref().is_some_and(|n| { |
| 82 | + n.prev_sibling() |
| 83 | + .is_some_and(|p| (p.kind() == "all_fields") && n.kind() == "identifier") |
87 | 84 | }) { |
88 | 85 | return None; |
89 | 86 | } |
|
0 commit comments