Skip to content

Commit 6450236

Browse files
committed
Updated lsp-java readme to include dap-mode setup in quick guide
1 parent 17f80c9 commit 6450236

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Then add the following lines to your `.emacs` and open a file from the any of th
4646
[lsp-java](https://github.com/emacs-lsp/lsp-java) will automatically detect when the server is missing and it will download [Eclipse JDT Language Server](https://projects.eclipse.org/projects/eclipse.jdt.ls) before the first startup. The server installation will be in `lsp-java-server-install-dir`. It will detect whether [dap-mode](https://github.com/yyoncho/dap-mode/) is present and it will download the required server side plugins/components. If you want to update the server you can run `lsp-java-update-server`. To run specific version of [Eclipse JDT Language Server](https://projects.eclipse.org/projects/eclipse.jdt.ls) use `lsp-java-server-install-dir`.
4747

4848
#### Quick start
49-
Minimal configuration with [company-lsp](https://github.com/tigersoldier/company-lsp) and [lsp-ui](https://github.com/emacs-lsp/lsp-ui). Make sure you have replaced the XXX placeholder with the list of the projects you want to import.
49+
Minimal configuration with [company-lsp](https://github.com/tigersoldier/company-lsp) and [lsp-ui](https://github.com/emacs-lsp/lsp-ui) and [dap-mode](https://github.com/yyoncho/dap-mode/). Make sure you have replaced the XXX placeholder with the list of the projects you want to import. Now you can explore the methods under `lsp-java-*`, `dap-java-*`, `dap-*`, and `lsp-*`
5050
```elisp
5151
(require 'cc-mode)
5252
@@ -62,27 +62,31 @@ Minimal configuration with [company-lsp](https://github.com/tigersoldier/company
6262
6363
(use-package lsp-mode
6464
:ensure t
65-
:init (setq lsp-inhibit-message nil ; you may set this to t to hide messages from message area
66-
lsp-eldoc-render-all nil
65+
:init (setq lsp-eldoc-render-all nil
6766
lsp-highlight-symbol-at-point nil))
6867
6968
(use-package company-lsp
7069
:after company
7170
:ensure t
7271
:config
7372
(add-hook 'java-mode-hook (lambda () (push 'company-lsp company-backends)))
74-
(setq company-lsp-enable-snippet t
75-
company-lsp-cache-candidates t)
73+
(setq company-lsp-cache-candidates t)
7674
(push 'java-mode company-global-modes))
7775
7876
(use-package lsp-ui
7977
:ensure t
8078
:config
81-
(setq lsp-ui-sideline-enable t
82-
lsp-ui-sideline-show-symbol t
83-
lsp-ui-sideline-show-hover t
84-
lsp-ui-sideline-show-code-actions t
85-
lsp-ui-sideline-update-mode 'point))
79+
(setq lsp-ui-sideline-update-mode 'point))
80+
81+
(use-package dap-mode
82+
:ensure t
83+
:after lsp-mode
84+
:config
85+
(dap-mode t)
86+
(dap-ui-mode t))
87+
88+
(use-package dap-java
89+
:after 'lsp-java)
8690
8791
(use-package lsp-java
8892
:ensure t
@@ -92,7 +96,7 @@ Minimal configuration with [company-lsp](https://github.com/tigersoldier/company
9296
(add-hook 'java-mode-hook 'flycheck-mode)
9397
(add-hook 'java-mode-hook 'company-mode)
9498
(add-hook 'java-mode-hook (lambda () (lsp-ui-flycheck-enable t)))
95-
(add-hook 'java-mode-hook 'lsp-ui-sideline-mode)
99+
(add-hook 'java-mode-hook 'lsp-ui-mode)
96100
(setq lsp-java--workspace-folders (list (error "XXX Specify your projects here"))))
97101
```
98102
## Supported commands

0 commit comments

Comments
 (0)