You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect formatter behavior: missing space after opening template string brace #19385
Open the .ts file in VSCode and run the "Format document" command. (If requested, I can make a reproduction that uses TypeScript's formatting API directly)
Expected behavior:
"Format document" inserts four spaces adjacent to the opening and closing curly braces:
The rule to insert a space is being skipped because previousStartLine is different than currentStartLine. However, in this particular situation, the newline occurs within the templateHead token, so it really shouldn't be skipping the rule.
Activity
cspotcode commentedon Oct 23, 2017
I think I've traced the problem to this bit of code:
https://github.com/Microsoft/TypeScript/blob/master/src/services/formatting/formatting.ts#L1139-L1142
The rule to insert a space is being skipped because
previousStartLineis different thancurrentStartLine. However, in this particular situation, the newline occurs within thetemplateHeadtoken, so it really shouldn't be skipping the rule.