Skip to content
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

Provide Spelling Suggestions for Named Capture Group References in Regular Expressions #58613

Merged

Conversation

graphemecluster
Copy link
Contributor

@graphemecluster graphemecluster commented May 22, 2024

#55600 already provides spelling suggestions for Unicode property value expressions (1a5228d), this PR extends it to capturing group names.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 22, 2024
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@graphemecluster
Copy link
Contributor Author

IMO the current parameters in getSpellingSuggestion (and levenshteinWithMax) are too intolerant that even “Inhabited” doesn’t get corrected to “Inherited”.

Copy link
Member

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but may not meet the bar for the 5.5 RC. We can merge this next week once main opens up for TypeScript 5.6.

@rbuckton rbuckton added this to the TypeScript 5.6.0 milestone May 31, 2024
@rbuckton rbuckton self-assigned this May 31, 2024
@rbuckton rbuckton merged commit f5238c3 into microsoft:main Jun 4, 2024
28 checks passed
@DanielRosenwasser
Copy link
Member

Any idea why I'm not able to see this in any nightly version of TypeScript?

Playground Link

image

@graphemecluster
Copy link
Contributor Author

@DanielRosenwasser I can’t see /\p{letter}/u is getting a suggested correction to Letter either. Wonder if the same applies to all other related info message diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants