mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-15 00:58:37 +00:00
Compare commits
9 commits
c978a4dfd4
...
6c94cd3b39
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6c94cd3b39 | ||
![]() |
ed31499ad6 | ||
![]() |
a6f8df6785 | ||
![]() |
b1212b77ce | ||
![]() |
51d76dd515 | ||
![]() |
eedb3dd8c4 | ||
![]() |
da57f955df | ||
![]() |
f084b74a56 | ||
![]() |
c93379b75b |
12 changed files with 101 additions and 14 deletions
|
@ -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):
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
# Build nil from source to get most recent
|
||||
# features as they are added.
|
||||
nil = inputs'.nil.packages.default;
|
||||
nvf-queries = final.callPackage ./legacyPackages/nvf-queries.nix {
|
||||
version = self.shortRev or self.dirtyShortRev or "dirty";
|
||||
};
|
||||
blink-cmp = let
|
||||
pin = self.pins.blink-cmp;
|
||||
in
|
||||
|
|
10
flake/legacyPackages/nvf-queries.nix
Normal file
10
flake/legacyPackages/nvf-queries.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
vimUtils,
|
||||
version,
|
||||
}:
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "nvf-queries";
|
||||
inherit version;
|
||||
|
||||
src = ./nvf-queries;
|
||||
}
|
34
flake/legacyPackages/nvf-queries/queries/nix/injections.scm
Normal file
34
flake/legacyPackages/nvf-queries/queries/nix/injections.scm
Normal file
|
@ -0,0 +1,34 @@
|
|||
; extends
|
||||
|
||||
(binding
|
||||
attrpath: (attrpath
|
||||
(identifier) @_path)
|
||||
expression: [
|
||||
(string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
]
|
||||
(#set! injection.language "lua")
|
||||
(#match? @_path "^luaConfig\(Pre\|Post\)$"))
|
||||
|
||||
(apply_expression
|
||||
function: [
|
||||
(variable_expression
|
||||
name: (identifier) @funcName
|
||||
(#eq? @funcName "mkLuaInline"))
|
||||
;; matches lib.generators.mkLuaInline
|
||||
(select_expression
|
||||
expression: _ @lib
|
||||
(#eq? @lib "lib")
|
||||
(attrpath
|
||||
attr: (identifier) @generators
|
||||
attr: (identifier) @funcName))
|
||||
]
|
||||
argument: [
|
||||
(string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
]
|
||||
(#set! injection.language "lua"))
|
|
@ -18,7 +18,7 @@
|
|||
pluginType = nullOr (
|
||||
either
|
||||
package
|
||||
(enum (pluginInputNames ++ ["nvim-treesitter" "flutter-tools-patched" "vim-repeat"]))
|
||||
(enum (pluginInputNames ++ ["nvim-treesitter" "flutter-tools-patched" "vim-repeat" "nvf-queries"]))
|
||||
);
|
||||
|
||||
pluginsType = listOf pluginType;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -140,6 +140,13 @@ in {
|
|||
treesitter = {
|
||||
enable = mkEnableOption "Nix treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "nix";
|
||||
|
||||
enableNvfQueries =
|
||||
mkEnableOption ''
|
||||
extra query files targetted at nvf configuration, e.g. injection rules
|
||||
for mkLuaInline and some options.
|
||||
''
|
||||
// {default = true;};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -212,8 +219,11 @@ in {
|
|||
}
|
||||
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
vim = {
|
||||
treesitter.enable = true;
|
||||
treesitter.grammars = [cfg.treesitter.package];
|
||||
startPlugins = mkIf cfg.treesitter.enableNvfQueries ["nvf-queries"];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.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
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
doCheck = false;
|
||||
};
|
||||
|
||||
inherit (inputs.self.legacyPackages.${pkgs.stdenv.system}) blink-cmp;
|
||||
inherit (inputs.self.legacyPackages.${pkgs.stdenv.system}) blink-cmp nvf-queries;
|
||||
};
|
||||
|
||||
buildConfigPlugins = plugins:
|
||||
|
|
Loading…
Add table
Reference in a new issue