picimako / citric

Citrus framework integration for the IntelliJ platform.
0 stars 0 forks source link

Code folding in the XML DSLs #40

Closed picimako closed 3 weeks ago

picimako commented 5 months ago

Summary

Due to the nature of XML, such files can be noisy and unnecessarily long, so some code folding could help this case and lessen the cognitive load and comprehension of Citrus XML test files.

One simple example would be the echo action. The code folding could turn

<echo>
  <message>Some message to print</message>
</echo>

into

<echo>Some message to print</echo>

and hide the <message> tags.

Tasks

Folding candidates

Some message to print

- [x] load properties in XML and Spring XML
```xml
<load>
  <properties file="classpath:some/file" />
</load>

<load properties: classpath:some/file />

<receive message "classpath:org/citrusframework/actions/payload.groovy" at "myMessageEndpoint" />


- [x] send.message.builder with `@file` in Spring
```xml
<send endpoint="myMessageEndpoint">
    <message>
        <builder type="groovy" file="classpath:org/citrusframework/actions/payload.groovy" />
    </message>
</send>

<send message "classpath:org/citrusframework/actions/payload.groovy" to "myMessageEndpoint" />

<validate by groovy script "classpath:org/citrusframework/jms/integration/helloValidationScript.groovy" />


- [x] receive.validate.script with `@file` in non-Spring
```xml
<validate>
  <script type="groovy" file="classpath:some/file" />
</validate>

<validate by groovy script "classpath:some/file" />

<jms:purge-jms-queues ref:myQueue, name:JMS.Queue.1 /> or <jms:purge-jms-queues myQueue, "JMS.Queue.1" />


- [x] Camel remove/start/stop routes at
  - [x] remove-routes.route
  - [x] start-routes.route
  - [x] stop-routes.route tag in Spring
```xml
<camel:remove-routes camel-context="camelContext">
  <route id="route_1"/>
  <route id="route_2"/>
  <route id="route_3"/>
</camel:remove-routes>

<camel:remove-routes in "camelContext": "route_1", "route_2", "route_3" />
picimako commented 3 weeks ago

Completed in v1.0.14.