-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Scanning of Comments on CompilationUnit? #2798
Comments
It seems OK to me. Conceptually, comments are not first-class AST nodes (they have nothing to do with the program behavior). |
That might be true, but nobody likes the comments moved around when modifying the code via processors. In my current project the comments were used for defining extension points in the code, which is for sure not what they are for, but it worked for them many years pretty well. Now i cant change the code via processors but need to use the processors for finding the parts i need to change then by regex. So i would love spoon handling comments as first class citizens. |
for me it really looks like another usecase for #2774 |
Thank you for your feedback. |
Not sure why the issue has been closed (might be a mistake) so I reopen it. |
I closed this issue intentionally. My origin question was answered. So it can be closed. |
Sorry I read it before finishing my coffee this morning, I missed the last sentence of your answer. 😪 Closing it again. |
If we move comment at the beginning of the file to compilation unit (like In #2683), then such comment is not visited when scanning from rootPackage, because compilation unit is part of secondary model (mapping of classes to files) and is not part of primary model (semantic java).
Is it OK?
Note: it breaks some tests like
CtScannerTest#testScan
with contract:all AST nodes are visited through method "scan"
WDYT?
The text was updated successfully, but these errors were encountered: