Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wclr opened this issue Dec 10, 2020 · 0 comments
Open

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

wclr opened this issue Dec 10, 2020 · 0 comments
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol
Milestone

Comments

@wclr
Copy link

wclr commented Dec 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol
Projects
None yet
Development

No branches or pull requests

2 participants