This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch feature/CAMEL-25208-code-assist in repository https://gitbox.apache.org/repos/asf/camel.git
commit bdbbbd013a4cdba073042e1805679286722b0161 Author: Claus Ibsen <[email protected]> AuthorDate: Wed Sep 30 23:15:44 2026 +0200 CAMEL-25208: docs - Camel checks, quick doc and completion of Java and XML routes The TUI page says what the Source editor does for Java and XML routes (completion in the endpoint uris, the quick doc panel, the checks that mark problems without blocking the save); the devtools page says what camel validate source checks in the routes of Java and XML files. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../modules/ROOT/pages/camel-jbang-devtools.adoc | 8 ++++++-- docs/user-manual/modules/ROOT/pages/camel-jbang-tui.adoc | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-devtools.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang-devtools.adoc index 44a580ed4062..5b292616a877 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang-devtools.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-devtools.adoc @@ -425,9 +425,13 @@ Validation success (files:2) `camel validate yaml` checks the YAML DSL schema, then the endpoint URIs, Simple expressions and bean references against the Camel catalog (`--catalog=false` for the schema only); `--canonical` validates against the canonical schema and reports the deprecated compact notation. `camel validate source` validates any file `camel run` would -load: YAML routes, `.properties` files (the `camel.*` keys), Java (compiles it), XSLT and XML. +load: YAML routes, `.properties` files (the `camel.*` keys), Java (compiles it), XSLT and XML. The routes of a Java +or XML DSL file are also read into the Camel model, without compiling or running them, and checked as YAML routes +are: the endpoint URIs (with the endpoint DSL and constants resolved), Simple expressions, and a `to` whose URI +holds `+${...}+` and should be a `toD` - what the compiler cannot see inside the strings. A part of a Java route the +parser cannot work out (a value computed at runtime) is left unchecked, and `camel_validate_source` lists it. As the routes of an application are spread over the files of its directory, `camel validate source` also reports a -`direct:` or `seda:` endpoint a YAML route sends to that no route consumes, in that file or in the YAML, Java and +`direct:` or `seda:` endpoint a YAML, Java or XML route sends to that no route consumes, in that file or in the YAML, Java and XML route files of its directory and its subdirectories: with `direct:` the route would fail to start, with `seda:` the messages would be queued and never read. The check stays quiet when it cannot be certain: an endpoint only known at runtime (a property placeholder, an expression), route templates and Kamelets, and a directory that is only a part diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-tui.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang-tui.adoc index a5726dba200b..96bb27ab346f 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang-tui.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-tui.adoc @@ -191,7 +191,7 @@ Additional features: === Source Editor -Press *F4* to enter edit mode for YAML routes, `application.properties`, and other local files. +Press *F4* to enter edit mode for YAML, Java and XML routes, `application.properties`, and other local files. The editor provides a plain-text editing experience with features designed for working with Camel routes: @@ -206,6 +206,13 @@ Camel routes: and Spring Boot auto-configuration properties (`+server.*+`, `+spring.*+`, `+management.*+`, etc.) resolved from starter JARs in the local Maven repository — works even for stopped projects ** In YAML DSL routes: EIP names, component URIs, option keys and values +** In Java and XML DSL routes: in the endpoint URI of `from`, `to`, `toD`, `wireTap`, `enrich`, `pollEnrich` + and `poll` (the string given to them in Java, their `uri` attribute in XML), the component name, the + endpoint options and their values + +A quick documentation panel at the bottom shows the documentation of the line the cursor is on: for YAML, Java +and XML routes the component and options of an endpoint, the EIP of a step and the language of its expression. +Java routes are read by the Java DSL parser without compiling them, so constants and the endpoint DSL are resolved. The editor shows *gutter change markers* -- a green background on line numbers that have been modified or added since the file was opened. This gives an at-a-glance view of what you've changed. @@ -227,6 +234,12 @@ file is not saved and errors are displayed in a popup. This catches mistakes ear * *Simple expression validation* -- validates Simple language expressions for syntax errors, detecting the correct context (predicate vs expression) from the parent EIP +Java and XML routes get the same Camel checks, on the Camel model the routes are read into: the endpoint URIs +(also those built with the endpoint DSL, or from a constant), Simple expressions, and a `to` whose URI holds +`+${...}+` and should be a `toD`. Their problems are marked on their lines while you type (*F9* jumps to the next) +and said when saving, but they never keep a Java or XML file from being saved: a Java file is the application's +code, and a check that cannot know something (a value computed at runtime) must not stop you. + Validation can be toggled off in the Settings (F2 > Settings). == Activity
