-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Key remapping breaks definition navigation for mapped type properties #47813
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
Comments
The highlighting you see is purely syntactic; unrelated instances of |
@RyanCavanaugh ah, I see. What about the capability to go to definition? In remapped type you can go to reference from any reference or definition point. But you can't go to definition from a reference. |
It definitely "should" work, but it's a bit tricky to implement AFAIR |
I encountered a case where this nearly works, which makes me wonder if there's a worthwhile partial fix. When I use key remapping on a record of functions, the functions can be found once I add parens. "Go to type definition" in VSCode works with and without parens. const funcs = { foo: () => {}, bar: () => {} }
const c = {} as { [K in keyof typeof funcs as K]: typeof funcs[K] }
c.foo // doesn't cmd-click (known, that's this issue #47813) but "go to type definition" works (VSCode)
c.foo() // cmd-click works fine! |
Bug Report
When using mapped type with key remapping, definitions for the properties of mapped types are no longer discoverable. Though, references are still in there.
🔎 Search Terms
mapped types, key remapping, language server, editor hints
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
🙂 Expected behavior
Capability to navigate to definition of remapped property.
The text was updated successfully, but these errors were encountered: