-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Scan bigger/fewer jsdoc tokens #53081
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
sandersn
merged 19 commits into
microsoft:main
from
sandersn:scan-bigger/fewer-jsdoc-tokens
Mar 8, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d8fd395
initial draft of bigMode: unfinished/buggy
sandersn 701d4fa
Merge branch 'main' into scan-bigger/fewer-jsdoc-tokens
sandersn 716ba47
explicit entry for Identifier
sandersn 368bfb6
fix trailing whitespace
sandersn 8ddbf23
Also scan big tokens in tag comment text parsing
sandersn 95dbeb2
Merge branch 'main' into scan-bigger/fewer-jsdoc-tokens
sandersn f8f9721
scan everything but characters of interest
sandersn 3d96fa9
fix lint
sandersn 9f4daf5
Scanner:skip @ in backticks or with bad whitespace
sandersn a803a1f
JSDoc: Remove a lot of checks in parser loop
sandersn b9da7f0
switch to trimString[End] utilities for ES2018 compat
sandersn 2ab197b
JSDoc: Start SavingComments 1 more case in the parser
sandersn 0f4ac62
Address PR comments; clean up TODOs
sandersn 42d357a
make JSDocCommentTextToken internal and treat it separately
sandersn d7c2377
Address PR comments
sandersn dd92575
move JSDocCommentTextToken out of punctuation span
sandersn 76813c0
Merge branch 'main' into scan-bigger/fewer-jsdoc-tokens
sandersn 9427037
Merge branch 'main' into scan-bigger/fewer-jsdoc-tokens
sandersn c91de88
fix changes missed in merge
sandersn 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
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
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 |
---|---|---|
|
@@ -393,6 +393,7 @@ oh.no | |
* Some\n\n * text\r\n * with newlines. | ||
*/`); | ||
parsesCorrectly("Chained tags, no leading whitespace", `/**@a @b @c@d*/`); | ||
parsesCorrectly("Single trailing whitespace", `/** trailing whitespace */`); | ||
parsesCorrectly("Initial star is not a tag", `/***@a*/`); | ||
parsesCorrectly("Initial star space is not a tag", `/*** @a*/`); | ||
parsesCorrectly("Initial email address is not a tag", `/**[email protected]*/`); | ||
|
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
9 changes: 9 additions & 0 deletions
9
...elines/reference/JSDocParsing/DocComments.parsesCorrectly.Single trailing whitespace.json
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,9 @@ | ||
{ | ||
"kind": "JSDoc", | ||
"pos": 0, | ||
"end": 26, | ||
"flags": "JSDoc", | ||
"modifierFlagsCache": 0, | ||
"transformFlags": 0, | ||
"comment": "trailing whitespace" | ||
} |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This slices whitespace, then you slice out of the whitespace. Swap this to grab the beginning/end of the whitespace, calculate the length, and slice right out of the original
sourceText
only if necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. I noted it and will try it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: #53121