|
1 | | -# A Neovim Plugin Template |
| 1 | +# :construction: nvim-java (WIP) |
2 | 2 |
|
3 | | - |
4 | | - |
| 3 | +No need to put up with [jdtls](https://github.com/eclipse-jdtls/eclipse.jdt.ls) nonsense anymore. |
| 4 | +Just install and start writing `public static void main(String[] args)`. |
5 | 5 |
|
6 | | -A template repository for Neovim plugins. |
| 6 | +## Features |
7 | 7 |
|
8 | | -## Using it |
| 8 | +:white_check_mark: are supported features. :x: are pending features. |
9 | 9 |
|
10 | | -Via `gh`: |
| 10 | +- :white_check_mark: Diagnostics & Auto Completion |
| 11 | +- :x: Automatic [DAP](https://github.com/mfussenegger/nvim-dap) debug configuration |
| 12 | +- :x: Running tests |
11 | 13 |
|
12 | | -``` |
13 | | -$ gh repo create my-plugin -p ellisonleao/nvim-plugin-template |
14 | | -``` |
| 14 | +## Why |
15 | 15 |
|
16 | | -Via github web page: |
| 16 | +- Uses [nvim-lspconfig]() to setup `jdtls` |
| 17 | +- Uses `jdtls` and auto loads `jdtls` plugins from [mason.nvim](https://github.com/williamboman/mason.nvim) (If they are installed) |
| 18 | + - Supported plugins are, |
| 19 | + - `lombok` (mason `jdtls` package contains the lombok jar. So no need to installed it separately) |
| 20 | + - `java-test` |
| 21 | + - `java-debug-adapter` |
| 22 | +- Typed & documented APIs |
| 23 | +- No callback hells I [promise](https://github.com/pyericz/promise-lua) |
17 | 24 |
|
18 | | -Click on `Use this template` |
| 25 | +## How to Use |
19 | 26 |
|
20 | | - |
| 27 | +```lua |
| 28 | +local java = require('java') |
21 | 29 |
|
22 | | -## Features and structure |
| 30 | +require('lspconfig').jdtls.setup(java.get_config()) |
23 | 31 |
|
24 | | -- 100% Lua |
25 | | -- Github actions for: |
26 | | - - running tests using [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) and [busted](https://olivinelabs.com/busted/) |
27 | | - - check for formatting errors (Stylua) |
28 | | - - vimdocs autogeneration from README.md file |
29 | | - - luarocks release (LUAROCKS_API_KEY secret configuration required) |
| 32 | +vim.api.nvim_create_autocmd('LspAttach', { |
| 33 | + callback = function(args) |
| 34 | + local buffer = args.buf |
30 | 35 |
|
31 | | -### Plugin structure |
32 | | - |
33 | | -``` |
34 | | -. |
35 | | -├── lua |
36 | | -│ ├── plugin_name |
37 | | -│ │ └── module.lua |
38 | | -│ └── plugin_name.lua |
39 | | -├── Makefile |
40 | | -├── plugin |
41 | | -│ └── plugin_name.lua |
42 | | -├── README.md |
43 | | -├── tests |
44 | | -│ ├── minimal_init.lua |
45 | | -│ └── plugin_name |
46 | | -│ └── plugin_name_spec.lua |
| 36 | + -- add your language server keymaps here |
| 37 | + end, |
| 38 | + group = vim.api.nvim_create_augroup('LSP Keymaps', {}), |
| 39 | +}) |
47 | 40 | ``` |
0 commit comments