Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object property completion doesn't show properties from other overloads #44183

Open
bpasero opened this issue May 20, 2021 · 1 comment
Open
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented May 20, 2021

TS Template added by @mjbvz

TypeScript Version: 4.3.0-dev.20210503

Search Terms

  • suggest / suggestion
  • Completion

Steps to Reproduce:

  1. open code that leverages FileWorkingCopyManager2 e.g. here
  2. type manager.resolve({ and trigger intellisense
  3. notice the 3 overloads, pick the second or third one

=> 🐛 try to complete on associatedResource or untitledResource but you only see contents

recording (1)

@mjbvz mjbvz transferred this issue from microsoft/vscode May 20, 2021
@mjbvz
Copy link
Contributor

mjbvz commented May 20, 2021

It appears that TS only shows the common property in this case. Here's a minimal example of the issue:

interface I {
    x: number;
}
interface A extends I {
    a: number;
}
interface B extends I {
    b: number;
}

declare function foo(x: I): void;
declare function foo(a: A): void;
declare function foo(b: B): void;

foo({ })

@mjbvz mjbvz removed their assignment May 20, 2021
@mjbvz mjbvz changed the title TS: missing intellisense in this case TS: missing intellisense when calling function overload May 21, 2021
@RyanCavanaugh RyanCavanaugh added Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript labels May 27, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone May 27, 2021
@RyanCavanaugh RyanCavanaugh changed the title TS: missing intellisense when calling function overload Object property completion doesn't show properties from other overloads May 27, 2021
@RyanCavanaugh RyanCavanaugh added the Domain: Completion Lists The issue relates to showing completion lists in an editor label May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants