-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
Domain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Follow up to #56052, which was fixed by #56061. That fix means that rename from string literal values that are contextually typed by the type of the string-literal-named property do work. But renames on the actual property declaration still don't.
interface I {
"Prop 1 Foo": string
// ^-- rename here doesn't work
}
declare const fn: <K extends keyof I>(p: K) => void
fn("Prop 1 Foo")As before, if you use constant with a literal type, renaming the literal type does work:
declare const indirect: "Prop 1 Foo"
interface I {
[indirect]: string
}
// ... same as before ...nandorojo, leqwasd, plohoj, qwertysk and mc-petry
Metadata
Metadata
Assignees
Labels
Domain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript