Skip to content

Fixed a class member completion crash after JSDoc comment with degenerate JSDoc tag in it#2888

Open
Andarist wants to merge 12 commits intomicrosoft:mainfrom
Andarist:fix/completion-class-member-at-rule-crash
Open

Fixed a class member completion crash after JSDoc comment with degenerate JSDoc tag in it#2888
Andarist wants to merge 12 commits intomicrosoft:mainfrom
Andarist:fix/completion-class-member-at-rule-crash

Conversation

@Andarist
Copy link
Contributor

fixes the crash reported here: #2871 (comment)
it also crashes in Strada

Copy link
Member

@gabritto gabritto left a comment

Choose a reason for hiding this comment

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

(see comment on fixing the tag parsing)

@Andarist Andarist requested a review from gabritto February 26, 2026 19:02
@gabritto
Copy link
Member

(I'm looking into the race mode test failure; seems like a flaky test not related to this PR)

@gabritto gabritto requested a review from sandersn February 26, 2026 21:46
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I think this is the right approach. One question about a possible efficiency improvement.

saved := s.Mark()
s.pos += size
s.ScanJSDocToken()
isIdentifier := tokenIsIdentifierOrKeyword(s.token)
Copy link
Member

Choose a reason for hiding this comment

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

is there a definition of what an identifier or keyword starts with so we don't have to scan a whole jsdoc token? My instinct is to avoid backtracking.

this may be a non-issue in the Corsa scanner; I can't remember how expensive Mark/Rewind+ScanJSDocToken are, and @ is not a common character in jsdoc in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants