Skip to content

VSCode "Convert to template" refactor unescapes literals unexpectedly #40625

Closed
@thw0rted

Description

@thw0rted

TypeScript Version: 4.0, I think -- this is an issue with TS as bundled in VSCode
VSCode Version: 1.49.0

Search Terms: VSCode template string refactor

Code

Run the "convert to template string" refactor action in VSCode on a string concatenation with escape sequences like "\b" + foo + "\f";

Expected behavior: Escape sequences are preserved, like \b${foo}\f;

Actual behavior: Escape sequences are converted to literal ASCII non-printable equivalents, resulting in "missing character" or other placeholders depending on font.

Related Issues: None, but might have been introduced by #37743 -- the author said to file a new issue.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions