How to use 'bundle' in 'codeInsight.declarativeInlayProvider' configuration?

Answered

As shown in the picture, what does ‘bundle’ mean in the configuration and how to use it?

0
1 comment

Hi,

This is the name of the message bundle containing the keys used in nameKey and descriptionKey. For example:

https://github.com/JetBrains/intellij-community/blob/52cdedefa70d25fec73aff45539f4914f085f66e/java/java-impl/src/META-INF/JavaPlugin.xml#L1283-L1290

<codeInsight.declarativeInlayProvider language="JAVA"
                                      implementationClass="com.intellij.codeInsight.hints.JavaImplicitTypeDeclarativeInlayHintsProvider"
                                      isEnabledByDefault="false"
                                      group="TYPES_GROUP"
                                      providerId="java.implicit.types"
                                      bundle="messages.JavaBundle"
                                      nameKey="java.implicit.types.inlay.provider.name"
                                      descriptionKey="settings.inlay.java.implicit.types.description"/>

In this provider, name and description are provided from the JavaBundle.properties file:
https://github.com/JetBrains/intellij-community/blob/52cdedefa70d25fec73aff45539f4914f085f66e/java/openapi/resources/messages/JavaBundle.properties

java.implicit.types.inlay.provider.name=Implicit types
settings.inlay.java.implicit.types.description=Local variables declared with the var keyword when the inferred type may not be clear from the right part of the assignment, for example, when using a factory method.
0

Please sign in to leave a comment.