Given some string literal type:
declare type Test = "hello" | "world";
const test: Test = "hello";
I want to rename "hello", and I want the change will take effect also in the usage, but VScode doesn't let me to rename "hello" and just give me an error: you cannot rename this element
.
Is there any tool or extension that will allow me to do this kind of refactor? I know I can use enum, but I want a solution for string literal types specifically.
UPDATE I'v also found this open issue in typescript: https://github.com/microsoft/TypeScript/issues/5602
UPDATE2: I'v found out that Intellij supports doing exactly this- when you rename a string literal type, it will rename all the usages as well.