How to configure VectorCode to operate with CodeCompanion? #268
Closed
alexruzenhack
started this conversation in
General
Replies: 1 comment 5 replies
-
|
It seems that you've got 2 ---@diagnostic disable: missing-fields
--[[
NOTE: Set the config path to enable the copilot adapter to work.
It will search the following paths for a 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" },
-- Test with blink.cmp (delete if not required)
{
"saghen/blink.cmp",
lazy = false,
version = "*",
opts = {
keymap = {
preset = "enter",
["<S-Tab>"] = { "select_prev", "fallback" },
["<Tab>"] = { "select_next", "fallback" },
},
cmdline = { sources = { "cmdline" } },
sources = {
default = { "lsp", "path", "buffer", "codecompanion" },
},
},
},
"Davidyz/VectorCode",
-- Test with nvim-cmp
-- { "hrsh7th/nvim-cmp" },
},
opts = {
--Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
strategies = {
--NOTE: Change the adapter as required
chat = { adapter = "copilot" },
inline = { adapter = "copilot" },
},
extensions = {
vectorcode = {
-- VectorCode extension opts goes here
}
},
opts = {
log_level = "DEBUG",
},
},
},
}
-- Leaving this comment in to see if the issue author notices ;-)
-- This is so I can tell if they've really tested with their own minimal.lua file
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", "diff" },
highlight = { enable = true },
})
end
-- Setup nvim-cmp
-- 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.
-- }),
-- })
-- endThis contains the absolute minimum changes to the plugin spec that could get the extension registered and working. You may use this as a starting point to debug your config. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
Probably I'm too dumb, but I'm having a hard time to configure it properly. I think the documentation is not clear enough for dumb people like me.
This is my CodeCompanion package declaration:
{ -- [[ INFO: CodeCompanion ]] -- -- LLM integration -- See https://codecompanion.olimorris.dev/ "olimorris/codecompanion.nvim", version = "1bde333ad97ac32297860f3a2d94812da37ea4ec", -- commit v17.10.0 dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "ravitemer/mcphub.nvim", "j-hui/fidget.nvim", -- required by the integration plugin codecompanion/fidget-spinner.lua { -- [[ INFO: VectorCode ]] -- -- Code embedding indexer to be used for RAG, as LSP server or MCP application. -- See https://github.com/Davidyz/VectorCode "Davidyz/VectorCode", version = "31694ae45a13a1ba435c1f1cdbcec2282a349af2", -- v0.7.11, https://github.com/Davidyz/VectorCode/releases/tag/0.7.11 build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date dependencies = { "nvim-lua/plenary.nvim" }, cmd = "VectorCode", -- if you're lazy-loading VectorCode }, }, config = function() -- [[ INFO: CC: Setup ]] -- Hidden for brevit end, init = function() require("plugins.codecompanion.fidget-spinner"):init() end, opts = { extensions = { vectorcode = { opts = { add_tool = true, }, }, }, }, extensions = { mcphub = { callback = "mcphub.extensions.codecompanion", opts = { show_result_in_chat = true, -- Show mcp tool results in chat make_vars = true, -- Convert resources to #variables make_slash_commands = true, -- Add prompts as /slash commands }, }, vectorcode = { opts = { tool_group = { enabled = true, -- Register "@vectorcode_toolbox" extras = {}, -- Add more tools if desired collapse = false, -- Show individual tools in chat }, tool_opts = { ["*"] = {}, -- Defaults for all tools query = { default_num = { chunk = 50, document = 10 } }, -- Tuning knobs for file queries }, }, }, }, },Is this correct? Why I can't have code completion in the CodeCompanion Chat when I start typing
@vector...? The vectorcode group tool was not added to CodeCompanion?Beta Was this translation helpful? Give feedback.
All reactions