From da57f955dfc59c62cba92c823021be03ac7593dd Mon Sep 17 00:00:00 2001 From: army castillo Date: Sat, 5 Apr 2025 23:50:41 -0400 Subject: [PATCH 1/2] assistant/codecompanion-nvim: fix nvim-cmp and defaults --- docs/release-notes/rl-0.8.md | 1 + .../assistant/codecompanion/codecompanion-nvim.nix | 14 ++++++++++++-- modules/plugins/assistant/codecompanion/config.nix | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 8b87ae99..161f50fe 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -198,6 +198,7 @@ Inspiration from `vim.languages.clang.dap` implementation. - Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`. - Add [codecompanion.nvim] plugin under `vim.assistant.codecompanion-nvim`. +- Fix [codecompanion-nvim] plugin: nvim-cmp error and setupOpts defaults. [nezia1](https://github.com/nezia1): diff --git a/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix b/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix index 9ebe30c0..a73f1566 100644 --- a/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix +++ b/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix @@ -9,7 +9,12 @@ in { setupOpts = mkPluginSetupOption "codecompanion-nvim" { opts = { - send_code = mkEnableOption "code from being sent to the LLM."; + send_code = + mkEnableOption "" + // { + default = true; + description = "code from being sent to the LLM."; + }; log_level = mkOption { type = enum ["DEBUG" "INFO" "ERROR" "TRACE"]; @@ -64,7 +69,12 @@ in { }; chat = { - auto_scroll = mkEnableOption "automatic page scrolling."; + auto_scroll = + mkEnableOption "" + // { + default = true; + description = "automatic page scrolling."; + }; show_settings = mkEnableOption '' LLM settings to appear at the top of the chat buffer. diff --git a/modules/plugins/assistant/codecompanion/config.nix b/modules/plugins/assistant/codecompanion/config.nix index 6b427d28..08fc8cb2 100644 --- a/modules/plugins/assistant/codecompanion/config.nix +++ b/modules/plugins/assistant/codecompanion/config.nix @@ -22,6 +22,11 @@ in { }; treesitter.enable = true; + + autocomplete.nvim-cmp = { + sources = {codecompanion-nvim = "[codecompanion]";}; + sourcePlugins = ["codecompanion-nvim"]; + }; }; }; } From 51d76dd51572193135a0dde94fc6ad6dbf1fff1d Mon Sep 17 00:00:00 2001 From: army castillo Date: Sun, 6 Apr 2025 02:48:58 -0400 Subject: [PATCH 2/2] assistant/codecompanion-nvim: Description clean up Added "Whether to enable" to mkEnableOption descriptions with `//` merge. --- .../codecompanion/codecompanion-nvim.nix | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix b/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix index a73f1566..8e5ed4cc 100644 --- a/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix +++ b/modules/plugins/assistant/codecompanion/codecompanion-nvim.nix @@ -13,7 +13,9 @@ in { mkEnableOption "" // { default = true; - description = "code from being sent to the LLM."; + description = '' + Whether to enable code being sent to the LLM. + ''; }; log_level = mkOption { @@ -35,7 +37,10 @@ in { mkEnableOption "" // { default = true; - description = "a diff view to see the changes made by the LLM."; + description = '' + Whether to enable a diff view + to see the changes made by the LLM. + ''; }; close_chat_at = mkOption { @@ -73,7 +78,7 @@ in { mkEnableOption "" // { default = true; - description = "automatic page scrolling."; + description = "Whether to enable automatic page scrolling."; }; show_settings = mkEnableOption '' @@ -95,14 +100,18 @@ in { mkEnableOption "" // { default = true; - description = "references in the chat buffer."; + description = '' + Whether to enable references in the chat buffer. + ''; }; show_token_count = mkEnableOption "" // { default = true; - description = "the token count for each response."; + description = '' + Whether to enable the token count for each response. + ''; }; intro_message = mkOption { @@ -165,7 +174,10 @@ in { mkEnableOption "" // { default = true; - description = "showing default actions in the action palette."; + description = '' + Whether to enable showing default + actions in the action palette. + ''; }; show_default_prompt_library = @@ -173,7 +185,8 @@ in { // { default = true; description = '' - showing default prompt library in the action palette. + Whether to enable showing default + prompt library in the action palette. ''; }; };