optimization: filter inspection by language more correct in tests

Provide correct EP for inspection tools even with inconsistent tool.getShortName() and shortName="" in plugin.xml.
That allows obtaining correct tool.getLanguage(), and avoid running irrelevant inspections.
E.g. CheckDtdRef inspection doesn't run in java-only tests anymore.

GitOrigin-RevId: 188e9d55686ca084611c5c89cb899874dd078010
This commit is contained in:
Alexey Kudravtsev
2024-02-25 04:17:10 +01:00
committed by intellij-monorepo-bot
parent 7248824100
commit dfc5db43aa
36 changed files with 258 additions and 204 deletions

View File

@@ -4,6 +4,7 @@ package org.intellij.lang.regexp.inspection;
import com.intellij.codeHighlighting.HighlightDisplayLevel;
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.codeInspection.InspectionWrapperUtil;
import com.intellij.codeInspection.InspectionsBundle;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.ex.InspectionProfileImpl;
@@ -55,6 +56,6 @@ public abstract class RegExpInspectionTestCase extends BasePlatformTestCase {
protected final void quickfixAllTest(@Language("RegExp") String before, @Language("RegExp") String after) {
InspectionProfileEntry inspection = getInspection();
quickfixTest(before, after, InspectionsBundle.message("fix.all.inspection.problems.in.file", inspection.getDisplayName()));
quickfixTest(before, after, InspectionsBundle.message("fix.all.inspection.problems.in.file", InspectionWrapperUtil.wrapTool(inspection).getDisplayName()));
}
}