Skip to content

Provide go-to-definition on unresolved shorthand properties #42923

@DanielRosenwasser

Description

@DanielRosenwasser
interface Foo {
    /**
     * Hallo this is docs
     */
    yadda(): void
}

let x: Foo = {
    yadda/**/
};

Imagine that I am typing some code. I realize I don't remember what yadda is supposed to look like, so I run go-to-definition on yadda.

Problem

Go-to-definition doesn't work, because at this point yadda is a shorthand property, so go-to-definition tries to look for a local named yadda that doesn't exist.

As a workaround, I often end up writing

interface Foo {
    /**
     * Hallo this is docs
     */
    yadda(): void
}

let x: Foo = {
    yadda: undefined!
};

just so I can go-to-definiiton on yadda, which really sucks.

Expected Behavior

We should resiliently try to pick up on the original definition and jump there.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: LS: Symbol NavigationRelates to go-to-definition, find-all-references, highlighting/occurrences.Fix AvailableA PR has been opened for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions