Compare commits

...

8 commits

Author SHA1 Message Date
Venkatesan Ravi
8af3de07d3
Merge 0ffd8321e9 into ed31499ad6 2025-04-12 22:22:18 +07:00
raf
ed31499ad6
assistant/codecompanion-nvim: fix nvim-cmp and defaults ()
* assistant/codecompanion-nvim: fix nvim-cmp and defaults

* assistant/codecompanion-nvim: Description clean up

Added "Whether to enable" to mkEnableOption descriptions with `//`
merge.
2025-04-10 18:00:14 +00:00
Phan Đăng Khoa
a6f8df6785
Merge pull request from rice-cracker-dev/eslint-fix
languages: fix eslint_d error on load
2025-04-10 13:47:52 +00:00
army castillo
b1212b77ce Merge branch 'main' into fix/codecompanion-cmp-defaults 2025-04-06 02:49:19 -04:00
army castillo
51d76dd515 assistant/codecompanion-nvim: Description clean up
Added "Whether to enable" to mkEnableOption descriptions with `//`
merge.
2025-04-06 02:48:58 -04:00
army castillo
eedb3dd8c4 Merge branch 'main' into fix/codecompanion-cmp-defaults 2025-04-05 23:52:27 -04:00
army castillo
da57f955df assistant/codecompanion-nvim: fix nvim-cmp and defaults 2025-04-05 23:50:41 -04:00
Venkatesan Ravi
0ffd8321e9 Make conform respect config.vim.lsp.formatOnSave and config.vim.lsp.mappings.toggleFormatOnSave 2025-04-04 23:21:15 +00:00
7 changed files with 84 additions and 36 deletions
docs/release-notes
modules/plugins
assistant/codecompanion
formatter/conform-nvim
languages

View file

@ -199,6 +199,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):
@ -288,6 +289,7 @@
[rice-cracker-dev](https://github.com/rice-cracker-dev):
- `eslint_d` now checks for configuration files to load.
- Fixed an error where `eslint_d` fails to load.
[Sc3l3t0n](https://github.com/Sc3l3t0n):

View file

@ -9,7 +9,14 @@ in {
setupOpts = mkPluginSetupOption "codecompanion-nvim" {
opts = {
send_code = mkEnableOption "code from being sent to the LLM.";
send_code =
mkEnableOption ""
// {
default = true;
description = ''
Whether to enable code being sent to the LLM.
'';
};
log_level = mkOption {
type = enum ["DEBUG" "INFO" "ERROR" "TRACE"];
@ -30,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 {
@ -64,7 +74,12 @@ in {
};
chat = {
auto_scroll = mkEnableOption "automatic page scrolling.";
auto_scroll =
mkEnableOption ""
// {
default = true;
description = "Whether to enable automatic page scrolling.";
};
show_settings = mkEnableOption ''
LLM settings to appear at the top of the chat buffer.
@ -85,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 {
@ -155,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 =
@ -163,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.
'';
};
};

View file

@ -22,6 +22,11 @@ in {
};
treesitter.enable = true;
autocomplete.nvim-cmp = {
sources = {codecompanion-nvim = "[codecompanion]";};
sourcePlugins = ["codecompanion-nvim"];
};
};
};
}

View file

@ -1,12 +1,9 @@
{
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) attrs enum nullOr;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.lua) mkLuaInline;
{lib, ...}: let
inherit (lib.generators) mkLuaInline;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrs either nullOr;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.types) luaInline mkPluginSetupOption;
in {
options.vim.formatter.conform-nvim = {
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
@ -30,27 +27,48 @@ in {
description = "Default values when calling `conform.format()`";
};
format_on_save = mkOption {
type = nullOr attrs;
default = {
format_on_save = let
defaultFormatOnSaveOpts = {
lsp_format = "fallback";
timeout_ms = 500;
};
description = ''
Table that will be passed to `conform.format()`. If this
is set, Conform will run the formatter on save.
'';
};
in
mkOption {
type = nullOr (either attrs luaInline);
default = mkLuaInline ''
function()
if not vim.g.formatsave or vim.b.disableFormatSave then
return
else
return ${toLuaObject defaultFormatOnSaveOpts}
end
end
'';
description = ''
Table or function(lualinline) that will be passed to `conform.format()`. If this
is set, Conform will run the formatter on save.
'';
};
format_after_save = mkOption {
type = nullOr attrs;
default = {lsp_format = "fallback";};
description = ''
Table that will be passed to `conform.format()`. If this
is set, Conform will run the formatter asynchronously after
save.
'';
};
format_after_save = let
defaultFormatAfterSaveOpts = {lsp_format = "fallback";};
in
mkOption {
type = nullOr (either attrs luaInline);
default = mkLuaInline ''
function()
if not vim.g.formatsave or vim.b.disableFormatSave then
return
else
return ${toLuaObject defaultFormatAfterSaveOpts}
end
end
'';
description = ''
Table or function(luainline) that will be passed to `conform.format()`. If this
is set, Conform will run the formatter asynchronously after save.
'';
};
};
};
}

View file

@ -62,7 +62,7 @@
local markers = { "eslint.config.js", "eslint.config.mjs",
".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", }
for _, filename in ipairs(markers) do
local path = vim.fs.join(cwd, filename)
local path = vim.fs.joinpath(cwd, filename)
if vim.loop.fs_stat(path) then
return require("lint.linters.eslint_d").parser(output, bufnr, cwd)
end

View file

@ -61,7 +61,7 @@
local markers = { "eslint.config.js", "eslint.config.mjs",
".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", }
for _, filename in ipairs(markers) do
local path = vim.fs.join(cwd, filename)
local path = vim.fs.joinpath(cwd, filename)
if vim.loop.fs_stat(path) then
return require("lint.linters.eslint_d").parser(output, bufnr, cwd)
end

View file

@ -103,7 +103,7 @@
local markers = { "eslint.config.js", "eslint.config.mjs",
".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", }
for _, filename in ipairs(markers) do
local path = vim.fs.join(cwd, filename)
local path = vim.fs.joinpath(cwd, filename)
if vim.loop.fs_stat(path) then
return require("lint.linters.eslint_d").parser(output, bufnr, cwd)
end