Skip to content

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

Closed

Description

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions