File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -766,8 +766,6 @@ function getWhereClauseCompletions(): CompletionItem[] {
766
766
}
767
767
768
768
function getPatternMatchCompletions ( ) : CompletionItem [ ] {
769
- const completions : CompletionItem [ ] = [ ] ;
770
-
771
769
const patterns = [
772
770
{ label : "basic pattern" , insertText : "| ${1:pattern} -> ${2:expression}" } ,
773
771
{ label : "catch-all" , insertText : "| _ -> ${1:default}" } ,
@@ -796,19 +794,17 @@ function getPatternMatchCompletions(): CompletionItem[] {
796
794
{ label : "text pattern" , insertText : '| "${1:text}" -> ${2:expression}' } ,
797
795
] ;
798
796
799
- patterns . forEach ( ( pattern , index ) => {
800
- completions . push ( {
797
+ return patterns . map ( ( pattern , index ) => {
798
+ return {
801
799
label : pattern . label ,
802
800
kind : CompletionItemKind . Snippet ,
803
801
detail : "Pattern match case" ,
804
802
documentation : `Pattern matching case: ${ pattern . label } ` ,
805
803
insertText : pattern . insertText ,
806
804
insertTextFormat : InsertTextFormat . Snippet ,
807
805
sortText : `0${ index . toString ( ) . padStart ( 2 , "0" ) } ` ,
808
- } ) ;
806
+ }
809
807
} ) ;
810
-
811
- return completions ;
812
808
}
813
809
814
810
function getRecordFieldCompletions ( recordType ?: string ) : CompletionItem [ ] {
You can’t perform that action at this time.
0 commit comments