@@ -51,16 +51,16 @@ export default (prior: ts.CompletionInfo): ts.CompletionEntry[] | void => {
51
51
if ( ! enableMoreVariants ) continue
52
52
const getQuotedSnippet = ( ) : [ string , string ] => {
53
53
const quote = tsFull . getQuoteFromPreference ( tsFull . getQuotePreference ( node ! . getSourceFile ( ) as any , preferences ) )
54
- return [ `: ${ quote } $1${ quote } ,$0 ` , `: ${ quote } ${ quote } ,` ]
54
+ return [ `: ${ quote } $1${ quote } ,` , `: ${ quote } ${ quote } ,` ]
55
55
}
56
56
const insertObjectArrayInnerText = c ( 'objectLiteralCompletions.insertNewLine' ) ? '\n\t$1\n' : '$1'
57
57
const booleanCompletion = getBooleanCompletion ( type , typeChecker )
58
58
const completingStyleMap = [
59
59
[ getQuotedSnippet , isStringCompletion ] ,
60
60
[ [ `: ${ booleanCompletion ?. [ 0 ] ?? '' } ,` , `: ${ booleanCompletion ?. [ 0 ] ?? '' } ` ] , ( ) => booleanCompletion ?. length === 1 ] ,
61
- [ [ ': ${1|true,false|},$0 ' , `: true/false,` ] , ( ) => booleanCompletion ?. length === 2 ] ,
62
- [ [ `: [${ insertObjectArrayInnerText } ],$0 ` , `: [],` ] , isArrayCompletion ] ,
63
- [ [ `: {${ insertObjectArrayInnerText } },$0 ` , `: {},` ] , isObjectCompletion ] ,
61
+ [ [ ': ${1|true,false|},' , `: true/false,` ] , ( ) => booleanCompletion ?. length === 2 ] ,
62
+ [ [ `: [${ insertObjectArrayInnerText } ],` , `: [],` ] , isArrayCompletion ] ,
63
+ [ [ `: {${ insertObjectArrayInnerText } },` , `: {},` ] , isObjectCompletion ] ,
64
64
] as const
65
65
const fallbackSnippet = c ( 'objectLiteralCompletions.fallbackVariant' ) ? ( [ ': $0,' , ': ,' ] as const ) : undefined
66
66
const insertSnippetVariant = completingStyleMap . find ( ( [ , detector ] ) => detector ( type ! , typeChecker ) ) ?. [ 0 ] ?? fallbackSnippet
0 commit comments