KT-610 Distinguish errors 'unused variable' and 'variable is assigned but never accessed'
This commit is contained in:
@@ -88,7 +88,7 @@ public class JetPsiChecker implements Annotator {
|
||||
}
|
||||
else if (diagnostic.getSeverity() == Severity.WARNING) {
|
||||
annotation = holder.createWarningAnnotation(diagnostic.getFactory().getTextRange(diagnostic), getMessage(diagnostic));
|
||||
if (diagnostic.getFactory() == Errors.UNUSED_VARIABLE) {
|
||||
if (diagnostic.getFactory() == Errors.UNUSED_VARIABLE || diagnostic.getFactory() == Errors.ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE) {
|
||||
annotation.setHighlightType(ProblemHighlightType.LIKE_UNUSED_SYMBOL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class C() {
|
||||
}
|
||||
|
||||
fun f(): Unit {
|
||||
var x: Int? = 1
|
||||
var <warning>x</warning>: Int? = 1
|
||||
x = 1
|
||||
x <error>+</error> 1
|
||||
x <error>plus</error> 1
|
||||
|
||||
Reference in New Issue
Block a user