Commit graph

276 commits

Author SHA1 Message Date
Mathias Fussenegger
99e4b2081d Set empty diagnostics on code action params
Follow up to 6e99fc8076

The diagnostics are not nullable:

- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionContext
2024-08-05 20:59:41 +02:00
Vishal Mahajan
be5c8d49e0
Show Junit test failures as ERROR diagnostics (#665) 2024-08-01 16:27:48 +02:00
Mathias Fussenegger
6e99fc8076 Don't set line diagnostics for code action params
Not really needed for the cases where the code is triggered and it's
deprecated in neovim nightly
2024-08-01 16:12:21 +02:00
Mathias Fussenegger
6bfd159158 Relax client attach condition and allow any buftype again
Restricting buftype to "" broke support for opening .class files
2024-07-12 17:34:54 +02:00
Mathias Fussenegger
40e8494e04 Add dap configuration provider
Depends on https://github.com/mfussenegger/nvim-dap/pull/1237
2024-06-06 22:45:25 +02:00
Mathias Fussenegger
ad5ab1c924 Only attach to file or jdt:// buffers
Attaching to buffers like fugitive:// can result in errors
2024-05-30 15:16:15 +02:00
Mathias Fussenegger
10691312d5 Revert find_root change to link to fs.root
The jdtls variant returned absolute path to the working directory for
unnamed buffers. The fs.root version currently doesn't

(But will with https://github.com/neovim/neovim/pull/28964)

This reverts the change to use fs.root for now.
Closes https://github.com/mfussenegger/nvim-jdtls/issues/656
2024-05-24 17:14:10 +02:00
Mathias Fussenegger
29255ea26d Fix nvim-0.11 deprecation warnings 2024-05-16 17:05:21 +02:00
Mathias Fussenegger
8995b4056c Go through lsp.start in wipe_data_and_restart, to avoid double start 2024-05-16 16:49:23 +02:00
Mathias Fussenegger
8eb5f0dbe6 Use vm.location as fallback if java-debug/resolveJavaExecutable is missing
Fixes https://github.com/mfussenegger/nvim-jdtls/issues/630
2024-03-07 11:29:11 +01:00
Mathias Fussenegger
382b9f6258 Account for new client.settings in custom configuration handler
Assigning to `client.config.settings` no longer works due to:

  9f8c96240d

Because of that, jdtls actions that generate code reverted to using tabs
instead of spaces.
2024-02-21 12:20:06 +01:00
Mathias Fussenegger
81ead309b9 Mention dependency management in readme for nvim-dap 2024-02-18 12:41:43 +01:00
Mathias Fussenegger
01b57f75b0 Map JdtUpdateConfig to update_projects_config
Closes https://github.com/mfussenegger/nvim-jdtls/issues/623
2024-02-17 11:54:20 +01:00
Mathias Fussenegger
894c044034 Show nicer error if classpath resolve fails when debugging 2024-02-09 20:38:00 +01:00
Mathias Fussenegger
4f4de4d80e Ensure source.generate.* capabilities are always set
`tbl_deep_extend('keep', ...)` doesn't merge lists, and neovim already
sets some code action literals. This prevented hashCode/toString code
actions from showing up.
2024-01-31 20:54:21 +01:00
Mathias Fussenegger
66b5ace68a Support whitespace in default value for change signature refactoring 2023-11-28 20:44:42 +01:00
Joao Sa
44403b2ef6 Normalize source line endings when loading classfile contents 2023-11-21 18:34:26 +01:00
Mathias Fussenegger
503a399e0d Add start_opts arg to start_or_attach
Alternative to https://github.com/mfussenegger/nvim-jdtls/pull/556
2023-11-01 08:47:05 +01:00
Mathias Fussenegger
7356238ee3 Don't drop argument if type uses generics in signature refactor 2023-11-01 08:35:05 +01:00
Mathias Fussenegger
a09f8cdd75 Add executeClientCommandSupport to extendedClientCapabilities
To account for upstream change in https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/2904
2023-10-13 17:58:19 +02:00
roland.hilliges
3ca419c52a Add test result parsing and display via diagnostic for testng 2023-09-19 16:05:16 +02:00
Mathias Fussenegger
697b39e3db Fix get_active_clients deprecation warnings 2023-09-14 15:30:13 +02:00
Mathias Fussenegger
f7cc47a42b Return client_id? from start_or_attach
Variant of https://github.com/mfussenegger/nvim-jdtls/pull/544 that
doesn't change behavior

Co-authored-by: y1rn <y1rn66@gmail.com>
2023-09-14 14:53:35 +02:00
Mathias Fussenegger
be1634aa57 Fix luals warnings in jdtls.setup 2023-09-14 14:53:35 +02:00
Mathias Fussenegger
095dc490f3 Show error message from launch args response for debug class/method 2023-08-01 19:13:49 +02:00
ian
00078a1b9d
Fix restart (#538)
Fix the error when calling `:JdtRestart`

```
msg_show.lua_error   JdtRestart E5108: Error executing lua ...an/.local/share/nvim/lazy/nvim-jdtls/lua/jdtls/setup.lua:16: attempt to call a table value
stack traceback:
	...an/.local/share/nvim/lazy/nvim-jdtls/lua/jdtls/setup.lua:16: in function 'restart'
	[string ":lua"]:1: in main chunk
```
2023-08-01 19:13:10 +02:00
Mathias Fussenegger
96e3978c3f Add a function to jump to tests & reverse 2023-07-10 21:53:06 +02:00
Mathias Fussenegger
6e6352f671 Add test generation functionality (optional with vscode-java-test) 2023-07-09 13:57:18 +02:00
Mathias Fussenegger
0261cf5a76 Implicitly add commands/debug adapter
Should make the setup slightly more convenient
2023-06-29 07:57:29 +02:00
Mathias Fussenegger
c6a3c47a0c Rename from_selection to visual in extract.opts 2023-06-22 09:10:07 +02:00
Mathias Fussenegger
17e743b224 Add name parameter to extract functions
Closes https://github.com/mfussenegger/nvim-jdtls/issues/472
2023-06-22 09:10:07 +02:00
Mathias Fussenegger
ba8b4a63e8 Remove init_with_config_notify
This has been the default in neovim for a while now.
2023-06-22 08:43:41 +02:00
Mathias Fussenegger
d69d6c08c5 Re-use vim.lsp.start 2023-06-22 08:43:41 +02:00
Mathias Fussenegger
e9ff986af4 Change move sourceset detection to work for custom sources 2023-06-22 07:42:29 +02:00
Mathias Fussenegger
aebfc22877 Include source set indicator in move target selection
Otherwise it's not possible to distinguish between test and main if a
package exists in both, as both would appear the same.
2023-06-13 16:37:15 +02:00
Mathias Fussenegger
3492d44b75 Wait until clients close in wipe_data_and_restart 2023-06-13 16:37:15 +02:00
Mathias Fussenegger
c4ae99f442 Use name param of get_active_clients in request 2023-06-13 16:37:15 +02:00
Ellie Bodi
dbb8a403e9
truncate status messages when too long (#509)
Co-authored-by: Zach Bodi <zbodi@hubspot.com>
2023-06-10 07:19:54 +02:00
fengwk
8597d57fb4
Support jump to jdt:// from pom or gradle (#499) 2023-06-02 12:52:16 +02:00
fengwk
365811ecf9
Prefer alt-buffer client for attachment when handling jdt:// uri (#493)
When there are multiple clients it could use the wrong one. This prioritizes clients attached to the alt-buffer. Given that `jdt://` URLs are often opened by using goto-definition it has a high chance of being the right one.

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-05-23 18:31:23 +02:00
Mathias Fussenegger
355de7458f Remove config.cmd executable check
Apparently it doesn't work right on windows:

https://github.com/mfussenegger/nvim-jdtls/issues/479

The check is redundant anyway, because the built-in client will fail
with a good error message since:

1a60580925
2023-05-08 17:16:55 +02:00
tsuoihito
b041dd4308 Fix comment in VimL 2023-05-05 07:49:00 +02:00
Mathias Fussenegger
3649dc4ea7 Make :JdtJshell work inside jdt:// buffers
A `java.project.isTestFile` command returns an error if the URI isn't a
file but `jdt://`
2023-05-05 07:44:44 +02:00
Mathias Fussenegger
aa04fc0e4d Add signature refactoring to extensions in README 2023-04-17 18:42:44 +02:00
Mathias Fussenegger
de4b8e502e Include runtime path in set_runtime prompt
Closes https://github.com/mfussenegger/nvim-jdtls/issues/463
2023-04-15 08:12:57 +02:00
Mathias Fussenegger
a2dd26c1c0 Use jdtls.ui.pick_one in toString() prompt
Closes https://github.com/mfussenegger/nvim-jdtls/issues/460
2023-04-12 14:35:41 +02:00
Michael Härtl
ffb8f63689
Change readme example config from min to max heap (#454) 2023-04-03 19:56:11 +02:00
Mathias Fussenegger
f8fb45e05e Add support for decompiling .class files
Requires https://github.com/eclipse/eclipse.jdt.ls/pull/2515
2023-03-23 08:51:57 +01:00
Mathias Fussenegger
34202bc141 Mention python 3.9 requirement for jdtls.py 2023-03-19 07:41:28 +01:00
Mathias Fussenegger
a71e656a55 Add support for signature refactoring
Requires https://github.com/eclipse/eclipse.jdt.ls/pull/2497
2023-03-17 18:32:08 +01:00