From e668728d78f0ce519e1b3939266879358975ae92 Mon Sep 17 00:00:00 2001 From: Louis Vignier Date: Wed, 9 Aug 2023 13:30:59 +0200 Subject: [PATCH] [java-highlighting] Test extra semicolons highlighting in JDK 21 IJ-CR-110702 GitOrigin-RevId: c477953def6dd7c26f0b46755afabe98161e08dc --- .../SemicolonAfterImport.java | 6 +++++ .../SemicolonBeforeImport.java | 6 +++++ .../SemicolonBetweenImport.java | 7 ++++++ .../SemicolonWithoutImport.java | 5 ++++ .../daemon/SemicolonHighlightingTest.kt | 24 +++++++++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonAfterImport.java create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBeforeImport.java create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBetweenImport.java create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonWithoutImport.java create mode 100644 java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/SemicolonHighlightingTest.kt diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonAfterImport.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonAfterImport.java new file mode 100644 index 000000000000..cc76aa91f39e --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonAfterImport.java @@ -0,0 +1,6 @@ +package foo; + +import java.util.List; +; + +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBeforeImport.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBeforeImport.java new file mode 100644 index 000000000000..52070e0576c9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBeforeImport.java @@ -0,0 +1,6 @@ +package foo; + +; +import java.util.List; + +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBetweenImport.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBetweenImport.java new file mode 100644 index 000000000000..d4301ea6c0b2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonBetweenImport.java @@ -0,0 +1,7 @@ +package foo; + +import java.util.List; +; +import java.util.Date; + +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonWithoutImport.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonWithoutImport.java new file mode 100644 index 000000000000..0de2d1abaaf4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/semicolonHighlighting/SemicolonWithoutImport.java @@ -0,0 +1,5 @@ +package foo; + +; + +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/SemicolonHighlightingTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/SemicolonHighlightingTest.kt new file mode 100644 index 000000000000..a7f878900db9 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/SemicolonHighlightingTest.kt @@ -0,0 +1,24 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.java.codeInsight.daemon + +import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase +import com.intellij.pom.java.LanguageLevel + +class SemicolonHighlightingTest: LightDaemonAnalyzerTestCase() { + private val BASE_PATH = "/codeInsight/daemonCodeAnalyzer/semicolonHighlighting" + + @Throws(Exception::class) + override fun setUp() { + super.setUp() + setLanguageLevel(LanguageLevel.JDK_21) + } + + private fun doTest() { + doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false) + } + + fun testSemicolonAfterImport() { doTest() } + fun testSemicolonBeforeImport() { doTest() } + fun testSemicolonBetweenImport() { doTest() } + fun testSemicolonWithoutImport() { doTest() } +} \ No newline at end of file