mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IJ-CR-142510 [java-highlighting] IDEA-357310 highlight soft-keywords in compiled files
- more tests GitOrigin-RevId: d10c07df9ca188e669972a182f1616e811c6aa9e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8d566906e0
commit
d33ab330f0
@@ -126,7 +126,31 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() {
|
||||
myFixture.openFileInEditor(getTestFile("module-info.class"))
|
||||
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, testRootDisposable, Runnable {
|
||||
val infos = myFixture.doHighlighting()
|
||||
.filter { it.severity === HighlightInfoType.SYMBOL_TYPE_SEVERITY }
|
||||
assertEquals(5, infos.size)
|
||||
val texts = infos.map { it.text }.toSet()
|
||||
assertContainsElements(texts,
|
||||
"module",
|
||||
"requires",
|
||||
"exports",
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fun testNameHighlightingInsideCompiledFileWithRecords() {
|
||||
myFixture.setReadEditorMarkupModel(true)
|
||||
val testFile = getTestFile("RecordHighlighting.class")
|
||||
testFile.parent.children ; testFile.parent.refresh(false, true) // inner classes
|
||||
myFixture.openFileInEditor(testFile)
|
||||
IdentifierHighlighterPassFactory.doWithHighlightingEnabled(project, testRootDisposable, Runnable {
|
||||
val infos = myFixture.doHighlighting()
|
||||
.filter { it.severity === HighlightInfoType.SYMBOL_TYPE_SEVERITY }
|
||||
val texts = infos.map { it.text }.toSet()
|
||||
assertContainsElements(texts,
|
||||
"sealed",
|
||||
"record",
|
||||
"permits",
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
plugins/java-decompiler/plugin/testData/RecordHighlighting.class
Normal file
BIN
plugins/java-decompiler/plugin/testData/RecordHighlighting.class
Normal file
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
public class RecordHighlighting {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
sealed interface A {
|
||||
|
||||
}
|
||||
|
||||
record B() implements A {
|
||||
}
|
||||
|
||||
record C() implements A {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user