feat: add iterateComments method#758
Conversation
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
LGTM in general - with one note on the missing text.
Again, apologies for taking so long on this. Once I get confirmation on the intent with text I can merge and release. 👍
| const comments: Comment[] = []; | ||
|
|
||
| execute((pos: number, end: number, kind: ts.CommentKind) => { | ||
| comments.push({ end, fullText, kind, pos }); |
There was a problem hiding this comment.
[Bug] text missing in the output is causing the tests to fail. I think text was meant to be included - is something like this missing?
| comments.push({ end, fullText, kind, pos }); | |
| comments.push({ end, fullText, kind, pos, text: fullText.slice(pos, end) }); |
export type Comment = ts.CommentRange & {
fullText: string;
+ text: string;
};
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #758 +/- ##
==========================================
+ Coverage 61.13% 61.46% +0.32%
==========================================
Files 35 35
Lines 2923 2948 +25
Branches 468 473 +5
==========================================
+ Hits 1787 1812 +25
Misses 1136 1136
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I don't remember what I was thinking. But it currently yields {
kind: CommentKind;
pos: number;
end: number;
fullText: string;
}Do you have a preferences that what it should look like?
|
|
Hmm, yeah, I think removing |
|
Do we want add |
|
Is that |
|
No, Unless you mean to provide |
|
OH! Gotcha - I think it'd be useful to provide both. At least |
|
Let's add value then. |
|
Is the test failure related? Or should I ignore? |
|
You can ignore them, I just filed #768. |
|
Published in |
PR Checklist
forEach...methods withIterables #755status: accepting prsOverview
This contains change from #756, if we decide to add them one by one, should merge #756 first.