-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Domain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: master
Code:
// one
// twoExpected behavior:
ts.getTrailingCommentRanges(text, 0) doesn't return a comment.
Both comments are parsed by ts.getLeadingCommentRanges(text, 0).
Actual behavior:
ts.getTrailingCommentRanges(text, 0) parses // one as a trailing comment.
ts.getLeadingCommentRanges(text, 0) parses both comments.
The special handling of position 0 should also affect trailing comments.
With the current behavior I have to remember to not parse trailing comment ranges at position 0 to avoid duplicates.
Related Issues:
This was part of #28489 where I first proposed changing this behavior.
/cc @rbuckton
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Domain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript