Skip to content

String literal rename doesn't work with template literals #41922

Open
@wclr

Description

@wclr

typescript next 4.2.0-dev20201210

There are other cases when string literal rename refactor (#39298) deosn't work

Example:

type Foo = 'donald' | 'joe' // allow to rename any of these values

const foo: Foo = 'joe'

// using string literal:

const temp: `hello ${Foo}` = `hello donald`

After literals rename:

Actual

type Foo = 'donald duck' | 'pizza joe' // allow me to rename any of these values

// just declaration

const foo: Foo = 'pizza joe ' // this works

// using string literal

const temp: `hello ${Foo}` = `hello donald` // this doesn't work

Expected:

// using string literal

const temp: `hello ${Foo}` = `hello donald duck` // should rename here too

Related:
#41489
#41923

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbol

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions