diff --git a/lua/copilot/copilot_handler.lua b/lua/copilot/copilot_handler.lua index ed990a51..fc09553b 100644 --- a/lua/copilot/copilot_handler.lua +++ b/lua/copilot/copilot_handler.lua @@ -26,6 +26,7 @@ M.merge_server_opts = function (params) cmd = { "node", require("copilot.util").get_copilot_path(params.plugin_manager_path) }, name = "copilot", trace = "messages", + filetypes = { "rust" }, root_dir = vim.loop.cwd(), autostart = true, on_init = function(_, _) @@ -44,3 +45,4 @@ M.start = function(params) end return M + diff --git a/lua/copilot/util.lua b/lua/copilot/util.lua index 160cf778..50daf892 100644 --- a/lua/copilot/util.lua +++ b/lua/copilot/util.lua @@ -45,7 +45,7 @@ end M.get_copilot_path = function(plugin_path) for _, loc in ipairs({ "/opt", "/start", "" }) do - local copilot_path = plugin_path .. loc .. "/copilot.lua/copilot/index.js" + local copilot_path = plugin_path .. loc .. "/vimplugin-copilot.lua/copilot/index.js" if vim.fn.filereadable(copilot_path) ~= 0 then return copilot_path end @@ -72,3 +72,4 @@ M.create_request_autocmd = function(group) end return M +