You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "johnpoth (via GitHub)" <gi...@apache.org> on 2025/04/09 13:00:21 UTC
[PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
johnpoth opened a new pull request, #17704:
URL: https://github.com/apache/camel/pull/17704
# Description
https://issues.apache.org/jira/browse/CAMEL-21945
Adds [camel-lsp](https://github.com/camel-tooling/camel-language-server) to the Camel JBang text editor. This is largely based on JLine's [Nano](https://github.com/jline/jline3/blob/master/builtins/src/main/java/org/jline/builtins/Nano.java#L59) editor. Users could then benefit from suggestions and diagnostics while writing Camel routes. This should help users to write routes faster.
Needs https://github.com/camel-tooling/camel-language-server/pull/1266

Thanks!
<!--
- Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
-->
# Target
- [ ] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
# Tracking
- [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
<!--
# *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
-->
# Apache Camel coding standards and style
- [ ] I checked that each commit in the pull request has a meaningful subject line and body.
<!--
If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
-->
- [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
<!--
You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add edit plugin [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #17704:
URL: https://github.com/apache/camel/pull/17704
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "johnpoth (via GitHub)" <gi...@apache.org>.
johnpoth commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2806569953
Ok so I added it as a _plugin_ called _edit_. I've renamed the old editor to _nano_ to not conflict. Let me know what you think
Thanks !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2799860688
This looks cool, can you try to see if you can get this to work for yaml DSL also.
And it would be good to work for application.properties as configuring those many camel options is more common to do in such a quick editor and having code assistance would be great.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on code in PR #17704:
URL: https://github.com/apache/camel/pull/17704#discussion_r2036795517
##########
parent/pom.xml:
##########
@@ -90,6 +90,7 @@
<caffeine-version>3.2.0</caffeine-version>
<californium-version>3.14.0</californium-version>
<californium-scandium-version>3.11.0</californium-scandium-version>
+ <camel-lsp-version>1.30.0-SNAPSHOT</camel-lsp-version>
Review Comment:
version 1.31.0 has been published with the required change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2791948979
> Needs [camel-tooling/camel-language-server#1266](https://github.com/camel-tooling/camel-language-server/pull/1266)
New release with the required change available https://repo1.maven.org/maven2/com/github/camel-tooling/camel-lsp-server/1.31.0/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add edit plugin [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2810322477
If I use `cltr + g` to get help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "johnpoth (via GitHub)" <gi...@apache.org>.
johnpoth commented on code in PR #17704:
URL: https://github.com/apache/camel/pull/17704#discussion_r2036949519
##########
parent/pom.xml:
##########
@@ -90,6 +90,7 @@
<caffeine-version>3.2.0</caffeine-version>
<californium-version>3.14.0</californium-version>
<californium-scandium-version>3.11.0</californium-scandium-version>
+ <camel-lsp-version>1.30.0-SNAPSHOT</camel-lsp-version>
Review Comment:
Wow that was fast! Thank you so much @apupier !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2789626202
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
* You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
* :warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add edit plugin [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2810316388
How does the you see the popup with the suggestions - do you press. ctrl + space or what ?
I get this error
```
~/workspace/deleteme ❯ camel edit bar.java 17s
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:209)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
at java.base/java.nio.file.Path.resolve(Path.java:515)
at org.apache.camel.dsl.jbang.core.commands.edit.CamelNanoLspEditor$Buffer.<init>(CamelNanoLspEditor.java:259)
at org.apache.camel.dsl.jbang.core.commands.edit.CamelNanoLspEditor.help(CamelNanoLspEditor.java:2553)
at org.apache.camel.dsl.jbang.core.commands.edit.CamelNanoLspEditor.run(CamelNanoLspEditor.java:1953)
at org.apache.camel.dsl.jbang.core.commands.edit.EditCommand.doCall(EditCommand.java:57)
at org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
at org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:37)
at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
at picocli.CommandLine.execute(CommandLine.java:2174)
at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:196)
at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:72)
at main.CamelJBang.main(CamelJBang.java:36)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add edit plugin [camel]
Posted by "johnpoth (via GitHub)" <gi...@apache.org>.
johnpoth commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2809575853
@davsclaus thanks for the review! All good on my side
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "johnpoth (via GitHub)" <gi...@apache.org>.
johnpoth commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2801663457
Yeah yaml and properties file should work:

For YAML the file has to end in _camel.yaml_ or _camel.yml_ [though](https://github.com/camel-tooling/camel-language-server/blob/main/src/main/java/com/github/cameltooling/lsp/internal/parser/ParserFileHelperFactory.java#L62) (camel-language-server).
Let's add it as a plugin. We can then later trim the dependencies as the server stuff isn't needed. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21945 camel-jbang: add LSP to Nano editor [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #17704:
URL: https://github.com/apache/camel/pull/17704#issuecomment-2796470294
It would be a bit heavy to have all these dependencies in the core camel-jbang command. So I think it may be a good idea to move this into a new seperate plugin like we have for kubernetes etc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org