From d2aa2443c2316fa8e358142fcb50d715d4a11a36 Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Wed, 2 Oct 2019 10:29:11 +0300 Subject: [PATCH] lang/scala: replace ensime with metals Ensime just went missing from everywhere. On [[ensime.github.io]], they encourage to switch to metals - a new Scala language server already supported by lsp-mode. This commit: - removes ensime completely - adds a doctor.el to check for metals-emacs binary Original issue: https://discordapp.com/channels/406534637242810369/406554085794381833/628809956103028747 Metals: https://scalameta.org/metals/docs/editors/emacs.html --- modules/lang/scala/config.el | 17 ----------------- modules/lang/scala/doctor.el | 9 +++++++++ modules/lang/scala/packages.el | 6 ------ 3 files changed, 9 insertions(+), 23 deletions(-) create mode 100644 modules/lang/scala/doctor.el diff --git a/modules/lang/scala/config.el b/modules/lang/scala/config.el index e14ef20bc..0fdfb7c87 100644 --- a/modules/lang/scala/config.el +++ b/modules/lang/scala/config.el @@ -15,23 +15,6 @@ (add-hook 'scala-mode-local-vars-hook #'lsp!))) -(use-package! ensime - :unless (featurep! +lsp) - :defer t - :config - (setq ensime-startup-snapshot-notification nil - ensime-startup-notification nil - ensime-eldoc-hints 'all - ;; let DOOM handle company setup - ensime-completion-style nil) - - (set-company-backend! 'scala-mode '(ensime-company company-yasnippet)) - - ;; Fix void-variable imenu-auto-rescan error caused by `ensime--setup-imenu' - ;; trying to make imenu variables buffer local before imenu is loaded. - (require 'imenu)) - - (use-package! sbt-mode :after scala-mode :config (set-repl-handler! 'scala-mode #'+scala/open-repl)) diff --git a/modules/lang/scala/doctor.el b/modules/lang/scala/doctor.el new file mode 100644 index 000000000..06a62720f --- /dev/null +++ b/modules/lang/scala/doctor.el @@ -0,0 +1,9 @@ +;;; lang/scala/doctor.el -*- lexical-binding: t; -*- + +(assert! (or (not (featurep! +lsp)) + (featurep! :tools lsp)) + "This module requires (:tools lsp)") + +(if (and (featurep! +lsp) + (not (executable-find "metals-emacs"))) + (warn! "metals-emacs isn't installed")) diff --git a/modules/lang/scala/packages.el b/modules/lang/scala/packages.el index 93c1f879e..8a331c698 100644 --- a/modules/lang/scala/packages.el +++ b/modules/lang/scala/packages.el @@ -3,9 +3,3 @@ (package! sbt-mode) (package! scala-mode) - -(unless (featurep! +lsp) - ;; Fix #1697: Ensime doesn't have a master branch and its MELPA recipe doesn't - ;; specify a branch. Straight can't handle packages with non-standard primary - ;; branches (at the time of writing), so we must specify it manually: - (package! ensime :recipe (:branch "2.0")))