Skip to content

Commit

Permalink
feat(client): notify about unsupported node version
Browse files Browse the repository at this point in the history
  • Loading branch information
MunifTanjim committed Mar 18, 2023
1 parent b41d4c9 commit db62371
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/copilot/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ function M.get_node_version()
table.concat(vim.fn.systemlist(config.get("copilot_node_command") .. " --version", nil, false)),
"v(%S+)"
)

local node_version_major = tonumber(string.match(copilot_node_version, "^(%d+)%."))
if node_version_major < 16 then
vim.notify(
string.format("[Copilot] Node.js version 16.x or newer required but found %s", copilot_node_version),
vim.log.levels.ERROR
)
end
end
return copilot_node_version
end
Expand Down

0 comments on commit db62371

Please sign in to comment.