tests: simplify IdentifierHighlighterPassFactory.doWithHighlightingEnabled to remove confusion

GitOrigin-RevId: 5f135498ddc65297c82733ee6387bac29aa43c26
This commit is contained in:
Alexey Kudravtsev
2025-05-02 11:56:48 +00:00
committed by intellij-monorepo-bot
parent c08bdb7b0c
commit 8427ef6490
11 changed files with 31 additions and 23 deletions
@@ -174,7 +174,7 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() {
fun testHighlighting() {
myFixture.setReadEditorMarkupModel(true)
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, testRootDisposable, Runnable {
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, Runnable {
myFixture.openFileInEditor(getTestFile("Navigation.class"))
myFixture.editor.caretModel.moveToOffset(offset(8, 14)) // m2(): usage, declaration
assertEquals(2, highlightUnderCaret().size)
@@ -196,7 +196,7 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() {
fun testNameHighlightingInsideCompiledFile() {
myFixture.setReadEditorMarkupModel(true)
myFixture.openFileInEditor(getTestFile("NamesHighlightingInsideCompiledFile.class"))
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, testRootDisposable, Runnable {
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, Runnable {
val infos = myFixture.doHighlighting()
assertTrue(infos.toString(), infos.all { info: HighlightInfo -> info.severity === HighlightInfoType.SYMBOL_TYPE_SEVERITY })
assertEquals(68, infos.size)
@@ -206,7 +206,7 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() {
fun testNameHighlightingInsideCompiledModuleFile() {
myFixture.setReadEditorMarkupModel(true)
myFixture.openFileInEditor(getTestFile("module-info.class"))
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, testRootDisposable, Runnable {
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, Runnable {
val infos = myFixture.doHighlighting()
.filter { it.severity === HighlightInfoType.SYMBOL_TYPE_SEVERITY }
assertEquals(5, infos.size)
@@ -225,7 +225,7 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() {
val testFile = getTestFile("RecordHighlighting.class")
testFile.parent.children; testFile.parent.refresh(false, true) // inner classes
myFixture.openFileInEditor(testFile)
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, testRootDisposable, Runnable {
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, Runnable {
val infos = myFixture.doHighlighting()
.filter { it.severity === HighlightInfoType.SYMBOL_TYPE_SEVERITY }
val texts = infos.map { it.text }.toSet()