Show lint diagnostics even if there're errors in the file (KT-12022)
It also affects working with KotlinChangeLocalityDetector. Right after error is fixed in local context file is still reported as having errors and diagnostics are not counted. #KT-12022 Fixed
This commit is contained in:
+6
@@ -62,6 +62,12 @@ import static com.android.tools.klint.detector.api.TextFormat.RAW;
|
||||
public class AndroidLintExternalAnnotator extends ExternalAnnotator<State, State> {
|
||||
static final boolean INCLUDE_IDEA_SUPPRESS_ACTIONS = false;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public State collectInformation(@NotNull PsiFile file, @NotNull Editor editor, boolean hasErrors) {
|
||||
return collectInformation(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public State collectInformation(@NotNull PsiFile file) {
|
||||
final Module module = ModuleUtilCore.findModuleForPsiElement(file);
|
||||
|
||||
@@ -119,6 +119,12 @@ public class KotlinLintTestGenerated extends AbstractKotlinLintTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("showDiagnosticsWhenFileIsRed.kt")
|
||||
public void testShowDiagnosticsWhenFileIsRed() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/showDiagnosticsWhenFileIsRed.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sqlite.kt")
|
||||
public void testSqlite() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/sqlite.kt");
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintSQLiteStringInspection
|
||||
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
|
||||
fun test(db: SQLiteDatabase) {
|
||||
val <warning descr="[UNUSED_VARIABLE] Variable 'a' is never used">a</warning>: String = <error descr="[CONSTANT_EXPECTED_TYPE_MISMATCH] The integer literal does not conform to the expected type String">1</error>
|
||||
|
||||
db.<warning descr="Using column type STRING; did you mean to use TEXT? (STRING is a numeric type and its value can be adjusted; for example,strings that look like integers can drop leading zeroes. See issue explanation for details.)">execSQL("CREATE TABLE COMPANY(NAME STRING)")</warning>
|
||||
}
|
||||
Reference in New Issue
Block a user