Eclipse LSPHub

Primary tabs

Eclipse LSPHub defines a data model for a kind of ubiquitous plug-ins format for all editors/IDEs. It focuses on describing artifacts that implements platform/tools indenpendent language services like LSP.

The data model defines the concept of an Extension which is a logical group of Contributions. A contribution provides support for editing file of given types (typing is being made via UTI).

A TextMate grammar is an contribution. It provides syntax higlighting support for language. LSPHub stores the required metadata for a TextMate grammar to be used: the URI to the actual grammar file(s) and the "scopeName".

A language server is another contribution. It provides the features described by the LSP. However, as there is no uniform packaging format for language servers, LSPHub can not store metadata about it. LSPHub thus define a packaging format for language server in the form of a Docker image. A language server would then be built as a Docker image along with all its dependencies and LSPHub will store the Docker image information (imageName, repository where to find it, version, exposed ports, etc.) along with additional metadata about the language server itself: the RPC configuration (whether it uses pipes, TCP sockets, etc.), the command to start the language server inside the container... This provides an homogeneous format that could be reused by any editor/IDEs to start a language server.

The combination of a language server and a TextMate grammar contributions will make a Extension that will offer an advanced language support to a tool.  

LSPHub defines a REST API on top of this data model. Responses are in Json or XML format. Currently, it is only a prototype where extensions can be queried by the type of files they have contributions for, e.g.:

curl -i -X GET --header 'Accept: application/json' http://lsphub.eclipse.org/extensions?uti=public.php-script

will reply

HTTP/1.1 200 OK
Date: Tue, 11 Jul 2017 18:02:01 GMT
Content-Length: 1188
Server: Jetty(9.4.1.v20170120)

)]}'
[
  {
    "type": "http://www.eclipselabs.org/lsphub/model#Extension",
    "symbolicName": "org.eclipselabs.lsphub.phplang.support",
    "displayName": "PHP Support",
    "version": "1.0.0",
    "contributions": [
      {
        "type": "http://www.eclipselabs.org/lsphub/model#LanguageServerDockerImage",
        "symbolicName": "felixfbecker.php-language-server",
        "displayName": "PHP language server",
        "utis": [
          "public.php-script"
        ],
        "imageName": "mbarbero/phpls",
        "tag": "latest",
        "command": [
          "php",
          "vendor/felixfbecker/language-server/bin/php-language-server.php"
        ],
        "rpcConfigurations": [
          {
            "type": "http://www.eclipselabs.org/lsphub/model#PipeConfiguration"
          }
        ]
      },
      {
        "type": "http://www.eclipselabs.org/lsphub/model#TextMateGrammar",
        "symbolicName": "org.eclipselabs.php-tm-grammar",
        "displayName": "PHP TM Grammar",
        "utis": [
          "public.php-script"
        ],
        "grammarUris": [
          "http://uri.of.the.grammar"
        ],
        "scopeName": "source.php"
      }
    ]
  }
]