I'm using https://mise.jdx.dev/ to manage my node versions, and this results in situations where it uses a different node version in different projects. Sometimes this means when I change to a directory using an older node version, copilot LSP fails to start because the node version is too old. To fix this, I can specify copilot_node_command to use a specific node version so it's not changing the node used for copilot LSP. However in copilot.lua thecopilot_node_command setting only supports using a string, and it validates the string points to an executable. This causes me some trouble because I'd like to set copilot_node_command to something like mise exec node@lts -- node. This doesn't work because of the vim.fn.executable(M.node_command) check here
|
local cmd_output_table = vim.fn.executable(M.node_command) == 1 and vim.fn.systemlist(cmd, nil, 0) or { "" } |
. As a work-around I've made a
node-lts-wrapper.sh script in my
$PATH that just calls
mise exec node@lts -- node, but ideally I wouldn't need it.
Since there's already a check for the node version, could the logic to check that node_command is an executable be relaxed? Or could there be an option to specify a list, and then only the first arg to the list be validated to be executable? Thanks.
I'm using https://mise.jdx.dev/ to manage my node versions, and this results in situations where it uses a different node version in different projects. Sometimes this means when I change to a directory using an older node version, copilot LSP fails to start because the node version is too old. To fix this, I can specify
copilot_node_commandto use a specific node version so it's not changing the node used for copilot LSP. However incopilot.luathecopilot_node_commandsetting only supports using a string, and it validates the string points to an executable. This causes me some trouble because I'd like to setcopilot_node_commandto something likemise exec node@lts -- node. This doesn't work because of thevim.fn.executable(M.node_command)check herecopilot.lua/lua/copilot/lsp/nodejs.lua
Line 17 in c1bb86a
node-lts-wrapper.shscript in my$PATHthat just callsmise exec node@lts -- node, but ideally I wouldn't need it.Since there's already a check for the node version, could the logic to check that
node_commandis an executable be relaxed? Or could there be an option to specify a list, and then only the first arg to the list be validated to be executable? Thanks.