This is an automated email from the ASF dual-hosted git repository.
jpoth 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 79b2e247583 CAMEL-21723: camel-jbang edit plugin display extra
information on camel options
79b2e247583 is described below
commit 79b2e2475837791aef167ab940083ba58f5930c1
Author: John Poth <[email protected]>
AuthorDate: Mon Jun 2 14:51:42 2025 +0200
CAMEL-21723: camel-jbang edit plugin display extra information on camel
options
---
.../dsl/jbang/core/commands/edit/CamelNanoLspEditor.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-edit/src/main/java/org/apache/camel/dsl/jbang/core/commands/edit/CamelNanoLspEditor.java
b/dsl/camel-jbang/camel-jbang-plugin-edit/src/main/java/org/apache/camel/dsl/jbang/core/commands/edit/CamelNanoLspEditor.java
index f0dd77139e2..c3a2cafef72 100644
---
a/dsl/camel-jbang/camel-jbang-plugin-edit/src/main/java/org/apache/camel/dsl/jbang/core/commands/edit/CamelNanoLspEditor.java
+++
b/dsl/camel-jbang/camel-jbang-plugin-edit/src/main/java/org/apache/camel/dsl/jbang/core/commands/edit/CamelNanoLspEditor.java
@@ -36,6 +36,7 @@ import org.apache.camel.catalog.EndpointValidationResult;
import org.apache.camel.parser.model.CamelEndpointDetails;
import org.apache.camel.tooling.util.Strings;
import org.eclipse.lsp4j.CompletionItem;
+import org.eclipse.lsp4j.CompletionItemTag;
import org.eclipse.lsp4j.CompletionList;
import org.eclipse.lsp4j.CompletionParams;
import org.eclipse.lsp4j.InsertReplaceEdit;
@@ -91,19 +92,23 @@ public class CamelNanoLspEditor extends Nano {
}
try {
List<CompletionItem> left =
eitherCompletableFuture.get().getLeft();
- AttributedStyle typeStyle =
AttributedStyle.DEFAULT.foreground(AttributedStyle.MAGENTA +
AttributedStyle.BRIGHT);
for (CompletionItem item : left) {
List<AttributedString> docs = new ArrayList<>();
+ docs.add(new AttributedString(item.getLabel(),
AttributedStyle.BOLD));
+ docs.add(new AttributedString(""));
String type = item.getDetail();
if (!Strings.isEmpty(type)) {
- docs.add(new AttributedString(type, typeStyle));
- docs.add(new AttributedString(""));
+ docs.add(new AttributedString("Type: " + type));
+ }
+ List<CompletionItemTag> tags = item.getTags();
+ if (tags != null &&
tags.contains(CompletionItemTag.Deprecated)) {
+ docs.add(new AttributedString("Deprecated: true"));
}
Either<String, MarkupContent> docMap = item.getDocumentation();
if (docMap != null) {
String doc = docMap.getLeft();
if (!Strings.isEmpty(doc)) {
- docs.add(new AttributedString(doc));
+ doc.lines().forEach(s -> docs.add(new
AttributedString(s)));
}
}
suggestions.put(new AttributedString(item.getLabel()), docs);