Commit Graph

1411 Commits

Author SHA1 Message Date
yetone
54ef723283 optimize: parallelize test dependencies installation 2025-08-02 17:48:47 +08:00
yetone
751d1855e7 fix: download the correct lua-language-server 2025-08-02 17:43:55 +08:00
Dmitry Torokhov
3b1f65e46d fix(tests): specify initial branch when initializing git repository
Git may complain if init.defaultBranch is not set up on the system:

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"

Use "git init -m main" to suppress this message.
2025-08-02 17:43:55 +08:00
Dmitry Torokhov
61c1bf8bfe feat(luatest): create a self-contained test runner
Adds a new scripts/run-luatest.sh script to provide a consistent,
self-contained way to run project unit tests, including locally.

The script handles:

 - Checking for necessary tools (rg, ag)
 - Cloning or updating plenary.nvim into the target/tests/deps directory

The Makefile is updated to use this new script, making make luatest the
single entry point for running unit tests.

The lua.yaml workflow is simplified to use this new make target,
ensuring the CI environment uses the exact same testing logic.
2025-08-02 17:43:55 +08:00
Dmitry Torokhov
59a518cf86 feat(typecheck): add local mode mirroring github to lua-typecheck.sh
This implements mode mirroring github workflow in scripts/lua-typecheck.sh
so that it can run locally.

A supporting script scripts/setup_deps.sh is created to define and
download/clone dependencies (plugins), as well as download luals, neovim
runtime, and create luarc.json. setup_deps.sh is now the only and
authoritative source of dependencies and luals version. Neovim version
still comes from lua.yaml.

To fetch neovim version from lua.yaml as well as figure out the right
source of neovim package, dependency on yq is introduced when running
locally in "managed" mode.

Dependencies, neovim runtime, and luals are downloaded to
target/tests subdirectory on local machine. luarc.json is created
from a template there as well.

The ability to run against the live system is preserved with "--live"
option. In this case it assumes that neovim is using lazy package
manager and optionally Mason, so if luals is not present in path the
script will try to see if it is installed by Mason.

