KaDiagnosticCheckerKind
KaDiagnosticCheckerKind denotes a kind of compiler checkers which report diagnostics. A KaDiagnostics query runs the checkers of the kinds it was asked for, and only those, so a checker kind is both a filter on the result and a knob on how much analysis is performed.
Selecting the kinds
Kinds are passed to withCheckers(), either as a vararg or as a Set:
A query which was not given any kind explicitly runs the COMMON checkers.
Kinds
Kind | Reports |
|---|---|
| Exactly the diagnostics of a default compilation. |
| Additional diagnostics which a default compilation does not report. |
| Additional diagnostics as well, but they may be slow and may have false positives. |
COMMON
The compiler's common checkers, the ones which always run. Their diagnostics are exactly the ones reported by a default compilation, which makes this kind the right choice for anything that has to agree with the compiler — error highlighting, a linter, or a check that generated code compiles.
This is the default of a KaDiagnostics query.
EXTENDED
Additional checkers, which a default compilation does not run. They report diagnostics such as reports about redundant code. Nothing about them is specific to an IDE — the compiler runs them too when they are explicitly enabled — but in practice they are mostly requested by IDE features.
EXPERIMENTAL
Additional checkers as well, with the same role as the EXTENDED ones, and with two differences:
They might have false positives.
They might be slow.
ALL
A Set<KaDiagnosticCheckerKind> of all checker kinds supported by the current version of the Analysis API.
Members
val name: StringA technical name of the kind, such as
COMMON. Also returned bytoString().