mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 08:09:39 +07:00
[java] Implement getName for implicit classes
GitOrigin-RevId: 069362cff5ebee9eaf5e75d566097a2deaed8e8f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7a3729260a
commit
0232d76e56
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 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.ide;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -7,7 +7,6 @@ import com.intellij.testFramework.LightPlatformTestCase;
|
||||
public class JavaFilePasteProviderTest extends LightPlatformTestCase {
|
||||
public void testDetectClassName() {
|
||||
Project project = getProject();
|
||||
assertNull(JavaFilePasteProvider.detectClassName(project, "random text pasted"));
|
||||
assertEquals("X", JavaFilePasteProvider.detectClassName(project, "class X {}"));
|
||||
assertEquals("Y", JavaFilePasteProvider.detectClassName(project, "class X {} public class Y{}"));
|
||||
assertEquals("R", JavaFilePasteProvider.detectClassName(project, "record R() {}"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.java.psi
|
||||
|
||||
import com.intellij.openapi.command.WriteCommandAction
|
||||
@@ -378,7 +378,6 @@ class B {}"""
|
||||
int field;
|
||||
""".trimIndent())
|
||||
val implicitClass = file.classes.single() as PsiImplicitClass
|
||||
TestCase.assertNull(implicitClass.name)
|
||||
val method = implicitClass.methods.single()
|
||||
TestCase.assertEquals("myMethod", method.name)
|
||||
val aClass = implicitClass.innerClasses.single()
|
||||
|
||||
Reference in New Issue
Block a user