@@ -51,16 +51,16 @@ export default (prior: ts.CompletionInfo): ts.CompletionEntry[] | void => {
5151 if ( ! enableMoreVariants ) continue
5252 const getQuotedSnippet = ( ) : [ string , string ] => {
5353 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 } ,` ]
5555 }
5656 const insertObjectArrayInnerText = c ( 'objectLiteralCompletions.insertNewLine' ) ? '\n\t$1\n' : '$1'
5757 const booleanCompletion = getBooleanCompletion ( type , typeChecker )
5858 const completingStyleMap = [
5959 [ getQuotedSnippet , isStringCompletion ] ,
6060 [ [ `: ${ 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 ] ,
6464 ] as const
6565 const fallbackSnippet = c ( 'objectLiteralCompletions.fallbackVariant' ) ? ( [ ': $0,' , ': ,' ] as const ) : undefined
6666 const insertSnippetVariant = completingStyleMap . find ( ( [ , detector ] ) => detector ( type ! , typeChecker ) ) ?. [ 0 ] ?? fallbackSnippet
0 commit comments