Skip to content

Commit d33c2b2

Browse files
committed
Add more information on Emacs related configuration and usage
1 parent ecdfc5f commit d33c2b2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

EDITORS.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,27 @@ See [atom-ide-kotlin](https://github.com/fwcd/atom-ide-kotlin).
99
## Emacs
1010
_using [`lsp-mode`](https://github.com/emacs-lsp/lsp-mode)_
1111

12-
Add the language server executable to your `PATH`.
12+
There are two ways of setting up the language server with `lsp-mode`:
13+
- Add the language server executable to your `PATH`. This is useful for development and for always using the latest version from the `main`-branch.
14+
- Let `lsp-mode` download the server for you (`kotlin-ls`). This will use [the latest release](https://github.com/fwcd/kotlin-language-server/releases/latest).
15+
16+
17+
### Run/debug code lenses
18+
If you use [dap-mode](https://github.com/emacs-lsp/dap-mode), you can set `(setq lsp-kotlin-debug-adapter-enabled t)` to enable the debug adapter. You will need to have [Kotlin Debug Adapter](https://github.com/fwcd/kotlin-debug-adapter) on your system. A simple configuration of `dap-mode` for Kotlin may look like:
19+
```emacs-lisp
20+
(require 'dap-kotlin)
21+
(setq lsp-kotlin-debug-adapter-enabled t)
22+
;; replace the path below to the path to your Kotlin Debug Adapter
23+
(setq lsp-kotlin-debug-adapter-path "/path/to/kotlin-debug-adapter")
24+
```
25+
26+
Then you can activate `lsp-kotlin-lens-mode` to see the Run/Debug code lenses at your main-functions.
27+
28+
29+
### Override members (e.g, toString and equals)
30+
The language server provides a custom protocol extension for finding overridable members of a class (variables and methods). `lsp-mode` provides a function that uses this called `lsp-kotlin-implement-member`. You can run it while hovering a class name, and you will get a menu with all available overridable members. (protip: Bind this function to a key!). If you have [Helm](https://github.com/emacs-helm/helm) or [Ivy](https://github.com/abo-abo/swiper) installed, one of them will be utilized.
31+
32+
1333

1434
## Vim
1535
_using [`LanguageClient-neovim`](https://github.com/autozimu/LanguageClient-neovim)_

0 commit comments

Comments
 (0)