-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Domain: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Relates to go-to-definition, find-all-references, highlighting/occurrences.Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
Feature request
Go to definition for TypeScript literal strings.
Example
Given the below code, I would really like to be able to jump to the definition of the 'foo'
:
const obj = {
foo: 'bar' as const,
hello: 'world' as const,
}
function get<T, K extends keyof T>(obj: T, path: K): T[K] {
return obj[path]
}
const val = get(obj, 'foo')
// 👆👆👆 Is there a way of make jump to definition work here?
// I really want to CMD+click `'foo'` and jump to line #2
Link to TypeScript playground.
WebStorm Demo of the same code
In WebStorm, it actually works how I wish that VSCode worked, here's a video:
nice.webstorm.mov
zyhou, sachinraja, VladSez, orenelbaum, omar-dulaimi and 52 moreecwyne, ethangclark, VladSez, nirtamir2, michaelhays and 9 morecolinhacks, Zxilly, audunolsen, zineanteoh and kravetsone
Metadata
Metadata
Assignees
Labels
Domain: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Relates to go-to-definition, find-all-references, highlighting/occurrences.Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript