Skip to content

Suggestions are not listed properly for arrays of generic type in function parameters (contextual completion) #53555

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

Closed
jgoux opened this issue Mar 28, 2023 · 0 comments Β· Fixed by #53554
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

@jgoux
Copy link

jgoux commented Mar 28, 2023

Bug Report

πŸ”Ž Search Terms

suggestions, intellisense, autocomplete

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

declare function test<T extends 'a' | 'b'>(a: { foo: T[] }): void

// Try trigerring the suggestions within the foo array, no suggestions
test({ foo: [<cursor here, ctrl+space>] })

// Try trigerring the suggestions within the foo array, only suggestion is 'a'
test({ foo: ['a', <cursor here, ctrl+space>] })

πŸ™ Actual behavior

When the array is empty, there is no suggestions at all
When the array has items, the suggestions are restricted to the items already set in the array

πŸ™‚ Expected behavior

In both cases, we should have the full list of suggestions 'a' | 'b'

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Experience Enhancement Noncontroversial enhancements labels Mar 28, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 28, 2023
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

Successfully merging a pull request may close this issue.

2 participants