-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Provide Syntax Checking for Regular Expressions #55600
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
Merged
DanielRosenwasser
merged 14 commits into
microsoft:main
from
graphemecluster:regex-syntax-check
Apr 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3b16d74
Provide Syntax Checking for Regular Expressions
graphemecluster fefcf29
Add More Test Cases from test262
graphemecluster 1a5228d
Provide Spelling Suggestions for Unicode Property Value Expressions
graphemecluster 43ae136
Fix Self-check
graphemecluster 2104ec6
Revert "Add More Test Cases from test262"
graphemecluster 6c55c04
Make `RegularExpressionFlags` Internal
graphemecluster 26ea650
Merge branch 'main' into regex-syntax-check
graphemecluster ecff35a
Merge branch 'main' into regex-syntax-check
DanielRosenwasser ca5856e
Merge branch 'main' into regex-syntax-check
graphemecluster d72a849
Fix CI Errors
graphemecluster 7d6c465
Revise According to Suggestions
graphemecluster 850e1da
Merge branch 'main' into regex-syntax-check
graphemecluster 7eaf7a8
Make v flag be ESNext until ES2024 is ratified
jakebailey 5aa3574
remove baseline
jakebailey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Provide Spelling Suggestions for Unicode Property Value Expressions
- Loading branch information
commit 1a5228d20452db775930201826fe8b46409a1097
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.errors.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,19): error TS1527: Unknown Unicode property name or value. | ||
| regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,28): error TS1522: Unknown Unicode property name. | ||
| regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,45): error TS1524: Unknown Unicode property value. | ||
| regularExpressionUnicodePropertyValueExpressionSuggestions.ts(1,55): error TS1499: This regular expression flag is only available when targeting 'ES2015' or later. | ||
|
|
||
|
|
||
| ==== regularExpressionUnicodePropertyValueExpressionSuggestions.ts (4 errors) ==== | ||
| const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; | ||
| ~~~~~ | ||
| !!! error TS1527: Unknown Unicode property name or value. | ||
| !!! related TS1369 regularExpressionUnicodePropertyValueExpressionSuggestions.ts:1:19: Did you mean 'ASCII'? | ||
| ~~ | ||
| !!! error TS1522: Unknown Unicode property name. | ||
| !!! related TS1369 regularExpressionUnicodePropertyValueExpressionSuggestions.ts:1:28: Did you mean 'sc'? | ||
| ~~~~~~~~ | ||
| !!! error TS1524: Unknown Unicode property value. | ||
| !!! related TS1369 regularExpressionUnicodePropertyValueExpressionSuggestions.ts:1:45: Did you mean 'Unknown'? | ||
| ~ | ||
| !!! error TS1499: This regular expression flag is only available when targeting 'ES2015' or later. | ||
|
|
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| //// [tests/cases/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.ts] //// | ||
|
|
||
| //// [regularExpressionUnicodePropertyValueExpressionSuggestions.ts] | ||
| const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; | ||
|
|
||
|
|
||
| //// [regularExpressionUnicodePropertyValueExpressionSuggestions.js] | ||
| var regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; |
6 changes: 6 additions & 0 deletions
6
tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.symbols
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| //// [tests/cases/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.ts] //// | ||
|
|
||
| === regularExpressionUnicodePropertyValueExpressionSuggestions.ts === | ||
| const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; | ||
| >regex : Symbol(regex, Decl(regularExpressionUnicodePropertyValueExpressionSuggestions.ts, 0, 5)) | ||
|
|
7 changes: 7 additions & 0 deletions
7
tests/baselines/reference/regularExpressionUnicodePropertyValueExpressionSuggestions.types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| //// [tests/cases/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.ts] //// | ||
|
|
||
| === regularExpressionUnicodePropertyValueExpressionSuggestions.ts === | ||
| const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; | ||
| >regex : RegExp | ||
| >/\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u : RegExp | ||
|
|
1 change: 1 addition & 0 deletions
1
tests/cases/compiler/regularExpressionUnicodePropertyValueExpressionSuggestions.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| const regex = /\p{ascii}\p{Sc=Unknown}\p{sc=unknownX}/u; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.