Compare commits

...

24 commits

Author SHA1 Message Date
QuiNz-
e661d87385
Merge 7868198945 into ed31499ad6 2025-04-11 15:10:23 +01:00
raf
ed31499ad6
assistant/codecompanion-nvim: fix nvim-cmp and defaults (#802)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Treewide Checks / Validate flake (push) Has been cancelled
Treewide Checks / Check formatting (push) Has been cancelled
Treewide Checks / Check source tree for typos (push) Has been cancelled
Treewide Checks / Validate documentation builds (push) Has been cancelled
Treewide Checks / Validate hyperlinks in documentation sources (push) Has been cancelled
Treewide Checks / Validate Editorconfig conformance (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* 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 #818 from rice-cracker-dev/eslint-fix
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
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
QuiNz-
7868198945
Merge branch 'NotAShelf:main' into feat-ruff 2025-03-23 22:05:39 +01:00
QuiNz-
08037dbdce
Merge branch 'NotAShelf:main' into feat-ruff 2025-03-19 16:00:22 +01:00
QuiNzX
03f477ad93 change: fix release note 2025-01-25 21:17:30 +01:00
QuiNzX
cbda2a2379 change: update inline inherit statements 2025-01-25 20:40:10 +01:00
QuiNzX
2ec0a3aaec change: add example vim.languages.python.lsp.server 2025-01-23 19:46:50 +01:00
QuiNzX
da7961f09b revert: python isMaximal 2025-01-23 18:53:29 +01:00
QuiNzX
507ac8e181 change: use toList instead of if-else statements 2025-01-23 18:51:37 +01:00
QuiNzX
81d489d8e1 change: handle both single and multiple servers 2025-01-23 18:24:50 +01:00
QuiNzX
bd2b9daa36 fix pylsp 2025-01-22 00:24:10 +01:00
QuiNzX
6733b9a94e rename: server -> servers 2025-01-22 00:19:41 +01:00
QuiNzX
996f2e3f86 fix python to isMaximal mistake 2025-01-21 23:58:42 +01:00
QuiNzX
54f9480f57 edit release notes & revert python to isMaximal 2025-01-21 23:48:06 +01:00
QuiNzX
6ad3163dfb add release notes 2025-01-21 22:57:39 +01:00
QuiNzX
caa177c91f rename: packages -> package & lsp server options 2025-01-21 05:32:37 +01:00
QuiNzX
842e958777 use ruff alongside other lsp servers 2025-01-20 18:43:48 +01:00
QuiNzX
0bbb039b7f add ruff as lsp 2025-01-20 18:43:48 +01:00
raf
c002e8f572
Merge pull request #570 from LilleAila/add-rainbow-delimiters
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check documentation / Validate hyperlinks in documentation sources (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Check for typos in the source tree / check-typos (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
visuals/rainbow-delimiters: init
2025-01-19 22:07:44 +03:00
7 changed files with 81 additions and 26 deletions

View file

@ -190,6 +190,11 @@
- Add [ruff] as a formatter option in `vim.languages.python.format.type`.
- Add [cue] support under `vim.languages.cue`.
[QuiNzX](https://github.com/QuiNzX):
- Add ruff as lsp alongside other lsp servers in a list as an option. Under
`vim.languages.python.lsp.server`.
[ARCIII](https://github.com/ArmandoCIII):
[leetcode.nvim]: https://github.com/kawre/leetcode.nvim
@ -199,6 +204,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 +294,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

@ -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

@ -8,9 +8,10 @@
inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str bool;
inherit (lib.lists) isList toList;
inherit (lib.types) enum either listOf package str bool attrsOf;
inherit (lib.nvim.lua) expToLua;
inherit (lib) genAttrs;
cfg = config.vim.languages.python;
@ -23,9 +24,9 @@
capabilities = capabilities;
on_attach = default_on_attach;
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/pyright-langserver", "--stdio"}''
if isList cfg.lsp.package.pyright
then expToLua cfg.lsp.package.pyright
else ''{"${cfg.lsp.package.pyright}/bin/pyright-langserver", "--stdio"}''
}
}
'';
@ -38,9 +39,24 @@
capabilities = capabilities;
on_attach = default_on_attach;
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}''
if isList cfg.lsp.package.basedpyright
then expToLua cfg.lsp.package.basedpyright
else ''{"${cfg.lsp.package.basedpyright}/bin/basedpyright-langserver", "--stdio"}''
}
}
'';
};
ruff = {
package = pkgs.ruff;
lspConfig = ''
lspconfig.ruff.setup{
capabilities = capabilities;
on_attach = default_on_attach;
cmd = ${
if isList cfg.lsp.package.ruff
then expToLua cfg.lsp.package.ruff
else ''{"${cfg.lsp.package.ruff}/bin/ruff", "server"}''
}
}
'';
@ -53,9 +69,9 @@
capabilities = capabilities;
on_attach = default_on_attach;
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/pylsp"}''
if isList cfg.lsp.package.pylsp
then expToLua cfg.lsp.package.pylsp
else ''{"${cfg.lsp.package.pylsp}/bin/pylsp"}''
}
}
'';
@ -172,16 +188,20 @@ in {
enable = mkEnableOption "Python LSP support" // {default = config.vim.languages.enableLSP;};
server = mkOption {
description = "Python LSP server to use";
type = enum (attrNames servers);
description = "Python LSP server to use either as a single server or a list of servers";
example = ''
server = "basedpyright;
server = ["basedpyright" "ruff"];
'';
type = either (enum (attrNames servers)) (listOf (enum (attrNames servers)));
default = defaultServer;
};
package = mkOption {
description = "python LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = either package (listOf str);
default = servers.${cfg.lsp.server}.package;
type = attrsOf (either package (listOf str));
default = genAttrs (toList cfg.lsp.server) (name: servers.${name}.package);
};
};
@ -235,7 +255,7 @@ in {
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.python-lsp = servers.${cfg.lsp.server}.lspConfig;
vim.lsp.lspconfig.sources = genAttrs (toList cfg.lsp.server) (name: servers.${name}.lspConfig);
})
(mkIf cfg.format.enable {

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