Giter Club home page Giter Club logo

scala-lsp's Introduction

scala-lsp layer

img/scala.png with img/scalameta.png

Table of Contents

Description

Scala layer for Spacemacs, using lsp instead of ensime, based on the original Scala layer and this pull request https://github.com/syl20bnr/spacemacs/pull/12234/files.

This layer does wonderful things:

  • there is no dependency of ensime, instead we use Metals with language server protocol (lsp)

Install

First make sure you have the latest version of metals-emacs, as of 2019-07-10, the latest version can be built using the following commands:

# Make sure to use coursier v1.1.0-M9 or newer.
curl -L -o coursier https://git.io/coursier
chmod +x coursier
./coursier bootstrap \
  --java-opt -Xss4m \
  --java-opt -Xms100m \
  --java-opt -Dmetals.client=emacs \
  org.scalameta:metals_2.12:0.7.0 \
  -r bintray:scalacenter/releases \
  -r sonatype:snapshots \
  -o /usr/local/bin/metals-emacs -f

Now, you have to clone the repository in your `~/.emacs.d/private` folder, and then add `scala-lsp` into existing dotspacemacs-configuration-layers list in ~/.spacemacs file.

dotspacemacs-configuration-layers
'(
  ....
  scala-lsp)

I also recommend to add this settings into your Spacemacs config to enable auto completion.

(setq company-lsp-async t)
;; Hack to make sure 'company-lsp is only pushed after company package is loaded
(use-package company
 :config
 (push 'company-lsp company-backends))

Key bindings

See http://develop.spacemacs.org/layers/+tools/lsp/README.html#key-bindings

scala-lsp's People

Contributors

zheli avatar

Stargazers

王翔(Shawn Wang) avatar Anup Agarwal avatar Ty avatar Federico Bartolomei avatar Youngjae Chang avatar Nacho Cordón avatar Phoebe avatar Jinyuan avatar Ryan Tomczik avatar Markus Hettich avatar Amit Mhatre avatar Guillaume Bogard avatar Tom Wadeson avatar Leway Colin avatar Nikhil avatar Octav Zaharia avatar Hongchao Liu avatar

Watchers

 avatar James Cloos avatar  avatar

scala-lsp's Issues

Install instructions not working

I was trying to install this layer on my Spacemacs (0.300.0, develop branch, on Emacs 26.2).

Following the instructions, adding this to my .spacemacs, in dotspacemacs-configuration-layers:

(scala-lsp :location
          (recipe :fetcher github
                  :repo "zheli/layer-scala-lsp"))

gives me this warning on restart (or reload):

Warning: Unknown layer scala-lsp declared in dotfile.

Reading this issue on Spacemacs, it looks like external layers are not supported. Maybe the instructions mean to put the layer in dotspacemacs-additional-packages? I know for a fact that Github recipes work there ...

Completion add types

When using the completion, instead of simply adding the name of the function/variable/... it also adds types.

Example: When using completion (via the tab key) for this snippet

def test = help_str.to

I get this result:

def test = help_str.toString(): String

instead of something like that:

def test = help_str.toString

Dot completion

Hi,

thanks for the layer btw. I got it working and it shows function arguments etc.
But I miss dot completion, does this work on your system?
(with "dot completion" I mean accessing available fields/methods of an object like myObj.head)

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.