From 6c9d178ecceb1321bb0a153355f00b8f1dbfd92d Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 9 Sep 2024 17:05:33 -0500 Subject: [PATCH] plugins/rest: add filetype association option This gives users a quick way to setup the filetype association that is expected to be configured for proper usage of the plugin. --- plugins/by-name/rest/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/by-name/rest/default.nix b/plugins/by-name/rest/default.nix index 604edbf5..8d42369f 100644 --- a/plugins/by-name/rest/default.nix +++ b/plugins/by-name/rest/default.nix @@ -399,4 +399,23 @@ helpers.neovim-plugin.mkNeovimPlugin { ] ]; }; + + extraOptions = { + enableHttpFiletypeAssociation = lib.mkOption { + type = types.bool; + default = true; + description = '' + Sets up the filetype association of `.http` files to trigger treesitter support. + ''; + }; + }; + + extraConfig = cfg: { + + filetype = lib.mkIf cfg.enableHttpFiletypeAssociation { + extension = { + "http" = "http"; + }; + }; + }; }