mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/java: init
This commit is contained in:
parent
e75f0aac90
commit
8f8f50243e
2 changed files with 106 additions and 0 deletions
44
plugins/by-name/java/default.nix
Normal file
44
plugins/by-name/java/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) types;
|
||||
inherit (lib.nixvim) defaultNullOpts;
|
||||
in
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "java";
|
||||
packPathName = "nvim-java";
|
||||
package = "nvim-java";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
# `require("java").setup()` must run **BEFORE** lspconfig
|
||||
configLocation = lib.mkOrder 900 "extraConfigLua";
|
||||
|
||||
settingsOptions = {
|
||||
root_markers =
|
||||
defaultNullOpts.mkListOf types.str
|
||||
[
|
||||
"settings.gradle"
|
||||
"settings.gradle.kts"
|
||||
"pom.xml"
|
||||
"build.gradle"
|
||||
"mvnw"
|
||||
"gradlew"
|
||||
"build.gradle"
|
||||
"build.gradle.kts"
|
||||
".git"
|
||||
]
|
||||
''
|
||||
List of files that exist in root of the project.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
assertions = lib.nixvim.mkAssertions "plugins.nvim-java" {
|
||||
assertion = cfg.enable -> !config.plugins.nvim-jdtls.enable;
|
||||
message = ''
|
||||
You cannot use nvim-java alongside nvim-jdtls.
|
||||
Please, disable `plugins.nvim-jdtls` if you wish to use this plugin.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue