Source code that reproduces the problem: link.
Suppose I have this kind of structure of configuration properties:
@Data
@ConfigurationProperties(prefix = "props")
public class ConfigProperties {
private String testString;
private Map<String, InnerConfigProperties> testMap;
}
@Data
public class InnerConfigProperties {
private String innerString;
private Integer innerInt;
}
In application.yml
I set them in this way:
props:
testString: asdadasd
somWrongProperty: asdasd
testMap:
key1:
innerString: value1
innerInt: 1
someInnerWrongProperty: wrongvalue
key2:
innerString: value2
innerInt: 2
After launching annotation processing only the simple properties work correctly (you can navigate to their declaration by clicking with ctrl
, also autocomplete for them works). Also, IDEA detects if the property is incorrect and highlights it.
For nested structures (which are map values) both of these features don't seem to work properly. You still can click on them but IDEA will navigate to the map declaration. Also, code completion for map values and highlighting of the wrong fields don't work.
Screenshot from IDEA:
Does anybody know how to make it work correctly? Feel free to use the attached example code.
Thanks in advance.
UPDATE
Seems to be fixed in Intellij IDEA 2022.1. Related issues: IDEA-151708 and IDEA-159276.
Nice bugfix productivity though.