mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Clarify relationship of isFromSource and Element::fromSource.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user