sts4 icon indicating copy to clipboard operation
sts4 copied to clipboard

Support `@ConfigurationProperties` on bean method for `application.properties` references

Open myatmin opened this issue 1 year ago • 2 comments

Expected Behavior

Should link up the reference to bean method's return type class

Current Behavior

Unknown properties

Context

As given configuration class as below

@Configuration
public class FooConfiguration {
  public static final String PREFIX = "foo.bar";
 @Bean
    @ConfigurationProperties(PREFIX)
    BarProperties barProperties() {
        return new BarProperties();
    }
}

public class BarProperties {
}

BarProperties type should be referenced on foo.bar properties in applicaiton.properties/application.yaml file, so that easier finding the correct type, same as @ConfigurationProperties annotation declaration on the class as below

@ConfigurationProperties(prefix = "foo.bar")
public class BarProperties {
}

myatmin avatar May 24 '24 03:05 myatmin

I tried to reproduce this with a simple String property in the BarProperties class and added the spring-boot-configuration-processor to the dependencies in the pom.xml file. The metadata is generated correctly and content-assist, hover help, etc. all shows up nicely for those properties in the editor when opening the application.properties file.

Can you attach a sample project that reproduces the problem you are observing?

martinlippert avatar May 24 '24 17:05 martinlippert

@myatmin Still waiting for your input here. Any updates?

martinlippert avatar Jun 24 '24 09:06 martinlippert