mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-04 10:06:13 +02:00
plugins/nvim-jdtls: rename to jdtls, migrate to mkNeovimPlugin
This commit is contained in:
parent
d67fcbd1d3
commit
7114362f36
7 changed files with 194 additions and 189 deletions
54
plugins/by-name/jdtls/default.nix
Normal file
54
plugins/by-name/jdtls/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "jdtls";
|
||||
packPathName = "nvim-jdtls";
|
||||
package = "nvim-jdtls";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
# TODO: Added 2025-04-07; remove after 25.05
|
||||
inherit (import ./deprecations.nix lib)
|
||||
imports
|
||||
deprecateExtraOptions
|
||||
;
|
||||
|
||||
extraOptions = {
|
||||
jdtLanguageServerPackage = lib.mkPackageOption pkgs "jdt-language-server" {
|
||||
nullable = true;
|
||||
};
|
||||
};
|
||||
|
||||
setup = ".start_or_attach"; # only used settingsDescription
|
||||
callSetup = false;
|
||||
extraConfig = cfg: {
|
||||
extraPackages = [ cfg.jdtLanguageServerPackage ];
|
||||
|
||||
autoCmd = [
|
||||
{
|
||||
event = "FileType";
|
||||
pattern = "java";
|
||||
callback.__raw = ''
|
||||
function ()
|
||||
require('jdtls').start_or_attach(${lib.nixvim.toLuaObject cfg.settings})
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
settingsOptions = import ./settings-options.nix lib;
|
||||
|
||||
settingsExample = {
|
||||
cmd = [
|
||||
"jdtls"
|
||||
{ __raw = "'--jvm-arg='..vim.api.nvim_eval('g:NVIM_LOMBOK')"; }
|
||||
];
|
||||
root_dir.__raw = ''
|
||||
vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1])
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue