TypeScript: skip ! when parsing variable statements#4389
Open
masatake wants to merge 2 commits intouniversal-ctags:masterfrom
Open
TypeScript: skip ! when parsing variable statements#4389masatake wants to merge 2 commits intouniversal-ctags:masterfrom
masatake wants to merge 2 commits intouniversal-ctags:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4389 +/- ##
=======================================
Coverage 86.02% 86.02%
=======================================
Files 253 253
Lines 63506 63506
=======================================
Hits 54634 54634
Misses 8872 8872 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
76ba2c3 to
416d9c3
Compare
Fixes universal-ctags#4384 Suggested-by: Rimvydas Naktinis (@naktinis) Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
416d9c3 to
feb392b
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for TypeScript's non-null assertion operator (!) in the parser, ensuring it is properly skipped and doesn't interfere with parsing variable statements and class properties.
Changes:
- Added
TOKEN_BANGto handle the!operator in TypeScript - Updated parser logic to skip
!tokens in variable and class body parsing contexts - Added comprehensive test cases for both definite assignment assertions and non-null assertions
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| parsers/typescript.c | Added TOKEN_BANG token type and updated parsers to handle ! in variable statements and class properties |
| Units/parser-typescript.r/skip-bang.d/validator | Added validator file specifying TypeScript compiler for test validation |
| Units/parser-typescript.r/skip-bang.d/input.ts | Added test case for non-null assertion in ternary expression |
| Units/parser-typescript.r/skip-bang.d/input-0.ts | Added test case for definite assignment assertions on class properties |
| Units/parser-typescript.r/skip-bang.d/expected.tags | Added expected parser output for the test cases |
| Units/parser-typescript.r/skip-bang.d/args.ctags | Added test configuration to disable sorting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4384