-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add assists for macro documentation comments #78
Conversation
/// ```dart | ||
/// /// {[@]template packageName.className} | ||
/// /// | ||
/// /// {[@]endtemplate} |
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.
In the example, using @endtemplate
as is would be interpreted as the end of the template, so I’ve enclosed it in []
to avoid this!
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.
if (!target.intersects(node.sourceRange)) { | ||
return; | ||
} | ||
|
||
if (!node.isDocumentation) { | ||
return; | ||
} |
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.
if (!target.intersects(node.sourceRange)) { | |
return; | |
} | |
if (!node.isDocumentation) { | |
return; | |
} | |
if (!target.intersects(node.sourceRange)) { | |
return; | |
} | |
if (node.toSource().contains('{@template') && | |
node.toSource().contains('{@endtemplate}')) { | |
return; | |
} | |
if (!node.isDocumentation) { | |
return; | |
} |
I thought it might be worth considering adding this early return.
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.
Thank you!
It certainly seems like a good idea. ✍️
Since toSource
was an empty string and couldn't be evaluated, I changed it to use tokens
for evaluation!
feat: Prevent wrapping of existing macro template documentation comments
final currentComment = node.tokens.join();
if (currentComment.contains('{@template') &&
currentComment.contains('{@endtemplate}')) {
return;
}
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.
LGTM! Thanks for new feature🚀
🔗 Related Issues
🙌 What's Done
Background
https://altive.slack.com/archives/C072SHBR4DT/p1733300766521879
To make this adjustment easier, I’ve created an assist feature with
custom_lint
!✍️ What's Not Done
🖼️ Image Differences
🤼 Desired Review Method
Note
It is possible that a reviewer's will may cause a method to be implemented that is not selected.
📝 Additional Notes
Pre-launch Checklist