A Visual Studio Code extension that automatically converts string literals (with single or double quotes) to template literals (with backticks) when you type ${ inside a string. This saves you time and helps prevent syntax errors when working with JavaScript and TypeScript.
Features
Automatic Conversion: When you type ${ inside a string with single (') or double (") quotes, the extension automatically converts the quotes to backticks (`).
Multi-Cursor Support: Works with multiple cursors simultaneously - perfect for batch editing.
Notification: Shows a notification confirming how many strings were converted.
How It Works
Start typing in a string literal with single or double quotes:
const message = "Hello, ";
When you want to use a template expression, type ${:
const message = "Hello, ${
The extension automatically converts the quotes to backticks:
const message = `Hello, ${
You can now complete your template expression:
const message = `Hello, ${name}`;
Use Cases
Dynamic String Construction: When adding variables to strings
Multiline Strings: When you need to expand a single-line string to multiple lines
String Interpolation: When you need to include expressions in your strings
Requirements
Visual Studio Code version 1.60.0 or higher
Extension Settings
This extension does not add any settings.
Known Limitations
Currently works only with single-line strings
The string detection algorithm uses a simplified approach that might not handle all complex nested string cases