Skip to content

Commit d88c82f

Browse files
author
Zhe Yu
committed
feat(nvim): improve project_root checks.
1 parent 62bef8e commit d88c82f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lua/vectorcode/integrations/codecompanion/vectorise_tool.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ return function(opts)
5555
local stat = vim.uv.fs_stat(project_root)
5656
if stat and stat.type == "directory" then
5757
vim.list_extend(args, { "--project_root", project_root })
58+
else
59+
return { status = "error", data = "Invalid path " .. project_root }
60+
end
61+
else
62+
project_root = vim.fs.root(".", { ".vectorcode", ".git" })
63+
if project_root == nil then
64+
return {
65+
status = "error",
66+
data = "Please specify a project root. You may use the `vectorcode_ls` tool to find a list of existing projects.",
67+
}
5868
end
5969
end
6070
vim.list_extend(

0 commit comments

Comments
 (0)