microsoft / microsoft/TypeScript

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

Open
#30,038 2 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

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.

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

Reproduce the issue with the TypeScript snippet and invoke Go to Definition at the marked use of abcd. Start by tracing the language-service definition lookup for shorthand property declarations with no local binding. Done means the lookup gracefully resolves abcd instead of returning no definition.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.