Skip to content

TypeScript Intellisense Issue: Autocomplete Not Recognizing Numeric String Literal Types #60220

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
tylim88 opened this issue Oct 14, 2024 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@tylim88
Copy link

tylim88 commented Oct 14, 2024

πŸ”Ž Search Terms

generic autocomplete numeric string

πŸ•— Version & Regression Information

TypeScript Version: 5.6.3

⏯ Playground Link

https://www.typescriptlang.org/play/?exactOptionalPropertyTypes=false&ts=5.6.3#code/MYewdgzgLgBAhgXgDwBUYFMAeV1gCYQwDkAjEQD5FwDWAbhUSAOYBGDATJ0QHwAUAlAm4BvAL4AoUJFgsEcJER5A

πŸ’» Code

const a=<T extends '1'|'akv'|'ogb'|'222'>()=>{}
const b=a<''> // try the autocomplete here

πŸ™ Actual behavior

Autocomplete suggestions include all possible string values, ignoring the specific string literals in the constraint. This behavior diminishes the effectiveness of the autocompletion feature, as shown in the attached screenshot.Image

πŸ™‚ Expected behavior

Autocomplete should provide suggestions only for the specific string literals defined in the type constraint ('1', 'akv', 'ogb', '222') without additional unrelated strings.

Additional information about the issue

No response

@Andarist
Copy link
Contributor

Duplicate of #52898

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 18, 2024
@tylim88 tylim88 closed this as completed Oct 19, 2024
@tylim88 tylim88 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants