Skip to content

Commit 5cd278c

Browse files
committed
Update doc
- add newly implemented operations to the doc - add link to dap-mode for debugging/running tests
1 parent b985145 commit 5cd278c

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ LSP java mode supports the following JDT Features:
1616
* Code formatting
1717
* Maven pom.xml project support
1818
* Limited Gradle support
19+
* Visual debugger via [dap-mode](https://github.com/yyoncho/dap-mode/)
20+
* Test runner [dap-mode](https://github.com/yyoncho/dap-mode/)
1921

2022
## Installation
2123
### Install [Eclipse JDT Language Server](https://projects.eclipse.org/projects/eclipse.jdt.ls)
@@ -109,6 +111,7 @@ Minimal configuration with [company-lsp](https://github.com/tigersoldier/company
109111
| lsp-execute-code-action | Execute code action. |
110112
| lsp-rename | Rename symbol at point |
111113
| lsp-describe-thing-at-point | Display help for the thing at point. |
114+
| lsp-goto-type-definition | Go to type definition |
112115
| lsp-workspace-restart | Restart project |
113116
| lsp-format-buffer | Format current buffer |
114117
| lsp-symbol-highlight | Highlight all relevant references to the symbol under point. |

lsp-java.el

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,49 +26,42 @@
2626
(require 'markdown-mode)
2727
(require 'lsp-methods)
2828

29-
;;;###autoload
3029
(defgroup lsp-java nil
3130
"JDT emacs frontend."
3231
:prefix "lsp-java-"
3332
:group 'applications
3433
:link '(url-link :tag "GitHub" "https://github.com/emacs-lisp/lsp-java"))
3534

36-
;;;###autoload
3735
(defcustom lsp-java-server-install-dir (locate-user-emacs-file "eclipse.jdt.ls/server/")
3836
"Install directory for eclipse.jdt.ls-server.
3937
The slash is expected at the end."
4038
:group 'lsp-java
4139
:risky t
4240
:type 'directory)
4341

44-
;;;###autoload
4542
(defcustom lsp-java-java-path "java"
4643
"Path of the java executable."
4744
:group 'lsp-java
4845
:type 'string)
4946

50-
;;;###autoload
5147
(defcustom lsp-java-workspace-dir (expand-file-name (locate-user-emacs-file "workspace/"))
5248
"LSP java workspace directory."
5349
:group 'lsp-java
5450
:risky t
5551
:type 'directory)
5652

57-
;;;###autoload
5853
(defcustom lsp-java-workspace-cache-dir (expand-file-name (locate-user-emacs-file "workspace/.cache/"))
5954
"LSP java workspace cache directory."
6055
:group 'lsp-java
6156
:risky t
6257
:type 'directory)
6358

64-
;;;###autoload
6559
(defcustom lsp-java--workspace-folders ()
6660
"LSP java workspace folders storing files downloaded from JDT."
6761
:group 'lsp-java
6862
:risky t
6963
:type '(repeat directory))
7064

71-
;;;###autoload
7265
(defcustom lsp-java-vmargs '("-noverify" "-Xmx1G" "-XX:+UseG1GC" "-XX:+UseStringDeduplication")
7366
"Specifies extra VM arguments used to launch the Java Language Server.
7467
@@ -80,7 +73,6 @@ deduplication with the G1 Garbage collector"
8073
:risky t
8174
:type '(repeat string))
8275

83-
;;;###autoload
8476
(defcustom lsp-java-incomplete-classpath 'warning
8577
"Specifies the severity of the message when the classpath is incomplete for a Java file."
8678
:group 'lsp-java
@@ -89,7 +81,6 @@ deduplication with the G1 Garbage collector"
8981
(const warning)
9082
(const error)))
9183

92-
;;;###autoload
9384
(defcustom lsp-java-update-build-configuration 'automatic
9485
"Specifies how modifications on build files update the Java classpath/configuration."
9586
:group 'lsp-java
@@ -98,7 +89,6 @@ deduplication with the G1 Garbage collector"
9889
(const interactive)
9990
(const automatic)))
10091

101-
;;;###autoload
10292
(defcustom lsp-java-import-exclusions '("**/node_modules/**"
10393
"**/.metadata/**"
10494
"**/archetype-resources/**"
@@ -107,7 +97,6 @@ deduplication with the G1 Garbage collector"
10797
:group 'lsp-java
10898
:type '(repeat string))
10999

110-
;;;###autoload
111100
(defcustom lsp-java-favorite-static-members
112101
'("org.junit.Assert.*"
113102
"org.junit.Assume.*"
@@ -122,7 +111,6 @@ deduplication with the G1 Garbage collector"
122111
:group 'lsp-java
123112
:type '(repeat string))
124113

125-
;;;###autoload
126114
(defcustom lsp-java-import-order
127115
'("java" "javax" "com" "org")
128116
"Defines the sorting order of import statements.
@@ -131,7 +119,6 @@ A package or type name prefix (e.g. 'org.eclipse') is a valid entry. An import i
131119
:group 'lsp-java
132120
:type '(repeat string))
133121

134-
;;;###autoload
135122
(defcustom lsp-java-trace-server 'off
136123
"Traces the communication between Emacs and the Java language server."
137124
:group 'lsp-java
@@ -140,79 +127,66 @@ A package or type name prefix (e.g. 'org.eclipse') is a valid entry. An import i
140127
(const messages)
141128
(const verbose)))
142129

143-
;;;###autoload
144130
(defcustom lsp-java-enable-file-watch nil
145131
"Defines whether the client will monitor the files for changes."
146132
:group 'lsp-java
147133
:type 'boolean)
148134

149-
;;;###autoload
150135
(defcustom lsp-java-format-enabled t
151136
"Specifies whether or not formatting is enabled on the language server."
152137
:group 'lsp-java
153138
:type 'boolean)
154139

155-
;;;###autoload
156140
(defcustom lsp-java-format-settings-url nil
157141
"Specifies the file path to the formatter xml url."
158142
:group 'lsp-java
159143
:type 'string)
160144

161-
;;;###autoload
162145
(defcustom lsp-java-format-settings-profile nil
163146
"Specifies the formatter profile name."
164147
:group 'lsp-java
165148
:type 'string)
166149

167-
;;;###autoload
168150
(defcustom lsp-java-format-comments-enabled nil
169151
"Preference key used to include the comments during the formatting."
170152
:group 'lsp-java
171153
:type 'boolean)
172154

173-
;;;###autoload
174155
(defcustom lsp-java-save-action-organize-imports t
175156
"Organize imports on save."
176157
:group 'lsp-java
177158
:type 'boolean)
178159

179-
;;;###autoload
180160
(defcustom lsp-java-organize-imports t
181161
"Specifies whether or not organize imports is enabled as a save action."
182162
:group 'lsp-java
183163
:type 'boolean)
184164

185-
;;;###autoload
186165
(defcustom lsp-java-bundles nil
187166
"List of bundles that will be loaded in the JDT server."
188167
:group 'lsp-java
189168
:type 'list)
190169

191-
;;;###autoload
192170
(defcustom lsp-java-import-gradle-enabled t
193171
"Enable/disable the Gradle importer."
194172
:group 'lsp-java
195173
:type 'boolean)
196174

197-
;;;###autoload
198175
(defcustom lsp-java-import-maven-enabled t
199176
"Enable/disable the Maven importer."
200177
:group 'lsp-java
201178
:type 'boolean)
202179

203-
;;;###autoload
204180
(defcustom lsp-java-auto-build t
205181
"Enable/disable the 'auto build'."
206182
:group 'lsp-java
207183
:type 'boolean)
208184

209-
;;;###autoload
210185
(defcustom lsp-java-progress-report t
211186
"[Experimental] Enable/disable progress reports from background processes on the server."
212187
:group 'lsp-java
213188
:type 'boolean)
214189

215-
;;;###autoload
216190
(defcustom lsp-java-completion-guess-arguments nil
217191
"When set to true, method arguments are guessed when a method is selected from as list of code assist proposals."
218192
:group 'lsp-java
@@ -294,15 +268,13 @@ The entry point of the language server is in `lsp-java-server-install-dir'/plugi
294268
(message (format "using config for %s" config)))
295269
(expand-file-name config lsp-java-server-install-dir)))
296270

297-
;;;###autoload
298271
(defun lsp-java-organize-imports ()
299272
"Organize java imports."
300273
(interactive)
301274
(lsp--send-execute-command
302275
"java.edit.organizeImports"
303276
(list (lsp--path-to-uri buffer-file-name))))
304277

305-
;;;###autoload
306278
(defun lsp-java-build-project (&optional full)
307279
"Perform project build action.
308280
@@ -311,7 +283,6 @@ FULL specify whether full or incremental build will be performed."
311283
(lsp-send-notification
312284
(lsp-make-request "java/buildWorkspace" (if full t :json-false))))
313285

314-
;;;###autoload
315286
(defun lsp-java-update-project-configuration ()
316287
"Update project configuration."
317288
(interactive)
@@ -479,7 +450,6 @@ PARAMS progress report notification data."
479450
(insert uri))))
480451
file-location))
481452

482-
;;;###autoload
483453
(defun lsp-java-actionable-notifications ()
484454
"Lists current actionable notifications."
485455
(interactive)
@@ -496,7 +466,6 @@ PARAMS progress report notification data."
496466
(when (= (hash-table-count notifications) 0)
497467
(lsp-workspace-status (concat "::" (lsp-workspace-get-metadata "status"))))))
498468

499-
;;;###autoload
500469
(defun lsp-java-execute-matching-action (regexp &optional not-found-message)
501470
"Execute the code action which title match the REGEXP.
502471
NOT-FOUND-MESSAGE will be used if there is no matching action."
@@ -508,7 +477,6 @@ NOT-FOUND-MESSAGE will be used if there is no matching action."
508477
(1 (lsp-execute-code-action (car actions)))
509478
(t (lsp-execute-code-action (lsp--select-action actions))))))
510479

511-
;;;###autoload
512480
(defun lsp-java-extract-to-local-variable (arg)
513481
"Extract local variable refactoring.
514482
The prefix ARG and `cider-prompt-for-symbol' decide whether to
@@ -519,48 +487,42 @@ extract all or only the current occurrence."
519487
"Extract to local variable$"
520488
"Extract to local variable (replace all occurrences)")))
521489

522-
;;;###autoload
523490
(defun lsp-java-extract-to-constant ()
524491
"Extract constant refactoring."
525492
(interactive)
526493
(lsp-java-execute-matching-action "Extract to constant"))
527494

528-
;;;###autoload
529495
(defun lsp-java-add-unimplemented-methods ()
530496
"Extract constant refactoring."
531497
(interactive)
532498
(lsp-java-execute-matching-action "Add unimplemented methods"))
533499

534-
;;;###autoload
535500
(defun lsp-java-create-parameter ()
536501
"Create parameter refactoring."
537502
(interactive)
538503
(lsp-java-execute-matching-action "Create parameter '"))
539504

540-
;;;###autoload
541505
(defun lsp-java-create-field ()
542506
"Create field refactoring."
543507
(interactive)
544508
(lsp-java-execute-matching-action "Create field '"))
545509

546-
;;;###autoload
547510
(defun lsp-java-create-local ()
548511
"Create local refactoring."
549512
(interactive)
550513
(lsp-java-execute-matching-action "Create local variable"))
551514

552-
;;;###autoload
553515
(defun lsp-java-extract-method ()
554516
"Extract method refactoring."
555517
(interactive)
556518
(lsp-java-execute-matching-action "Extract to method"))
557519

558-
;;;###autoload
559520
(defun lsp-java-add-import ()
560521
"Add missing import."
561522
(interactive)
562523
(lsp-java-execute-matching-action "Import '.*'"))
563524

525+
;;;###autoload
564526
(lsp-define-stdio-client lsp-java "java" (lambda () lsp-java-workspace-dir)
565527
(lsp-java--ls-command)
566528
:ignore-regexps

0 commit comments

Comments
 (0)