microsoft / microsoft/TypeScript

Go to definition on callable property returns two definitions

Open
#43,276 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Proposal Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Bug Report

🔎 Search Terms
  • go to definition
  • callable
🕗 Version & Regression Information

4.3.0-dev.20210316

⏯ Playground Link

Playground link with relevant code

💻 Code
interface ICallable {
    (): any
}
class K {
    callable: ICallable;
}

new K().callable()

Run go to definition on callable

🙁 Actual behavior

Two definitions are returned, for for K.callable and one for (): any in ICallable

🙂 Expected behavior

Just the definition for K.callable is returned

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 with the linked TypeScript Playground and reproduce go to definition on callable in the provided interface and class example. Trace the language-service definition lookup for the call expression; done means the result contains only K.callable, not the (): any signature in ICallable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.