Kotlin: Put diagnostics in a TRAP file

Currently we just put everything in as severe with no location.
This commit is contained in:
Ian Lynagh
2021-09-02 15:22:43 +01:00
parent a40ebd2520
commit dbc3f29426
2 changed files with 39 additions and 19 deletions

View File

@@ -20,6 +20,7 @@ Location unusedLocation() {
not exists(Top t | t.getLocation() = result) and
not exists(XMLLocatable x | x.getLocation() = result) and
not exists(ConfigLocatable c | c.getLocation() = result) and
not exists(@diagnostic d | diagnostics(d, _, _, _, _, result)) and
not (result.getFile().getExtension() = "xml" and
result.getStartLine() = 0 and
result.getStartColumn() = 0 and
@@ -27,9 +28,9 @@ Location unusedLocation() {
result.getEndColumn() = 0)
}
from Location l
where l = badLocation()
or l = backwardsLocation()
or l = unusedLocation()
select l
from string reason, Location l
where reason = "Bad location" and l = badLocation()
or reason = "Backwards location" and l = backwardsLocation()
or reason = "Unused location" and l = unusedLocation()
select reason, l