diff --git a/java/java-impl/resources/inlayProviders/java.implicit.types/preview.java b/java/java-impl/resources/inlayProviders/java.implicit.types/preview.java index c24656fa3160..8e354483ca6f 100644 --- a/java/java-impl/resources/inlayProviders/java.implicit.types/preview.java +++ b/java/java-impl/resources/inlayProviders/java.implicit.types/preview.java @@ -1,9 +1,12 @@ -class ImplicitType { - void test() { - var x/*<# : ImplicitType #>*/ = someMethod(); +import java.util.*; + +class HintsDemo { + + public static void main(String[] args) { + var list/*<# : List #>*/ = getList(); } - ImplicitType someMethod() { - return null; + private static List getList() { + return Arrays.asList("hello", "world"); } } diff --git a/java/java-impl/resources/inlayProviders/java.method.chains/preview.java b/java/java-impl/resources/inlayProviders/java.method.chains/preview.java index 39ca4ead29f4..32ebe06f9cdf 100644 --- a/java/java-impl/resources/inlayProviders/java.method.chains/preview.java +++ b/java/java-impl/resources/inlayProviders/java.method.chains/preview.java @@ -1,9 +1,28 @@ -import java.util.stream.*; -class Foo { - { - Stream.of(1, 2, 3).filter(x -> x % 2 == 0)/*<# Stream #>*/ - .map(x -> x * 2)/*<# Stream #>*/ - .map(x -> "item: " + x)/*<# Stream #>*/ - .forEach(System.out::println); +class Test { + static AccountManager accountManager = new AccountManager(); + + public static void main(String[] args) { + String id = accountManager + .getAccounts()/*<# List #>*/ + .get(0)/*<# Account #>*/ + .getId()/*<# UUID> #>*/ + .toString(); + } + +} + +class AccountManager { + List accounts = new ArrayList<>(); + + public List getAccounts() { + return accounts; + } +} + +class Account { + private UUID id; + + public UUID getId() { + return id; } } \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaImplicitTypeInlayProviderTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaImplicitTypeInlayProviderTest.kt index 2534be0c1fbf..1dc51101e4ec 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaImplicitTypeInlayProviderTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaImplicitTypeInlayProviderTest.kt @@ -1,8 +1,7 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 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.inlays import com.intellij.codeInsight.hints.JavaImplicitTypeDeclarativeInlayHintsProvider -import com.intellij.lang.java.JavaLanguage import com.intellij.testFramework.LightProjectDescriptor import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.utils.inlays.declarative.DeclarativeInlayHintsProviderTestCase @@ -78,21 +77,6 @@ class Demo { testAnnotations(text) } - fun testPreview() { - doTestPreview(""" -class ImplicitType { - void test() { - var x/*<# : |[ImplicitType:java.fqn.class]ImplicitType #>*//*<# : ImplicitType #>*/ = someMethod(); - } - - ImplicitType someMethod() { - return null; - } -} - """.trimIndent(), JavaImplicitTypeDeclarativeInlayHintsProvider.PROVIDER_ID, JavaImplicitTypeDeclarativeInlayHintsProvider(), JavaLanguage.INSTANCE) - } - - private fun testAnnotations(@Language("Java") text: String) { doTestProvider("A.java", text, JavaImplicitTypeDeclarativeInlayHintsProvider()) } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaMethodChainHintsTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaMethodChainHintsTest.kt index d445c986067c..d3a79943ab4c 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaMethodChainHintsTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/inlays/JavaMethodChainHintsTest.kt @@ -1,8 +1,7 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 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.inlays import com.intellij.codeInsight.hints.JavaMethodChainsDeclarativeInlayProvider -import com.intellij.lang.java.JavaLanguage import com.intellij.testFramework.utils.inlays.declarative.DeclarativeInlayHintsProviderTestCase import org.intellij.lang.annotations.Language @@ -207,21 +206,6 @@ public class Chains { """) } - fun testPreview() { - doTestPreview(""" -import java.util.stream.*; -class Foo { - { - Stream.of(1, 2, 3).filter(x -> x % 2 == 0)/*<# Stream #>*/ - .map(x -> x * 2)/*<# Stream #>*/ - .map(x -> "item: " + x)/*<# Stream #>*/ - .forEach(System.out::println); - } -} - """.trimIndent(), JavaMethodChainsDeclarativeInlayProvider.PROVIDER_ID, JavaMethodChainsDeclarativeInlayProvider(), - JavaLanguage.INSTANCE) - } - fun test() { check(""" abstract class Foo { diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index 38c1057e14a0..e106387c74db 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -1263,7 +1263,7 @@ inlay.parameters.java.enums=Enum constant declarations that use a parametrized c # suppress inspection "UnusedProperty" inlay.parameters.java.new.expr=Calls to parametrized constructors. # suppress inspection "UnusedProperty" -inlay.parameters.java.clear.expression.type=Method calls that use a complex expression as an argument, for example, the ternary operator or a Java 13 switch statement. +inlay.parameters.java.clear.expression.type=Method calls that use a complex expression as an argument, for example, a conditional expression or Java 13 switch expression. inlay.MethodChainsInlayProvider.description=Method return types in call chains. inlay.annotation.hints.inferred.annotations=Annotations that IntelliJ IDEA generates by scanning libraries and project code. These annotations help you understand code contracts and improve the capabilities of static analysis. They include:
@Contract
@Nullable
@NotNull
@Unmodifiable
@UnmodifiableView

Documentation inlay.annotation.hints.external.annotations=Annotations that are stored outside your source code.
These annotations are useful when you need an annotation, but adding it to the source code is not an option (for example, when working with a library code).

Documentation diff --git a/platform/lang-impl/resources/codeVisionProviders/problems/preview.java b/platform/lang-impl/resources/codeVisionProviders/problems/preview.java index 8a4b0f4cb6c4..1c29522f1863 100644 --- a/platform/lang-impl/resources/codeVisionProviders/problems/preview.java +++ b/platform/lang-impl/resources/codeVisionProviders/problems/preview.java @@ -1,5 +1,3 @@ -class Thing { - void changedMethod(String s) { - - } +class Button { + void actionPerformed() {} } \ No newline at end of file diff --git a/platform/lang-impl/resources/codeVisionProviders/vcs.code.vision/preview.java b/platform/lang-impl/resources/codeVisionProviders/vcs.code.vision/preview.java index f74088d87f83..1c29522f1863 100644 --- a/platform/lang-impl/resources/codeVisionProviders/vcs.code.vision/preview.java +++ b/platform/lang-impl/resources/codeVisionProviders/vcs.code.vision/preview.java @@ -1,5 +1,3 @@ -class Thing { - void doThing() { - - } +class Button { + void actionPerformed() {} } \ No newline at end of file diff --git a/platform/lang-impl/resources/messages/CodeVisionBundle.properties b/platform/lang-impl/resources/messages/CodeVisionBundle.properties index f79eba68a7f2..2e57d521d8a4 100644 --- a/platform/lang-impl/resources/messages/CodeVisionBundle.properties +++ b/platform/lang-impl/resources/messages/CodeVisionBundle.properties @@ -18,13 +18,13 @@ CodeLensGlobalSettingsProvider.visibleMetricsAbove.description=Visible metrics a CodeLensGlobalSettingsProvider.visibleMetricsNext.description=Visible metrics next to declaration: codeLens.references.name=Usages -codeLens.references.description=The number of usages of the class or method in the project. Click the hint to navigate to usages. +codeLens.references.description=The number of usages of the class or method in the project. Click the hint to navigate to the usages. codeLens.inheritors.name=Inheritors codeLens.inheritors.description=The number of descendants the class or interface has. Click the hint to navigate to the code that inherits from this class or interface. codeLens.problems.name=Related problems -codeLens.problems.description=The number of problems in the project related to the class or member signature. For example: missing parameters, wrong return type, and so on.

The hint does not appear for the problems within the same file. +codeLens.problems.description=The number of problems in the project related to the class or member signature. For example: missing parameters, wrong return type, and so on.

The hint does not appear for problems within the same file. codeLens.vcs.code.vision.name=Code author -codeLens.vcs.code.vision.description=Code author(s) for a given element (e.g. class or method). +codeLens.vcs.code.vision.description=The author of the code according to the records in the VCS.

The author is whoever last edited the class, method, or function. If there are multiple commits from different authors, the one who owns the most lines is considered the author. codeLens.rename.name=Rename codeLens.rename.description=Shown after renaming a symbol. Click the hint to rename usages of the symbol in the project. codeLens.change.signature.name=Change signature