Skip to content

Commit dc1e771

Browse files
author
archiejudd
committed
Attempt loading slash commands from a user module path
1 parent ca87f13 commit dc1e771

File tree

1 file changed

+8
-1
lines changed
  • lua/codecompanion/strategies/chat/slash_commands

1 file changed

+8
-1
lines changed

lua/codecompanion/strategies/chat/slash_commands/init.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ local function resolve(callback)
1212
return slash_command
1313
end
1414

15-
-- Try loading the tool from the user's config
15+
-- Try loading the tool from the user's config using a module path
16+
ok, slash_command = pcall(require, callback)
17+
if ok then
18+
log:debug("Calling slash command: %s", callback)
19+
return slash_command
20+
end
21+
22+
-- Try loading the tool from the user's config using a file path
1623
local err
1724
slash_command, err = loadfile(callback)
1825
if err then

0 commit comments

Comments
 (0)