Repository navigation
Closed
Description
Hi there I followed the instructions on the wiki to integrate VectorCode into code companion. I followed the instructions to modify the opts for code companion like so:
opts = {
strategies = {
chat = {
adaptor = "copilot",
tools = {
vectorcode = {
description = "Run VectorCode to retrieve the project context.",
callback = function()
return require("vectorcode.integrations.codecompanion").chat.make_tool()
end,
},
},
slash_commands = {
-- add the vectorcode command here.
codebase = require("vectorcode.integrations").codecompanion.chat.make_slash_command(),
},
},
inline = {
adaptor = "copilot",
},
cmd = {
adaptor = "copilot",
},
},
},
but I got the following error:
/Users/beli/.config/nvim/lua/plugins/code_companion.lua:41: module 'vectorcode.integrations' not found:
no field package.preload['vectorcode.integrations']
cache_loader: module vectorcode.integrations not found
cache_loader_lib: module vectorcode.integrations not found
no file './vectorcode/integrations.lua'
no file '/opt/homebrew/share/luajit-2.1/vectorcode/integrations.lua'
no file '/usr/local/share/lua/5.1/vectorcode/integrations.lua'
no file '/usr/local/share/lua/5.1/vectorcode/integrations/init.lua'
no file '/opt/homebrew/share/lua/5.1/vectorcode/integrations.lua'
no file '/opt/homebrew/share/lua/5.1/vectorcode/integrations/init.lua'
no file './vectorcode/integrations.so'
no file '/usr/local/lib/lua/5.1/vectorcode/integrations.so'
no file '/opt/homebrew/lib/lua/5.1/vectorcode/integrations.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './vectorcode.so'
no file '/usr/local/lib/lua/5.1/vectorcode.so'
no file '/opt/homebrew/lib/lua/5.1/vectorcode.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
# stacktrace:
- ~/.config/nvim/lua/plugins/code_companion.lua:41 _in_ **load**
- ~/.config/nvim/lua/config/lazy.lua:17
- .config/nvim/init.lua:2
Metadata
Metadata
Assignees
Labels
No labels
Activity
Davidyz commentedon Apr 30, 2025
Hi, is your
optstable wrapped in a function like this? If not, this will make therequire('vectorcode.integrations')being loaded before vectorcode is loaded.BTW codecompanion released a new extension API which makes this a lot easier. I'm working on migrating to this (the current approach will still work, but with the extension API it'll be easier to set up tools/slash commands).