When running in github CI neovim is set up through github action while
dependencies and luals are handled by the scripts.
2025-08-02 17:43:55 +08:00
PlacidFireball
6d372a9135 fix: set the content property to the empty string (#2566)
Co-authored-by: Jared Weiss <jared.weiss@quiq.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-08-02 15:37:19 +08:00
brook hong
7965546a34 fix: do not ask for API key for bedrock if aws_profile was set (#2564) 2025-08-02 13:00:00 +08:00
yetone
b225094dca fix: breaklines within the content (#2567) 2025-08-02 12:56:20 +08:00
Umut Sahin Onder
6c2a785ebb fix(config): suppress last model info messages if redundant
Only show "Using last model" notification when the loaded model
differs from the original configuration to reduce UI noise
2025-07-31 21:30:41 -07:00
yetone
1830917ceb fix(docs): incorrect installation instructions (#2555) 2025-07-31 14:26:39 +08:00
Shogo Nakamoto
ca63356a99 feat: allow overriding bedrock provider endpoint (#2540) 2025-07-31 14:15:34 +08:00
Boshen
72444ac217 docs: improve vim-plug installation guide (#2548) 2025-07-31 14:14:54 +08:00
Dmitry Torokhov
5bc4ffa19f refactor(bedrock): replace vim.uv.spawn() with vim.system()
Instead of implementing synchronous call to a command line utility via
vim.uv.spawn() switch to using vim.system(). Its return value (object)
wait() method allows to specify timeout too.

This makes code much simpler.
2025-07-31 14:12:13 +08:00
Dmitry Torokhov
d737fa6109 build: remove presubmit dependency on luvit-meta
As discussed in https://github.com/yetone/avante.nvim/pull/2536 the
project should either use luv bindings from luals or luvit-meta
library, but not both, as they conflict with each other (especially
with uv.uv_timer_t). Given that other projects such as kickstart.nvim
and lazydev.nvim are switching to use the former, we should do the same
and drop luvit-meta dependency.

Also adjust code that was using luvit-meta's annotations for timers.
2025-07-31 14:12:13 +08:00
skt041959
d77e1272a0 fix: check before set keymap (#2543) 2025-07-30 22:17:28 +08:00
yetone
8c5b3f9706 fix: duplicated replace blocks in diff (#2549) 2025-07-30 22:16:56 +08:00
NekoNekoNiko120
5e4eb8652b feat: remember the last selected model (#2518)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: yetone <yetoneful@gmail.com>
2025-07-28 13:21:49 +08:00
yetone
7e50de8904 fix: ReAct tool use format in few-shot (#2542) 2025-07-28 11:14:45 +08:00
yetone
0a2143586a fix: incorrect json in tool_use example (#2541) 2025-07-28 11:03:01 +08:00
Marcos Romero Lamas
daa419c79b fix: statusline hidden in Avante (#2477) 2025-07-27 14:57:24 +08:00
Peter Cardenas
d8ec4e4aa4 fix: gracefully handle html2md failure (#2533) 2025-07-26 16:19:38 +08:00
Dmitry Torokhov
53dcb55896 fix(sidebar): keep header aligned when sidebar width changed (#2535) 2025-07-26 16:16:23 +08:00
yetone
8bc149ccd8 fix: react prompts (#2537) 2025-07-26 16:06:56 +08:00
Amaury Cannesson
bd69ae14f6 fix(utils): fix gsub in trim_line_numbers() (#2528) 2025-07-24 17:47:10 +08:00
yetone
1452c7233b fix: invalid json format (#2531) 2025-07-24 17:37:10 +08:00
yetone
02aa0a4241 fix: compatible with some incorrect tool results (#2530) 2025-07-24 16:44:05 +08:00
yetone
7af303b421 fix: missing curl error message (#2527) 2025-07-24 16:03:15 +08:00
yetone
ca1271c996 fix: use path instead of target_file in the edit_file input (#2526) 2025-07-24 15:37:26 +08:00
yetone
57311d80ea fix: not enough room (#2525) 2025-07-24 14:33:16 +08:00
yetone
f199625ee4 fix: diff format in k2 v2 (#2524) 2025-07-24 14:31:03 +08:00
yetone
430cac8d91 feat: introduce beast-mode-3.1 (#2523) 2025-07-24 14:16:21 +08:00
yetone
888a49d8c1 fix: bad tool use (#2520) 2025-07-23 23:47:23 +08:00
doodleEsc
faa3945428 feat: implement user-defined text shortcuts (#2512)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-07-23 11:54:59 +08:00
yetone
8b8a777ec3 fix: typo in prompts (#2517) 2025-07-23 11:50:25 +08:00
yetone
7c9644ceb7 fix: diff format in k2 (#2516) 2025-07-23 11:48:33 +08:00
Dmitry Torokhov
6c9c4365a2 fix(sidebar): do not error when selecting text from help window (#2514) 2025-07-23 11:43:34 +08:00
Joshua Petitma
a72ee55b20 fix: typo (#2513) 2025-07-23 11:42:59 +08:00
yetone
ef29a01840 fix: str_replace (#2515) 2025-07-23 11:06:39 +08:00
yetone
c65604837c fix: diff format (#2510) 2025-07-22 20:38:57 +08:00
Yomi Colledge
f4f82a09d7 fix(llm_tools): Improve the permissions logic (#2506)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-07-22 17:54:46 +08:00
Dmitry Torokhov
10c0a8d942 feat(sidebar): allow external users identify selected code buffer
External users such as, for example, lualine may want to identify and
add special handling for Avante buffers. This is easily done for Avante
result, input, selected files and todos buffers as they all set a unique
file type. However the selected code buffer inherits file type from the
buffer where the code came from (to have proper syntax highlighting),
and so filetype can not be used to identify it as Avante buffer.

One option would be to add a custom buffer variable, such as
vim.b.avante_buf_type and use it in plugins. Unfortunately lualine
triggers everything on file type, so that would not work.

Solve this by setting file type of the selected code buffer to
"AvanteSelectedCode" and manually activate treesitter parser with
language of the source buffer if treesitter is active there. If the
original code buffer uses legacy syntax highlighting then activate it.
This keeps syntax highlighting active for the code while allowing
external users identify Avante selected code buffer.
2025-07-22 17:50:23 +08:00
Dmitry Torokhov
c6d2783975 fix(sidebar): account for sidebar header on/off for selected code
Current implementation always says that first 5 lines of code is shown
when selected code does not fully fit into its window. This is not
correct as the window can be resized, may have a header occupying one
line, and the lines may not be the first ones. Also the wording is
awkward.

Correct these issues by checking current window height, accounting for
the potential header presence by checking sidebar.enabled config flag,
and updating the message format to be more concise:

" Selected Code (4/15 lines)"

While at it switch to using Utils.count_lines() which does not need
creating temporary tables.

Note that this does not deal with the header info being stale after
resizing sidebar windows.
2025-07-22 17:49:56 +08:00
Dmitry Torokhov
aa606b6147 refactor(history): change HistoryMessage:new() to accept role and item
Change the constructor to accept role and a single content item instead
of raw AvanteLLMMessage instance. This will help when we will start
changing message.content from being a string or a list of tables to just
a string or a single table.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
2d9f8fd252 refactor(sidebar): use helpers when working with history
Do not poke directly into avante.HistoryMessage instances, use
appropriate helpers instead.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
86e8563125 refactor(llm_tools): use History.Helpers.get_tool_result_data()
Avoid poking into internals of avante.HistoryMessage, and use
appropriate helper instead.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
394e4d79eb refactor(message): add helper to update contents of simple text message
Add update_content() helper so code outside of history module does not
need to know details of the message structure.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
e82b159f65 refactor(history): add a helper to fetch text from messages and use it
This adds History.Helpers.get_text_data() helper to fetch contents of a
"text" message. This removes the need to know internals of message
structure outside of history module.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
663433a5ed refactor(message): use vim.tbl_extend() in Message:new() to apply options
It is unwieldy to handle fields in opt table one by one. Luckily there
is vim.bl_extend("force", ...) that can help us here.

Also move annotation for opts from parameter to a separate class to make
it easier to work with.
2025-07-22 17:49:28 +08:00
bhaktatejas922
07457293d4 fix(docs): morph website 2025-07-22 17:45:58 +08:00
yetone
db56901594 fix: result winid is nil (#2508) 2025-07-22 17:45:14 +08:00