mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
plugins/rzls: init module
This commit is contained in:
parent
af69a39a5f
commit
ca7f98d936
2 changed files with 69 additions and 0 deletions
40
plugins/by-name/rzls/default.nix
Normal file
40
plugins/by-name/rzls/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
name = "rzls";
|
||||||
|
package = "rzls-nvim";
|
||||||
|
|
||||||
|
maintainers = [ lib.maintainers.khaneliman ];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
"rzls"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraOptions = {
|
||||||
|
enableRazorFiletypeAssociation = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Sets up the filetype association of `.cshtml` and `razor` files to trigger treesitter
|
||||||
|
and lsp support for razor functionality.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = cfg: {
|
||||||
|
assertions = lib.nixvim.mkAssertions "plugins.rzls" {
|
||||||
|
assertion = config.plugins.roslyn.enable;
|
||||||
|
message = ''
|
||||||
|
You must enable `plugins.roslyn` for general functionality in `rzls.nvim`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
filetype = lib.mkIf cfg.enableRazorFiletypeAssociation {
|
||||||
|
extension = {
|
||||||
|
razor = "razor";
|
||||||
|
cshtml = "razor";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.rzls.settings.path = lib.mkOptionDefault (lib.getExe config.dependencies.rzls.package);
|
||||||
|
};
|
||||||
|
}
|
||||||
29
tests/test-sources/plugins/by-name/rzls/default.nix
Normal file
29
tests/test-sources/plugins/by-name/rzls/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
# TODO: 2025-10-03
|
||||||
|
# Transient dependency `vmr` has a build failure
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/431811
|
||||||
|
dependencies.roslyn_ls.enable = false;
|
||||||
|
plugins.roslyn.enable = true;
|
||||||
|
plugins.rzls.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
# TODO: 2025-10-03
|
||||||
|
# Transient dependency `vmr` has a build failure
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/431811
|
||||||
|
dependencies.roslyn_ls.enable = false;
|
||||||
|
plugins.roslyn.enable = true;
|
||||||
|
plugins.rzls = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
on_attach.__raw = ''
|
||||||
|
function()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
capabilities.__raw = ''vim.lsp.protocol.make_client_capabilities()'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue