dragos-vscode-scala

  • 所有者: dragos/dragos-vscode-scala
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者dragos/dragos-vscode-scala
主編程語言Scala
編程語言Scala (語言數: 3)
平台
許可證Other
所有者活动
創建於2016-08-08 10:54:45
推送於2023-06-08 08:19:57
最后一次提交2023-06-08 10:19:57
發布數14
最新版本名稱v0.2.3 (發布於 )
第一版名稱v0.0.2 (發布於 )
用户参与
星數251
關注者數12
派生數39
提交數168
已啟用問題?
問題數65
打開的問題數30
拉請求數30
打開的拉請求數1
關閉的拉請求數4
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?