Skip to content

Commit 99874da

Browse files
2ynnsmile13241324
authored andcommitted
Deprecate company-elm backend in elm layer
1 parent 4cbf9e1 commit 99874da

File tree

5 files changed

+20
-54
lines changed

5 files changed

+20
-54
lines changed

CHANGELOG.develop

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ the [[file:CHANGELOG.org][CHANGELOG.org]] file.
7979
Andriy Kmit)
8080
- Add support for background transparency aka true transparency. Key bindings are under ~SPC T B~ (thanks to JoshTRN)
8181
- Binding the ~SPC f d~ for deleting current buffer and file (thanks to Lin Sun)
82+
- Deprecate =company-elm= backend in =elm= layer (thanks to Qynn Schwaab)
8283
*** Breaking Changes
8384
**** Major
8485
- Support for Emacs 25 or Emacs 26 has been dropped, the minimal Emacs version

layers/+lang/elm/README.org

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
- [[#elm-format][elm-format]]
1717
- [[#elm-test][elm-test]]
1818
- [[#configuration][Configuration]]
19-
- [[#choosing-a-backend][Choosing a backend]]
20-
- [[#company-elm][Company-elm]]
21-
- [[#elm-oracle][elm-oracle]]
19+
- [[#backend][Backend]]
2220
- [[#lsp][LSP]]
21+
- [[#none][None]]
2322
- [[#basic-usage-tips][Basic usage tips]]
2423
- [[#compilation][Compilation]]
2524
- [[#reactor][Reactor]]
@@ -35,7 +34,6 @@
3534
- [[#elm-test-runner][elm-test-runner]]
3635
- [[#elm-package][elm-package]]
3736
- [[#package-list-buffer][package list buffer]]
38-
- [[#elm-oracle-1][elm-oracle]]
3937
- [[#elm-format-1][elm-format]]
4038
- [[#refactoring][Refactoring]]
4139

@@ -126,37 +124,10 @@ To install =elm-test= run below command:
126124
All layer configurations can be done by setting layer variables in your dotfile.
127125
No custom user config lines are necessary
128126

129-
** Choosing a backend
130-
This layer provides two alternative backends to choose from.
131-
132-
*** Company-elm
133-
This is the default choice if nothing is set and no lsp layer
134-
is loaded in your dotfile. This mode only provides very
135-
limited IDE capabilities. Used best if only small programs
136-
are edited. To set explicitly set the following in your
137-
dotfile:
138-
139-
#+BEGIN_SRC emacs-lisp
140-
(elm :variables elm-backend 'company-elm)
141-
#+END_SRC
142-
143-
**** elm-oracle
144-
=elm-oracle= can be used to show type signatures and docs for tokens under the
145-
cursor and provide support for auto-completion, but it is not part of the
146-
standard elm-platform.
147-
148-
Both the "company" and "auto-complete" backends are supported, but this layer
149-
is configured with company.
150-
151-
To install =elm-oracle=, install =node.js= and =npm=, then
152-
run this command:
153-
154-
#+BEGIN_SRC sh
155-
npm install -g elm-oracle
156-
#+END_SRC
127+
** Backend
157128

158129
*** LSP
159-
For proper IDE support this backend should be used. It is
130+
For proper IDE support the =lsp= backend should be used. It is
160131
based on an external server which will be started automatically
161132
by emacs, once an elm file is opened. The key bindings are
162133
the same for all lsp modes so if you are already familiar with
@@ -182,6 +153,14 @@ LSP layer. Also it is advisable to have a look
182153
at the autocomplete layer for an optimal
183154
intellisense config for LSP.
184155

156+
*** None
157+
If the =lsp= layer is loaded in your dotfile and nothing is set for =elm-backend=, =lsp= will be
158+
automatically selected. To explicitly disable the =lsp= backend set the following in your dotfile:
159+
#+BEGIN_SRC emacs-lisp
160+
(elm :variables elm-backend nil)
161+
#+END_SRC
162+
163+
185164
* Basic usage tips
186165
** Compilation
187166
To control the name of the compiled JavaScript file, use ~SPC m c B~ instead of
@@ -304,13 +283,6 @@ using a =dir-locals.el= file.
304283
| ~x~ | elm-package-install |
305284
| ~q~ | quit-window |
306285

307-
** elm-oracle
308-
309-
| Key binding | Description |
310-
|-------------+--------------------------|
311-
| ~SPC m h h~ | elm-oracle-doc-at-point |
312-
| ~SPC m h t~ | elm-oracle-type-at-point |
313-
314286
** elm-format
315287

316288
| Key binding | Description |

layers/+lang/elm/config.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
(spacemacs|define-jump-handlers elm-mode)
2727

28-
(defvar elm-backend (if (configuration-layer/layer-used-p 'lsp) 'lsp 'company-elm)
28+
(defvar elm-backend (if (configuration-layer/layer-used-p 'lsp) 'lsp nil)
2929
"The backend to use for IDE features.
30-
Possible values are `lsp' and `company-elm'.
31-
If `nil' then 'company-elm` is the default backend unless `lsp' layer is used")
30+
Possible values are `lsp' or `nil'.
31+
Default is `nil' unless `lsp' layer is used")

layers/+lang/elm/funcs.el

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,12 @@
2929
:backends company-capf ;; standard backends as well
3030
:modes elm-mode))
3131
('company-elm
32-
(spacemacs|add-company-backends
33-
:backends elm-company
34-
:modes elm-mode))))
32+
(message "Warning: `company-elm' backend is no longer supported for `elm' layer, use `lsp' instead."))))
3533

3634
(defun spacemacs//elm-setup-backend ()
3735
"Conditionally setup elm backend."
3836
(spacemacs/init-elm-mode)
39-
(pcase elm-backend
40-
('lsp (lsp-deferred))
41-
('company-elm (elm-oracle-setup-completion))))
37+
(when (eq elm-backend 'lsp) (lsp-deferred)))
4238

4339

4440
;; elm-mode

layers/+lang/elm/packages.el

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,10 @@
5353
(add-hook 'elm-mode-hook 'spacemacs//elm-setup-backend)
5454
:config
5555
;; Bind non-lsp keys
56-
(when (eq elm-backend 'company-elm)
56+
(when (not (eq elm-backend 'lsp))
5757
(spacemacs/set-leader-keys-for-major-mode 'elm-mode
5858
;; format
59-
"=b" 'elm-format-buffer
60-
;; oracle
61-
"hh" 'elm-oracle-doc-at-point
62-
"ht" 'elm-oracle-type-at-point)
59+
"=b" 'elm-format-buffer)
6360

6461
;; Bind prefixes
6562
(dolist (x '(("m=" . "format")

0 commit comments

Comments
 (0)