-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbol
Milestone
Description
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
// basic usage
const foo: Foo = 'joe '
// using string literal:
switch (foo) {
case 'donald': ...
case 'joe': ...
}
After literals rename:
Actual
type Foo = 'donald duck' | 'pizza joe' // allow me to rename any of these values
// basic usage
const foo: Foo = 'pizza joe ' // this works
// rename doesn't work
switch (foo) {
case 'donald': ...
case 'joe': ...
}
Expected:
// using string literal
// should rename here too
switch (foo) {
case 'donald duck': ...
case 'pizza joe': ...
}
ravicious, avatus, gzdunek and michellescripts
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbol