Skip to content

Commit db62371

Browse files
committed
feat(client): notify about unsupported node version
1 parent b41d4c9 commit db62371

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/copilot/client.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ function M.get_node_version()
4646
table.concat(vim.fn.systemlist(config.get("copilot_node_command") .. " --version", nil, false)),
4747
"v(%S+)"
4848
)
49+
50+
local node_version_major = tonumber(string.match(copilot_node_version, "^(%d+)%."))
51+
if node_version_major < 16 then
52+
vim.notify(
53+
string.format("[Copilot] Node.js version 16.x or newer required but found %s", copilot_node_version),
54+
vim.log.levels.ERROR
55+
)
56+
end
4957
end
5058
return copilot_node_version
5159
end

0 commit comments

Comments
 (0)