File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
} from "./server" ;
14
14
import {
15
15
CompletionItem ,
16
+ CompletionItemKind ,
16
17
Hover ,
17
18
MarkupContent ,
18
19
Range ,
@@ -199,7 +200,7 @@ result
199
200
const completions = getCompletionItems ( document , position ) ;
200
201
201
202
const patternCompletions = completions . filter (
202
- ( c ) => c . kind === 14 && c . label . includes ( "->" ) , // Snippet kind
203
+ ( c ) => c . kind === CompletionItemKind . Snippet && c . insertText ? .includes ( "->" ) , // Snippet kind
203
204
) ;
204
205
expect ( patternCompletions . length ) . toBeGreaterThan ( 0 ) ;
205
206
} ) ;
Original file line number Diff line number Diff line change @@ -683,19 +683,19 @@ function analyzeCompletionContext(
683
683
return { type : "tag" } ;
684
684
}
685
685
686
- // Check for where clause context
687
- if ( lineText . trim ( ) . startsWith ( ";" ) || findParentOfType ( node , "where" ) ) {
688
- return { type : "where_clause" } ;
689
- }
690
-
691
686
// Check for pattern match context
692
687
if (
693
688
lineText . trim ( ) . startsWith ( "|" ) ||
694
- findParentOfType ( node , "pattern_match " )
689
+ findParentOfType ( node , "match_fun " )
695
690
) {
696
691
return { type : "pattern_match" } ;
697
692
}
698
693
694
+ // Check for where clause context
695
+ if ( lineText . trim ( ) . startsWith ( ";" ) || findParentOfType ( node , "where" ) ) {
696
+ return { type : "where_clause" } ;
697
+ }
698
+
699
699
// Check for record field access
700
700
if ( lineText . includes ( "." ) || parent ?. type === "record_access" ) {
701
701
return { type : "record_field" } ;
You can’t perform that action at this time.
0 commit comments