Coder Social home page Coder Social logo

camel-tooling / camel-language-server Goto Github PK

View Code? Open in Web Editor NEW
46.0 8.0 25.0 2.98 MB

The Apache Camel LSP server implementation

License: Apache License 2.0

Java 99.87% Groovy 0.05% Kotlin 0.05% JavaScript 0.03%
camel apache-camel lsp lsp-server camel-language-server lsp4j language-server-protocol language-server

camel-language-server's Introduction

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.

camel-language-server's People

Contributors

apupier avatar delawen avatar dependabot-preview[bot] avatar dependabot[bot] avatar djelinek avatar hdamarcelo avatar joshiraez avatar kapilgahlot1998 avatar lhein avatar tsedmik avatar unsortedhashsets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camel-language-server's Issues

Provide domain-specific completion

for some domains, some components are more used, it would be nice to provide built-in for different domain which will sort the completion proposal by providing first the domain-specific ones

Support additional catalogs

some catalogs are provided outside of Camel core, it will be a good idea to have a way to include them in the completion/validation/doc. it will help to focus on a specific vertical for instance.

Support incremental mode

currently, the whole file is sent on each request. to save bandwith and improve performance, it would be nice to support incremental update

On Completion, insert and replace when there is something after the cursor

for instance, there is "timer", I put the cursor after the t and choose twitter

current result is:
"twitter:kindimer"

expected result would be:
"twitter:kind"

same applies for options.

How to handle the remaining parts if more complex such as:
"timer:value?delay=1000"
if I autocomplete after the t with twitter:kind, what would be the result?
"twitter:kind"
"twitter:kind?delay=1000"
"twitter:value"

refactor maven gav

We are not allowed to use org.apache so we should rename the gav to org.cameltooling

Support different version of Camel

currently the compeltion is based on latest available version.

it would be nice to be able to specify which version to use in a first time and to read it from project in a second time (or to read it from xsd location if people are using strict modeling metamodel)

Provide support for JSonPath language

some attributes are JSonPath dataformat/language, it would be nice to be able to provide completion/validation for these fields

would be interesting to factorize code with Camel Idea plugin

Provide architecture documentation

to help contributor to jumpstart in the project:

  • point to LSP protocol
  • point to LSP4J which is the LSP Protocol implementation in Java used in the project
  • point to java Future documentation
  • define entry points
  • provide architecture schema

Provide completion while searching by tags for components

Camel components have tags which can help to search for a specific domain.
See a part of this list from a screenshot from Fuse Tooling:
image

while auto-completing, it migth be nice to search in categories too.

I imagine several possibilities:

  • "a -> ask for completion will return all components starting by a and after in the list all components which categories starts by a
  • have specific prefix that user need to use to search by category: a special character? # or | or what else? or a specific name such as "cat" or "category"?

refactor package names

new name should start with org.cameltooling as we are not allowed to use org.apache.*

Provide outline/DocumentSymbol for Camel routes

currently LSP4E (and more and more clients) is using DocumentSymbol to provide an outline.

As first iteration having just the list of routes can be nice
Then having them grouped by Camel context
then having also global endpoint
then... we will see at usage and open new enhancement request

Filter completion with already started text

for instance for now when we have:
<uri="|"> and <uri="time|">

the completion returned is exactly the same, it would nice that in second case, we return only the components starting with "time". (or maybe to put them on top and provide the other components after, so just changing the sort)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.