Skip to content

Java: Add manual overlay annotations & discard predicates #19813

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

Draft
wants to merge 3 commits into
base: kaspersv/overlay-java-annotations
Choose a base branch
from

Conversation

kaspersv
Copy link
Contributor

No description provided.

@kaspersv kaspersv force-pushed the kaspersv/overlay-java-discarding branch from 6f5bc41 to 8672313 Compare June 19, 2025 06:34
@kaspersv kaspersv force-pushed the kaspersv/overlay-java-discarding branch from 8672313 to db52a3c Compare June 19, 2025 07:13
// bodies for dependencies. To approximate fully extracted files in
// the overlay, we restrict attention to files that contain an expression
// with an enclosing callable.
exists(@expr e | callableEnclosingExpr(e, _) and file = getRawFile(e))
Copy link
Contributor

Choose a reason for hiding this comment

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

@smowton suggested in the internal issue for "Java overlay: Low-level accuracy issues" to use the numlines table instead of callableEnclosingExpr to identify non-skeleton files.

I'm fine with postponing that change (and its evaluation) to a follow-up PR.

exists(@member m | file = getRawFile(m) and hasJavadoc(m, d))
}

/** Discard javadoc entities in files fully extracted in the overlay. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also have discarding rules for comments that aren't Javadoc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those appear to be modelled as javadoc entities as well using isNormalComment and isEolComment for /* ... */ comments and // comments, respectively.

There is also ktComments for Kotlin comments and xmlComments for XML that will need to be handled separately in the future.

@kaspersv kaspersv force-pushed the kaspersv/overlay-java-discarding branch from db52a3c to 26896ea Compare June 20, 2025 11:39
@kaspersv kaspersv force-pushed the kaspersv/overlay-java-annotations branch from ea40677 to 052023e Compare June 20, 2025 11:59
@kaspersv kaspersv force-pushed the kaspersv/overlay-java-discarding branch from 26896ea to d547320 Compare June 20, 2025 12:05
@kaspersv kaspersv force-pushed the kaspersv/overlay-java-discarding branch from d547320 to bdf1bdd Compare June 20, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants