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 @@ -772,8 +772,6 @@ function getWhereClauseCompletions(): CompletionItem[] {
772
772
}
773
773
774
774
function getPatternMatchCompletions ( ) : CompletionItem [ ] {
775
- const completions : CompletionItem [ ] = [ ] ;
776
-
777
775
const patterns = [
778
776
{ label : "basic pattern" , insertText : "| ${1:pattern} -> ${2:expression}" } ,
779
777
{ label : "catch-all" , insertText : "| _ -> ${1:default}" } ,
@@ -802,19 +800,17 @@ function getPatternMatchCompletions(): CompletionItem[] {
802
800
{ label : "text pattern" , insertText : '| "${1:text}" -> ${2:expression}' } ,
803
801
] ;
804
802
805
- patterns . forEach ( ( pattern , index ) => {
806
- completions . push ( {
803
+ return patterns . map ( ( pattern , index ) => {
804
+ return {
807
805
label : pattern . label ,
808
806
kind : CompletionItemKind . Snippet ,
809
807
detail : "Pattern match case" ,
810
808
documentation : `Pattern matching case: ${ pattern . label } ` ,
811
809
insertText : pattern . insertText ,
812
810
insertTextFormat : InsertTextFormat . Snippet ,
813
811
sortText : `0${ index . toString ( ) . padStart ( 2 , "0" ) } ` ,
814
- } ) ;
812
+ }
815
813
} ) ;
816
-
817
- return completions ;
818
814
}
819
815
820
816
function getRecordFieldCompletions ( recordType ?: string ) : CompletionItem [ ] {
You can’t perform that action at this time.
0 commit comments