Skip to content

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

@jgoux

Description

@jgoux

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions