Closed wenjinnn closed 3 weeks ago
Your minimal file isn't working. It's causing me the following error:
Error detected while processing /Users/Oli/Code/Neovim/codecompanion.nvim/minimal2.lua:
E5113: Error while calling lua chunk: vim/_editor.lua:0: /Users/Oli/Code/Neovim/codecompanion.nvim/minimal2.lua..nvim_exec2() called at /Users/Oli/Code/Neovim/codecompanion.nvim/minimal2.lua:0: Vim(packadd):E919: Directory not found in 'packpath':"pack/*/opt/mini.nvim"
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
/Users/Oli/Code/Neovim/codecompanion.nvim/minimal2.lua:9: in main chunk
I can confirm this works with the minimal.lua file provided in the repo:
I opened Neovim with nvim --clean -u minimal.lua minimal.lua
Sorry for that, look's like mini.deps have some issue that open with nvim --clean
.
I made another minimal.lua base on readme template and reproduce it again with nvim --clean -u minimal.lua minimal.lua
, please note that I'm using mini.pick:
---@diagnostic disable: missing-fields
--NOTE: Set config path to enable the copilot adapter to work.
--It will search the follwoing paths for the for copilot token:
-- - "$CODECOMPANION_TOKEN_PATH/github-copilot/hosts.json"
-- - "$CODECOMPANION_TOKEN_PATH/github-copilot/apps.json"
vim.env["CODECOMPANION_TOKEN_PATH"] = vim.fn.expand("~/.config")
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
-- Your CodeCompanion setup
local plugins = {
{
"olimorris/codecompanion.nvim",
dependencies = {
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
{ "nvim-lua/plenary.nvim" },
{ "hrsh7th/nvim-cmp" },
{ "echasnovski/mini.pick" },
},
opts = {
--Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
display = {
action_palette = {
provider = "mini_pick",
},
},
opts = {
log_level = "DEBUG",
},
},
},
}
require("lazy.minit").repro({ spec = plugins })
-- Setup Tree-sitter
local ts_status, treesitter = pcall(require, "nvim-treesitter.configs")
if ts_status then
treesitter.setup({
ensure_installed = { "lua", "markdown", "markdown_inline", "yaml" },
highlight = { enable = true },
})
end
-- Setup completion
local cmp_status, cmp = pcall(require, "cmp")
if cmp_status then
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
})
end
-- setup ui.select
require('mini.pick').setup()
vim.ui.select = MiniPick.ui_select
Should have spotted this sooner. Mini.Pick isn't supported for the Action Palette unfortunately. We just support a default which is vim.ui.select
or Telescope.
Would be more than happy to support Mini.Pick via a PR though.
Should have spotted this sooner. Mini.Pick isn't supported for the Action Palette unfortunately. We just support a default which is
vim.ui.select
or Telescope.Would be more than happy to support Mini.Pick via a PR though.
https://github.com/user-attachments/assets/7829e297-2f47-4326-ae99-2ed92afe15bd
I think this issue also persists with fzf-lua
Your
minimal.lua
configError messages
No response
Log output
No error message appear in log file
Health check output
Describe the bug
Select some text in visual mode and execute
:'<,'>CodeCompanionActions
, not showing ui select panelReproduce the bug
:'<,'>CodeCompanionActions
and executeFinal checks
minimal.lua
file from above and have shared this