From bc58434b41dddc54c3634e6900a215288e4d3057 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Tue, 31 Dec 2024 17:45:01 +0100 Subject: [PATCH] Java: JShell should allow creating records (IDEA-353210) GitOrigin-RevId: b22db66ea43261281c60fc501d8201872cda9dfc --- .../impl/src/com/intellij/execution/jshell/JShellHandler.java | 3 +++ .../com/intellij/execution/jshell/protocol/CodeSnippet.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java/execution/impl/src/com/intellij/execution/jshell/JShellHandler.java b/java/execution/impl/src/com/intellij/execution/jshell/JShellHandler.java index d2fec460982c..27328881cb27 100644 --- a/java/execution/impl/src/com/intellij/execution/jshell/JShellHandler.java +++ b/java/execution/impl/src/com/intellij/execution/jshell/JShellHandler.java @@ -447,6 +447,9 @@ public final class JShellHandler { else if (subKind == CodeSnippet.SubKind.ENUM_SUBKIND) { kindLabel = "enum"; } + else if (subKind == CodeSnippet.SubKind.RECORD_SUBKIND) { + kindLabel = "record"; + } else if (subKind == CodeSnippet.SubKind.ANNOTATION_TYPE_SUBKIND) { kindLabel = "annotation"; } diff --git a/java/execution/jshell-protocol/src/com/intellij/execution/jshell/protocol/CodeSnippet.java b/java/execution/jshell-protocol/src/com/intellij/execution/jshell/protocol/CodeSnippet.java index 8108b7c93f23..aa0aae5e3984 100644 --- a/java/execution/jshell-protocol/src/com/intellij/execution/jshell/protocol/CodeSnippet.java +++ b/java/execution/jshell-protocol/src/com/intellij/execution/jshell/protocol/CodeSnippet.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.execution.jshell.protocol; import java.io.Serializable; @@ -67,6 +67,7 @@ public class CodeSnippet implements Serializable { CLASS_SUBKIND(Kind.TYPE_DECL), INTERFACE_SUBKIND(Kind.TYPE_DECL), ENUM_SUBKIND(Kind.TYPE_DECL), + RECORD_SUBKIND(Kind.TYPE_DECL), ANNOTATION_TYPE_SUBKIND(Kind.TYPE_DECL), METHOD_SUBKIND(Kind.METHOD), VAR_DECLARATION_SUBKIND(Kind.VAR),