camel-tooling / camel-language-server

The Apache Camel LSP server implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Central GitHub tag Main branch CI Sonar License Chat on Zulip

camel-language-server

camel-language-server is a server implementation that provides Camel DSL smartness. The server adheres to the language server protocol and can be used with any editor that supports the protocol. The server utilizes Apache Camel.

Clients

These clients are available:

Tutorial with manual configuration is provided for:

Help is welcome to provide more client implementations and tutorials. You can pick from this list.

Features

Code completion for Camel URI

  • Completion for Camel components Completion for Camel components
  • Completion for Camel attributes Completion for Camel attributes
  • Completion for Camel attributes value Completion for Camel attributes value

Hover on Camel URI

On hover, the documentation of the Camel component is available. Hover on Camel components

Diagnostics (a.k.a. Validation) on Camel URI

On save, diagnostics on Camel URIs are updated: Diagnostic on Camel URI

Camel K modeline support

  • Completion for:
    • option names
    • trait definition names
    • trait property names
    • Camel artifact id for dependency
    • mvn dependency
    • Camel component properties
    • resource-like properties (resource, open-api, property-file). It is providing relevant sibling files filtering out some IDEs configuration folders (.vscode, .settings, .theia).

WebSocket support

Connection through WebSocket is supported. The server needs to be launched with --websocket option.

The following extra parameters can be used:

  • --port=<port>, default value is 8025
  • --hostname=<hostname>, default value localhost
  • --contextPath=<contextPath>, default value /. It must start with a /.

Then, the connection can be made through ws://<hostname>:<port><contextPath>/camel-language-server.

For information, with all defaults, it is ws://localhost:8025/camel-language-server.

Specific version of Camel catalog

It is possible to specify a specific version of the Camel catalog. This can be provided as Initialization Option or Workspace Configuration. The format is the same for both:

{
	"camel": {
		"Camel catalog version" : ...
	}
}

Please note that the first time a version is used, it can take several seconds/minutes to have it available depending on the time to download the dependencies in the background.

When using a Red Hat productized version which contains redhat in the version, the Maven Red Hat repository is automatically added.

To use other versions not available on Maven Central, additional repositories need to be configured on the host running the Camel Language Server. To configure it, follow these steps:

For more information, check the Grape official documentation.

Specific runtime provider of Camel catalog

It is possible to specify a specific runtime provider of the Camel catalog. This can be provided as Initialization Option or Workspace Configuration. The format is the same for both:

{
	"camel": {
		"Camel catalog runtime provider" : ...
	}
}

Currently supported providers can be found in CamelRuntimeProvider enum.

Additional Camel components

It is possible to specify a list of additional Camel components. This can be provided as Initialization Option or Workspace Configuration. The format is the same for both:

{
	"camel": {
		"extra-components" : [
			...
		]
	}
}

Document symbol support

There is document symbol for Camel Contexts and routes, on XML and Java DSL. In UI, for instance with VS Code, it means there are an outline, a breadcrumb and a Go To Document Symbol command.

Outline Go to Symbol Breadcrumb

Connected mode completion for Kafka component

When using the Camel Kafka component, the list of topics is dynamically retrieved from the Kafka Broker when available. By default, it tries to connect to localhost:9092. To connect to another instance, a setting can be provided, following this pattern:

{
	"camel": {
		"Kafka Connection URL" : "localhost:9092"
	}
}

Features planned

  • As you type reporting of parsing and compilation errors
  • More advanced Code completion
  • Code outline
  • Code navigation
  • Code lens (references)
  • Highlights
  • Code formatting

Feedback

License

ASL 2.0, See LICENSE file.

About

The Apache Camel LSP server implementation

License:Apache License 2.0


Languages

Language:Java 99.9%Language:Kotlin 0.1%Language:Groovy 0.0%Language:JavaScript 0.0%