microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.03k stars 12.49k forks source link

Go to definition should still work for shorthand property declaration with no local binding #30038

Open DanielRosenwasser opened 5 years ago

DanielRosenwasser commented 5 years ago
declare function foo(option: { [|abcd|]: number }): void;

foo({
    abcd/*use*/
});

Go to definition at /*use*/.

Expected: Language service gracefully finds abcd. Actual: No definition is available.

This is frustrating because much of the time as I'm actually writing out the type, I want to know what abcd is so I'll jump to its definition. Instead, I can't get any functionality.

DanielRosenwasser commented 5 years ago

Potentially related code path on #30037