microsoft / microsoft/TypeScript

Goto definition after field exclusion should go to prop signature

Open
#23,216 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: LS: Symbol Navigation Experience Enhancement Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: master

Code

type OmitKeys<A, B> = {[P in Exclude<keyof A, B>]: A[P]}
interface Foo {
    a: number;
    b: string;
    c: boolean;
}
var c: OmitKeys<Foo, 'c'>;
c.a // goto definition doesn't work

Expected behavior:
Goto definition on c.a takes me to the Foo.a property

Actual behavior:
Goto definition doesn't work

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the TypeScript snippet in the report, focusing on Go to Definition for c.a after the OmitKeys mapped type excludes c. Trace the TypeScript language-service path that resolves this location. Done means Go to Definition reaches Foo.a rather than failing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.