Skip to content

Commit b880a7d

Browse files
authored
feat!: use jdtls compiler (#153)
Relates to #75 This is maybe what should have been done in the first place. Reasons to use jdtls compiler are: * it is faster * it is more reliable * allows neotest-java to have less responsabilities TASKS: - [x] Remove old code - [x] Add dependency to documentation and luarock - [x] Handle when compilation fails (already handled by nvim-jdtls) - [x] Also support debugger - [x] Check dependencies are present - [x] Use java_home from jdtls settings - [x] ability to run tests from the summary window
1 parent d5a31b3 commit b880a7d

19 files changed

+301
-854
lines changed

.github/workflows/luarocks.yml

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ jobs:
4444
plenary.nvim
4545
nvim-nio
4646
tree-sitter-java
47+
nvim-dap
48+
nvim-dap-ui
49+

README.md

+31-10
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
{
4141
"rcasia/neotest-java",
4242
ft = "java",
43+
dependencies = {
44+
"mfussenegger/nvim-jdtls",
45+
"mfussenegger/nvim-dap", -- for the debugger
46+
"rcarriga/nvim-dap-ui", -- recommended
47+
"theHamsta/nvim-dap-virtual-text", -- recommended
48+
},
4349
init = function()
4450
-- override the default keymaps.
4551
-- needed until neotest-java is integrated in LazyVim
@@ -78,18 +84,34 @@
7884
<summary><a href="https://github.com/folke/lazy.nvim">lazy.nvim</a> plugin manager</summary>
7985

8086
```lua
81-
{
82-
"nvim-neotest/neotest",
83-
ft = "java",
84-
dependencies = {
87+
return {
88+
{
8589
"rcasia/neotest-java",
90+
ft = "java",
91+
dependencies = {
92+
"mfussenegger/nvim-jdtls",
93+
"mfussenegger/nvim-dap", -- for the debugger
94+
"rcarriga/nvim-dap-ui", -- recommended
95+
"theHamsta/nvim-dap-virtual-text", -- recommended
96+
},
8697
},
87-
opts = {
88-
adapters = {
89-
["neotest-java"] = {},
98+
{
99+
"nvim-neotest/neotest",
100+
dependencies = {
101+
"nvim-neotest/nvim-nio",
102+
"nvim-lua/plenary.nvim",
103+
"antoinemadec/FixCursorHold.nvim",
104+
"nvim-treesitter/nvim-treesitter"
105+
},
106+
opts = {
107+
adapters = {
108+
["neotest-java"] = {
109+
-- config here
110+
},
111+
},
90112
},
91113
},
92-
},
114+
}
93115
```
94116

95117
</details>
@@ -105,8 +127,7 @@
105127

106128
```lua
107129
{
108-
ignore_wrapper = false, -- whether to ignore maven/gradle wrapper
109-
junit_jar = nil, -- default: /nvim/neotest-java/junit-platform-console-standalone-[version].jar
130+
junit_jar = nil, -- default: stdpath("data") .. /nvim/neotest-java/junit-platform-console-standalone-[version].jar
110131
incremental_build = true
111132
}
112133
```

ROADMAP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The goal of this project is to achieve:
1010
v1.0.0
1111

1212
- [ ] Smooth feedback when there is a compilation error
13-
- [ ] Compile with nvim-jdtls when available
13+
- [x] Compile with nvim-jdtls when available
1414
- [ ] Select and run certain testcases of parameterized tests
1515
- [ ] Integrate with [nvim-coverage](https://github.com/andythigpen/nvim-coverage)
1616

lua/neotest-java/build_tool/compiler.lua

-182
This file was deleted.

0 commit comments

Comments
 (0)