From e78ebe06807acc47fde6d33c99292548ccb598ae Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 27 May 2025 07:44:18 +0300 Subject: [PATCH] assistant/codecompanion: also add YAML tree-sitter grammar when enabled --- modules/plugins/assistant/codecompanion/config.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/plugins/assistant/codecompanion/config.nix b/modules/plugins/assistant/codecompanion/config.nix index 08fc8cb2..fa863b74 100644 --- a/modules/plugins/assistant/codecompanion/config.nix +++ b/modules/plugins/assistant/codecompanion/config.nix @@ -21,7 +21,17 @@ in { }; }; - treesitter.enable = true; + treesitter = { + enable = true; + + # Codecompanion depends on the YAML grammar being added. Below is + # an easy way of adding an user-configurable grammar package exposed + # by the YAML language module *without* enabling the whole YAML language + # module. The package is defined even when the module is disabled. + grammars = [ + config.vim.languages.yaml.treesitter.package + ]; + }; autocomplete.nvim-cmp = { sources = {codecompanion-nvim = "[codecompanion]";};