mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-highlighting] IDEA-324445 IJ-CR-110332 offer when after TypePattern
GitOrigin-RevId: e83a11865b073e51f26361121a739d4977abf17b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fb5e591040
commit
424001aef5
@@ -318,8 +318,7 @@ public class JavaKeywordCompletion {
|
||||
}
|
||||
|
||||
private void addWhen() {
|
||||
LanguageLevel level = PsiUtil.getLanguageLevel(myPosition);
|
||||
if (!(level == LanguageLevel.JDK_20_PREVIEW || level.isAtLeast(LanguageLevel.JDK_21))) {
|
||||
if (!HighlightingFeature.PATTERN_GUARDS_AND_RECORD_PATTERNS.isAvailable(myPosition)) {
|
||||
return;
|
||||
}
|
||||
PsiElement element = PsiTreeUtil.skipWhitespacesAndCommentsForward(myPrevLeaf);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class Main {
|
||||
void f(Object o) {
|
||||
switch (o) {
|
||||
case String s whe<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Main {
|
||||
void f(Object o) {
|
||||
switch (o) {
|
||||
case String s when <caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -10,7 +10,7 @@ public class NormalSwitchCompletionTest extends NormalCompletionTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
protected LightProjectDescriptor getProjectDescriptor() {
|
||||
return JAVA_20;
|
||||
return JAVA_21;
|
||||
}
|
||||
|
||||
public void testDefaultInRuleSwitch() { doTest(); }
|
||||
@@ -81,6 +81,7 @@ public class NormalSwitchCompletionTest extends NormalCompletionTestCase {
|
||||
public void testCompleteFinalInsideSwitch() { doTest("\n"); }
|
||||
|
||||
public void testCompleteYieldInsideSwitch() { doTest(); }
|
||||
public void testWhenInSwitchRule() { doTest(); }
|
||||
|
||||
private void doTestPostfixCompletion() {
|
||||
LiveTemplateCompletionContributor.setShowTemplatesInTests(true, myFixture.getTestRootDisposable());
|
||||
|
||||
Reference in New Issue
Block a user