Skip to content

Inline variable with string literals should merge with template strings #54755

@DanielRosenwasser

Description

@DanielRosenwasser
const pizza = "🍕";
export const prompt = `Hello, would you like some ${pizza}?`;

Trigger "inline variable" on pizza.

Current:

export const prompt = `Hello, would you like some ${"🍕"}?`;

Expected:

export const prompt = `Hello, would you like some 🍕?`;

Beware of inlining strings with backticks.

const codeText = "Code-formatted text looks `like this` and requires surrounding by backticks (\\`).";
export const mdTutorial = `Let's talk about markdown.\n${codeText}?`;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions