This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new f3123bfa2048 camel-tui: Fix inline docs for from URIs in source view
f3123bfa2048 is described below
commit f3123bfa2048c3d6949c9f1940831221f81baad4
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jul 27 16:49:28 2026 +0200
camel-tui: Fix inline docs for from URIs in source view
The YAML_URI_PATTERN regex required a colon in the URI value
(e.g. timer:orders), but canonical YAML DSL uses uri without
colon when parameters are in a separate block (e.g. uri: timer).
Made the colon optional so both formats match.
Also replaced the hardcoded YAML_EIP_PATTERN (static list of ~45
EIP names) with a dynamic catalog lookup via catalog.eipModel(),
so all current and future EIPs are covered automatically.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../dsl/jbang/core/commands/tui/SourceTab.java | 24 ++++++++--------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
index 601c2ab12859..545664646d76 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceTab.java
@@ -99,17 +99,9 @@ class SourceTab extends AbstractTab {
private boolean springBootMetadataLoaded;
private static final Pattern YAML_URI_PATTERN = Pattern.compile(
-
"^\\s*-?\\s*(?:uri|from|to|toD|wireTap|enrich|pollEnrich|deadLetterChannel):\\s*\"?([a-zA-Z][a-zA-Z0-9+.-]*:[^\"\\s]*)");
- private static final Pattern YAML_EIP_PATTERN = Pattern.compile(
-
"^\\s*-?\\s*(aggregate|bean|choice|circuitBreaker|claim[Cc]heck|convertBodyTo|convertHeaderTo|"
- +
"delay|dynamicRouter|enrich|filter|idempotentConsumer|"
- +
"intercept|kamelet|loadBalance|log|loop|marshal|multicast|"
- +
"onException|otherwise|pipeline|pollEnrich|process|"
- +
"recipientList|removeHeader|removeHeaders|removeProperty|"
- +
"resequence|rollback|routingSlip|saga|sample|"
- +
"script|serviceCall|setBody|setHeader|setProperty|"
- +
"sort|split|step|stop|threads|throttle|"
- +
"to|toD|transform|unmarshal|validate|when|wireTap)\\s*:");
+
"^\\s*-?\\s*(?:uri|from|to|toD|wireTap|enrich|pollEnrich|deadLetterChannel):\\s*\"?([a-zA-Z][a-zA-Z0-9+.-]*(?::[^\"\\s]*)?)");
+ private static final Pattern YAML_KEY_PATTERN = Pattern.compile(
+ "^\\s*-?\\s*([a-zA-Z][a-zA-Z0-9]*)\\s*:");
SourceTab(MonitorContext ctx) {
super(ctx);
@@ -557,10 +549,12 @@ class SourceTab extends AbstractTab {
continue;
}
- Matcher eipMatcher = YAML_EIP_PATTERN.matcher(code);
- if (eipMatcher.find()) {
- String eipName = eipMatcher.group(1);
- RoutesTab.buildEipInlineDoc(result, codeData, catalog,
eipName, null, i);
+ Matcher keyMatcher = YAML_KEY_PATTERN.matcher(code);
+ if (keyMatcher.find()) {
+ String key = keyMatcher.group(1);
+ if (catalog.eipModel(key) != null) {
+ RoutesTab.buildEipInlineDoc(result, codeData, catalog,
key, null, i);
+ }
}
}
return result;