plugins/rest-nvim: add telescope integration

This commit is contained in:
Austin Horstman 2024-09-10 23:00:57 -05:00
parent 7484be88c7
commit 11c133e89e
No known key found for this signature in database
2 changed files with 22 additions and 0 deletions

View file

@ -415,6 +415,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
Sets up the filetype association of `.http` files to trigger treesitter support to enable `rest` functionality. Sets up the filetype association of `.http` files to trigger treesitter support to enable `rest` functionality.
''; '';
}; };
enableTelescope = lib.mkEnableOption "telescope integration";
}; };
extraConfig = cfg: { extraConfig = cfg: {
@ -425,8 +427,17 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
Nixvim (plugins.rest): Requires the `http` parser from `plugins.treesitter`, please set `plugins.treesitter.enable`. Nixvim (plugins.rest): Requires the `http` parser from `plugins.treesitter`, please set `plugins.treesitter.enable`.
''; '';
} }
{
assertion = cfg.enableTelescope -> config.plugins.telescope.enable;
message = ''
Nixvim (plugins.rest): You have `plugins.rest.enableTelescope` set to true, but `plugins.telescope.enable` is false.
Either disable the telescope integration or enable telescope.
'';
}
]; ];
extraConfigLua = lib.mkIf cfg.enableTelescope ''require("telescope").load_extension("rest")'';
extraPackages = [ cfg.curlPackage ]; extraPackages = [ cfg.curlPackage ];
filetype = lib.mkIf cfg.enableHttpFiletypeAssociation { filetype = lib.mkIf cfg.enableHttpFiletypeAssociation {

View file

@ -100,4 +100,15 @@
}; };
}; };
}; };
telescope = {
plugins = {
rest = {
enable = true;
enableTelescope = true;
};
treesitter.enable = true;
telescope.enable = true;
};
};
} }