Skip to content

Incorrect completions in object literal expression for overloads #52692

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

Open
zardoy opened this issue Feb 9, 2023 · 2 comments
Open

Incorrect completions in object literal expression for overloads #52692

zardoy opened this issue Feb 9, 2023 · 2 comments
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@zardoy
Copy link
Contributor

zardoy commented Feb 9, 2023

Bug Report

πŸ”Ž Search Terms

πŸ•— Version & Regression Information

⏯ Playground Link

ts play code

Code to test

Simplified from got typings.

interface T {
    <T>(input: { type: 'text' })
    <T>(input: { type: 'json' })
    <T>(input: { type: 'buffer' })
}

declare const func: T

func({ type: /**/ })

No all literal or in-string completions, but okay if remove <T> from each overload.

πŸ™ Actual behavior

Completions in func({ type: '|' }) (text) missing completions from func2('|') (text, json, buffer)

πŸ™‚ Expected behavior

Completions for func({ type: '|' }) are the same as for func2('|')

I'm not sure probably its related to #51047 (or duplicate)

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Help Wanted You can do this Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements labels Feb 14, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Feb 14, 2023
@zardoy
Copy link
Contributor Author

zardoy commented Mar 4, 2023

Hi, @Andarist! I wonder does #52717 also fixes it? (saw your similar issue and could guess it from title)

@Andarist
Copy link
Contributor

Andarist commented Mar 4, 2023

@zardoy i dont think it will fix this but it’s worth rechecking

SamB added a commit to SamB/bitburner-src that referenced this issue Mar 12, 2023
In particular, overload them.

This allows TypeScript/eslint/etc. to see
what type of response is possible
depending on the `type` requested,
assuming my reading of the documentation
was correct.

If only it didn't screw up parameter hints/completion.
(See <microsoft/TypeScript#52692>.)
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 Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants