Syntax highlighting of Groovy embedded in Spring XML?
Spring has the ability to embed dynamic languages into its XML files (http://docs.codehaus.org/display/GROOVY/Dynamic+language+beans+in+Spring). IDEA is usually very good with languages embedded in other languages, but it doesn't catch this one. Is there a way to enable support for this? Perhaps a setting I'm missing?
请先登录再写评论。
Hi Bryan,
There's a feature request for this in the Jetbrains tracker:
http://youtrack.jetbrains.net/issue/IDEA-18657
Feel free to vote and comment.
-tt
You can easily setup language injection for lang:inline-script tag. Just
press Alt+Enter inside of it and choose 'Inject Language | Groovy'.
But for more comprehensive support, the request Taras pointed out is the
right place.
That's exactly what I was expecting to see, but I can't get the "Inject Language" popup to appear. I've confirmed that the IntelliLang plugin is enabled. I have a Language Injection settings page (IDEA 9.0.1). Have you actually seen this work in this specific case? Maybe there's something else in the XML file that IDEA looks for, or a another plugin I need?
Check the latest 9.0.2. EAP. Language injection actions in XML availability has been fixed there.
I just installed IU-95.24. I still can't get the intentions popup to appear in the xml.
Maybe Gregory is referring to an even newer EAP?
Please post here that part of an XML and indicate cursor position.
The fix for the problem I was referring was definitely included into 95.24.
I've just checked that "Inject Language" intention action is available in tags text, attribute values and CDATA sections.
Please make sure you have IntelliLang plugin enabled.
On 13.04.2010 19:07, Bryan Young wrote:
>
Here's a snippet from my spring xml.. the red bars represent places I've tried alt-enter
<lang:|groovy id="collapseAllAction2">
<lang:|inline-script>|<![CDAT|A[|
import com.jgoodies.binding.value.ValueModel
import com.mycompany.application.component.action.ActionBean
class ExpandAllAction extends ActionBean {
ValueModel tableModel;
public void actionPerformed(ActionEvent event) {
tableModel.getValue().collapseAll();
}
}
]]></lang:inline-script>
<lang:property name="name" value="Collapse All"/>
<lang:property name="iconPath" value="com/monsanto/tps/ds/views/analysis/arrow_in.png"/>
<lang:property name="tableModel" ref="hierarchicalTableModel"/>
</lang:groovy>
Looks like you don't have IntelliLang plugin enabled.
See the screenshot attached.
Red lines indicate possible cursor positions.
On 14.04.2010 23:15, Bryan Young wrote:
>
>
>
>
>
>
It looks like IntelliLang is enabled. I'm on version 8 of the plugin. I just updated to IU-95.54 just to verify that it wasn't my eap. Same problem. When I get some time, I might create a project from scratch to test this. If it still doesn't work, I'll bundle the project and attach it to an bug report. If there is anything else I can provide, just tell me.
Project will do.
On 20.04.2010 19:19, Bryan Young wrote:
>
I can confirm that this works in IDEA 9.0.2.

Bryan, make sure that:
-JetGroovy plugin is enabled
-Your module has a Groovy library (manually added, or through maven)
-IntelliLang is enabled, and you've selected Inject Language...Groovy
That said, it seems that keyword highlighting is not working in injected context