spring-projects / sts4

The next generation of tooling for Spring Boot, including support for Cloud Foundry manifest files, Concourse CI pipeline definitions, BOSH deployment manifests, and more... - Available for Eclipse, Visual Studio Code, and Theia
https://spring.io/tools
Eclipse Public License 1.0
878 stars 206 forks source link

Support CRON expression value in Spring Boot property files (`application.properties` and `application.yml`) #1329

Open BoykoAlex opened 2 months ago

BoykoAlex commented 2 months ago

Support syntax validation and possibly highlighting of CRON expressions values inside spring property files (properties/yaml)

spring.integration.poller.cron=0 /30 ?

Likely new CRON value type needs to be added for properties.

Other properties (info from the Spring Core team):

(See support for CRON in IntelliJ: https://www.jetbrains.com/help/idea/scheduled-tasks.html)

BoykoAlex commented 2 months ago

@martinlippert likely we may have to give up on this for now as Spring Boot properties metadata has String type for CRON expression and no other helpful metadata. Perhaps the default value if it parses to CronExpression might be used to decide whether this is a CRON expression but it feels as a flaky criteria. I have pushed some code to support cron parameter as a SPEL or Property Holder but i think this is as far as we can get for now without extra metadata for Cron expression type in the JSON there isn't much we can do. Furthermore, I have only seen CRON expression type value in one property in Spring Integration so far... Thus, it may not worth the effort.

martinlippert commented 2 months ago

Maybe good enough to hard-code the type of this property instead of defining new metadata for this type.

BoykoAlex commented 2 months ago

We can hard-code it, yes, but again there is only one such property that I found hence all the work for one property. We can even have settings for user to add more property keys that support cron expression. It just feels too much work for a little gain so far :-\ IntelliJ has no support for cron expressions in properties files... likely this feature does not have high demand...

martinlippert commented 2 months ago

Agree. Moving to backlog