mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Kotlin: Fix File locations, and fromSource/hasSourceLocation for Kotlin code
This commit is contained in:
@@ -192,7 +192,7 @@ class Location extends @location {
|
||||
}
|
||||
|
||||
private predicate hasSourceLocation(Top l, Location loc, File f) {
|
||||
hasLocation(l, loc) and f = loc.getFile() and f.getExtension() = "java"
|
||||
hasLocation(l, loc) and f = loc.getFile() and f.getExtension() = ["java", "kt"]
|
||||
}
|
||||
|
||||
cached
|
||||
|
||||
@@ -34,7 +34,7 @@ class Element extends @element, Top {
|
||||
* Elements pertaining to source files may include generated elements
|
||||
* not visible in source code, such as implicit default constructors.
|
||||
*/
|
||||
predicate fromSource() { this.getCompilationUnit().getExtension() = "java" }
|
||||
predicate fromSource() { this.getCompilationUnit().getExtension() = ["java", "kt"] }
|
||||
|
||||
/** Gets the compilation unit that this element belongs to. */
|
||||
CompilationUnit getCompilationUnit() { result = this.getFile() }
|
||||
|
||||
Reference in New Issue
Block a user