[ 
https://issues.apache.org/jira/browse/CAMEL-25240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121713#comment-18121713
 ] 

Claus Ibsen commented on CAMEL-25240:
-------------------------------------

Approach: use the XML schema the catalog serves for the project's Camel 
version, CamelCatalog.xmlIoSchemaAsXml() (and springSchemaAsXml() for Spring 
XML), as the source for the structure:
* each complexType lists its allowed child elements explicitly (outputs, 
expression languages, when/otherwise...), no substitution groups; inherited 
attributes come through xs:extension base;
* attributes carry use="required" (pre-fill e.g. uri on <to>) and 
xs:documentation for the details panel;
* attribute types are xs:string (to allow placeholders), so enum values come 
from the catalog EIP model by element name, as the YAML value completion does.
Parse once per catalog and cache. The main work is the XML context scanner (tag 
stack from the text above the cursor: comments, CDATA, self-closing, multi-line 
start tags, namespace prefixes), working while the file does not parse.

_Claude Code on behalf of davsclaus_

> camel-jbang - source editor completion for XML DSL elements and attributes
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-25240
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25240
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> The source editor of camel-jbang completes endpoint uris in XML routes (the 
> uri attribute, CAMEL-25208) and simple expressions (CAMEL-25219). Everything 
> else in an XML route gets no completion, while YAML routes have EIP names, 
> EIP options and their values from the catalog.
> Add Tab completion for the XML DSL, from the same catalog data the YAML 
> completion uses:
> * after < : the EIP elements allowed inside the parent element (the outputs 
> of a step, the expression languages where an expression goes, when/otherwise 
> in a choice...);
> * inside a start tag: the attributes of that EIP (its options of kind 
> attribute), without the ones already given;
> * after attr=" : the values of the attribute (enums, true/false, property 
> placeholders), as YAML values have.
> Read the parent element and the tag being typed from the lines above the 
> cursor, so it works while the file does not parse (as EndpointUriContext and 
> SimpleCompletionContext do).
> Tests for each kind in camel-jbang-plugin-tui; help (source.md) and the 
> source editor doc page updated.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to