mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-15 00:58:37 +00:00
Compare commits
24 commits
73a772fb1f
...
e661d87385
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e661d87385 | ||
![]() |
ed31499ad6 | ||
![]() |
a6f8df6785 | ||
![]() |
b1212b77ce | ||
![]() |
51d76dd515 | ||
![]() |
eedb3dd8c4 | ||
![]() |
da57f955df | ||
![]() |
7868198945 | ||
![]() |
08037dbdce | ||
![]() |
03f477ad93 | ||
![]() |
cbda2a2379 | ||
![]() |
2ec0a3aaec | ||
![]() |
da7961f09b | ||
![]() |
507ac8e181 | ||
![]() |
81d489d8e1 | ||
![]() |
bd2b9daa36 | ||
![]() |
6733b9a94e | ||
![]() |
996f2e3f86 | ||
![]() |
54f9480f57 | ||
![]() |
6ad3163dfb | ||
![]() |
caa177c91f | ||
![]() |
842e958777 | ||
![]() |
0bbb039b7f | ||
c002e8f572 |
7 changed files with 81 additions and 26 deletions
|
@ -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):
|
||||
|
||||
|
|
|
@ -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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -22,6 +22,11 @@ in {
|
|||
};
|
||||
|
||||
treesitter.enable = true;
|
||||
|
||||
autocomplete.nvim-cmp = {
|
||||
sources = {codecompanion-nvim = "[codecompanion]";};
|
||||
sourcePlugins = ["codecompanion-nvim"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue