Better support for property placeholders and Spring EL

When it comes to "classic" spring XML mixed with PropertyPlaceholderConfigurer beans, IDEA does a good job providing code completion and validation for property keys.
Unfortunately, support for the newer Spring EL expressions seems to be somewhat lacking, which makes using IDEA on some projects a bit cumbersome.

Here's an example. The main context file declares some properties, and pulls in beans from the classpath:

<util:properties id="myProperties" location="classpath:/my.properties"/>
<context:component-scan base-package="foo.bar"/>

Inside the autowired bean class, references to configuration properties look like this:

@Value("#{myProperties['containing.a.dot'] }")
int number;

@Value("#{myProperties.someName]}")
String name;


Here's a summary of what I find missing:

1) EL language injection inside #{...} fragments in @Value annotations

The strange thing is that I remember this working in earlier IDEA 10 EAP builds.
Note that EL language injection for #{} blocks actually works in Spring XML.

2) Completion for property keys.

If IDEA can resolve the Spring EL bean reference to a properties file, code completion for keys could be provided.
Find usages, Ctrl-Click, all the regular reference features.

3) Completion icons for bean names

Inside Spring EL expressions, it would be convenient (and consistent) to see the green "bean" icons for references to Spring beans.
At the moment IDEA presents bean names using the regular EL "v" (variable) icon.

4) Longer term: more complete Spring EL support

Slowly but surely, Spring EL is diverging more from regular EL.
Given how dominant usage of Spring is in current-day projects, it would be good to have dedicated SpEL support in IDEA.

If not for a point release, then at least as a roadmap item for IDEA 11 :)

3 comments
Comment actions Permalink

Thanks for your input Taras!
AFAIK you have devoted YT tickets for this. If not, please file it.

0
Comment actions Permalink

Hi Dmitry,

Here are the related tickets:

1) EL language injection inside #{...} fragments in @Value annotations
2) Completion for property keys.


http://youtrack.jetbrains.net/issue/IDEA-60998
http://youtrack.jetbrains.net/issue/IDEA-60883 (duplicate?)

3) Completion icons for bean names


http://youtrack.jetbrains.net/issue/IDEA-61916 (already fixed - thanks)

4) Longer term: more complete Spring EL support


I guess this will be implemented in IDEA v11 only, correct?
I can file specific tickets now if there's a chance for getting this in a 10.x update release.

-tt
0
Comment actions Permalink

Everything except 4) can be addressed in 10.x.

0

Please sign in to leave a comment.