languageserver


License

License

Categories

Categories

Languages
GroupId

GroupId

com.github.dragos
ArtifactId

ArtifactId

languageserver_2.12
Last Version

Last Version

0.2.3
Release Date

Release Date

Type

Type

jar
Description

Description

languageserver
languageserver
Project URL

Project URL

https://github.com/dragos/dragos-vscode-scala/
Project Organization

Project Organization

com.github.dragos
Source Code Management

Source Code Management

https://github.com/dragos/dragos-vscode-scala

Download languageserver_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.dragos/languageserver_2.12/ -->
<dependency>
    <groupId>com.github.dragos</groupId>
    <artifactId>languageserver_2.12</artifactId>
    <version>0.2.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.dragos/languageserver_2.12/
implementation 'com.github.dragos:languageserver_2.12:0.2.3'
// https://jarcasting.com/artifacts/com.github.dragos/languageserver_2.12/
implementation ("com.github.dragos:languageserver_2.12:0.2.3")
'com.github.dragos:languageserver_2.12:jar:0.2.3'
<dependency org="com.github.dragos" name="languageserver_2.12" rev="0.2.3">
  <artifact name="languageserver_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.dragos', module='languageserver_2.12', version='0.2.3')
)
libraryDependencies += "com.github.dragos" % "languageserver_2.12" % "0.2.3"
[com.github.dragos/languageserver_2.12 "0.2.3"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.3
com.dhpcs » scala-json-rpc_2.12 jar 2.0.1
com.typesafe.scala-logging : scala-logging_2.12 jar 3.7.2
org.slf4j : slf4j-api jar 1.7.21
ch.qos.logback : logback-classic jar 1.1.7
org.codehaus.groovy : groovy jar 2.4.0

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.1

Project Modules

There are no modules declared in this project.

Build Status Hydra

Scala language server for VS Code

demo

This is an experiment for building a Language Server for Scala, in Scala. Note: Only works with Scala 2.12.x.

  • language server: A Scala-based implementation of the language server protocol
  • scala: A Typescript-based Scala extension (language client). Ideally it will be ported to Scala.js
  • ensime-lsp: An implementation of the Language Server based on Ensime

The language server may be backed up by ensime or directly by the presentation compiler. Ideally, the language server can be used as a basis for implementing support for any language, not just Scala.

How to try it out

UPDATE: The extension is published to Marketplace. You can still use the instructions below to start contributing.

Download an existing release and install it in Code by choosing Install from VSIX in the Extensions view.

Make sure you have an existing .ensime file before starting code in that directory (sbt ensimeConfig should create it if you have sbt-ensime already setup)

What works

  • errors as you type
  • code completion
  • goto definition (F12 and CMD-F12)
  • hover
  • file structure (definitions)

Building

tl;dr

$ sbt publishLocal
$ cd scala
$ npm install # only the first time, to download dependencies
$ npm install -g vsce typescript # if you don't have Typescript installed globally
$ vsce package

You should see a file scala-lsp-x.x.x.vsix (x.x.x representing the version you are building). Now install it in Code by choosing Install from VSIX in the Extensions view.

The root Sbt project controls all the Scala parts of the build. The client is written in Typescript (it's really minimal) and lives under scala/. This one is built using Code's tools.

  • languageserver/ contains the language-independent server implementation. It does not implement the full protocol yet. Features are added by-need, when the reference implementation in ensime-lsp/ needs it
  • ensime-lsp/ implements an Ensime based Scala language server
  • scala/ The typescript extension (eventually should migrate to Scala.js)

ensime-lsp is what you will want to build most of the times. It's launched with coursier by the client, for it to be as simply as possible.

You should use sbt publishLocal which publishes the server under ~/.ivy2/local, so the client finds it easily.

Running

You can open code inside the scala/ directory and use F5 to debug the extension. This picks up the changes in the server (make sure you published it locally using sbt publishLocal!) and allows quick iteration.

Publish

> publishSigned
> sonatypeRelease

Then cd scala/ and run vsce publish

Versions

Version
0.2.3
0.2.1
0.2.0