mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/rest: add dependencies
https://github.com/rest-nvim/rest.nvim?tab=readme-ov-file#dependencies
This commit is contained in:
parent
6c9d178ecc
commit
b7dea12375
2 changed files with 103 additions and 94 deletions
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
helpers,
|
||||
pkgs,
|
||||
|
@ -401,21 +402,33 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
|
||||
extraOptions = {
|
||||
curlPackage = lib.mkPackageOption pkgs "curl" {
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
enableHttpFiletypeAssociation = lib.mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Sets up the filetype association of `.http` files to trigger treesitter support.
|
||||
Sets up the filetype association of `.http` files to trigger treesitter support to enable `rest` functionality.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.plugins.treesitter.enable;
|
||||
message = ''
|
||||
Nixvim (plugins.rest): Requires the `http` parser from `plugins.treesitter`, please set `plugins.treesitter.enable`.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
extraPackages = [ cfg.curlPackage ];
|
||||
|
||||
filetype = lib.mkIf cfg.enableHttpFiletypeAssociation {
|
||||
extension = {
|
||||
"http" = "http";
|
||||
};
|
||||
extension.http = "http";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
{
|
||||
empty = {
|
||||
# As of 2024-05-07, the lua dependencies of luaPackage.rest-nvim are not correctly propagated to
|
||||
# the vim plugin.
|
||||
# TODO: re-enable this test when this issue will have been fixed
|
||||
test.runNvim = false;
|
||||
|
||||
plugins.rest.enable = true;
|
||||
plugins = {
|
||||
rest.enable = true;
|
||||
treesitter.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
defaults = {
|
||||
# As of 2024-05-07, the lua dependencies of luaPackage.rest-nvim are not correctly propagated to
|
||||
# the vim plugin.
|
||||
# TODO: re-enable this test when this issue will have been fixed
|
||||
test.runNvim = false;
|
||||
|
||||
plugins.rest = {
|
||||
plugins = {
|
||||
treesitter.enable = true;
|
||||
rest = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
|
@ -104,4 +99,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue