File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -1053,7 +1053,7 @@ function getExhaustiveCaseSnippets(
1053
1053
elements . push ( factory . createNumericLiteral ( type . value ) ) ;
1054
1054
break ;
1055
1055
case "string" :
1056
- elements . push ( factory . createStringLiteral ( type . value ) ) ;
1056
+ elements . push ( factory . createStringLiteral ( type . value , quotePreference === QuotePreference . Single ) ) ;
1057
1057
break ;
1058
1058
}
1059
1059
}
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // Quote preferences.
4
+
5
+ // @newline : LF
6
+ //// declare const p: 'A' | 'B' | 'C';
7
+ ////
8
+ //// switch (p) {
9
+ //// /*1*/
10
+ //// }
11
+
12
+ verify . completions (
13
+ {
14
+ marker : "1" ,
15
+ isNewIdentifierLocation : false ,
16
+ includes : [
17
+ {
18
+ name : `case 'A': ...` ,
19
+ source : completion . CompletionSource . SwitchCases ,
20
+ sortText : completion . SortText . GlobalsOrKeywords ,
21
+ insertText :
22
+ `case 'A':
23
+ case 'B':
24
+ case 'C':` ,
25
+ } ,
26
+ ] ,
27
+ preferences : {
28
+ includeCompletionsWithInsertText : true ,
29
+ quotePreference : "single" ,
30
+ } ,
31
+ } ,
32
+ ) ;
You can’t perform that action at this time.
0 commit comments