Clarify relationship of isFromSource and Element::fromSource.

This commit is contained in:
Max Schaefer
2024-01-09 16:21:36 +00:00
parent 3e8775daaa
commit 9b7cfd88cd

View File

@@ -86,8 +86,15 @@ predicate includeAutomodelCandidate(string package, string type, string name, st
/**
* Holds if the given program element corresponds to a piece of source code,
* that is, it is not compiler-generated.
*
* Note: This is a stricter check than `Element::fromSource`, which simply
* checks whether the element is in a source file as opposed to a JAR file.
* There can be compiler-generated elements in source files (especially for
* Kotlin), which we also want to exclude.
*/
predicate isFromSource(Element e) {
// from a source file (not a JAR)
e.fromSource() and
// not explicitly marked as compiler-generated
not e.isCompilerGenerated() and
// does not have a dummy location