typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Go-to-def on object literal shorthand misbehaves

Open jakebailey opened this issue 6 months ago • 1 comments

With:

interface Something {
    foo: string;
}

function makeSomething(foo: string): Something {
    return { foo };
}

Go-to-def on foo in the object literal goes to the name in the object literal, as opposed to the parameter or even the foo in Something. (I can't recall which is correct. Both?)

jakebailey avatar Jun 09 '25 22:06 jakebailey

The correct behavior is to return both the parameter and the interface property; checked against tsserver.

jakebailey avatar Nov 02 '25 05:11 jakebailey