File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
8
8
const toTemplateLiteralDescription = getLocaleSpecificMessage ( Diagnostics . Convert_to_template_literal ) ;
9
9
const toStringConcatenationDescription = getLocaleSpecificMessage ( Diagnostics . Convert_to_string_concatenation ) ;
10
10
11
- // TODO let a = 45 + 45 + " ee" + 33;
12
11
// TODO let a = 45 - 45 + " ee" - 33;
13
12
// TODO let a = tag `aaa`;
14
13
@@ -144,6 +143,19 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
144
143
let current = nodes [ i ] ;
145
144
let templatePart : TemplateMiddle | TemplateTail ;
146
145
146
+ if ( head . text . length === 0 && i + 1 < nodes . length && ! isStringLiteral ( nodes [ i + 1 ] ) ) {
147
+ let binary = createBinary ( current as Expression , SyntaxKind . PlusToken , nodes [ i + 1 ] as Expression ) ;
148
+ current = binary ;
149
+ i ++ ;
150
+
151
+ while ( i + 1 < nodes . length && ! isStringLiteral ( nodes [ i + 1 ] ) ) {
152
+ binary = createBinary ( binary , SyntaxKind . PlusToken , nodes [ i + 1 ] as Expression ) ;
153
+ i ++ ;
154
+ }
155
+
156
+ current = binary ;
157
+ }
158
+
147
159
if ( i + 1 < nodes . length && isStringLiteral ( nodes [ i + 1 ] ) ) {
148
160
let next = nodes [ i + 1 ] as StringLiteral ;
149
161
let text = next . text ;
You can’t perform that action at this time.
0 commit comments