diff --git a/lua/copilot/api.lua b/lua/copilot/api.lua index 64fc0691..151f8b54 100644 --- a/lua/copilot/api.lua +++ b/lua/copilot/api.lua @@ -1,5 +1,4 @@ local mod = {} - ---@param callback? fun(err: any|nil, data: table, ctx: table): nil ---@return any|nil err ---@return table data diff --git a/lua/copilot/auth.lua b/lua/copilot/auth.lua index d539a829..a1124ff8 100644 --- a/lua/copilot/auth.lua +++ b/lua/copilot/auth.lua @@ -1,4 +1,6 @@ local api = require("copilot.api") +local auth = require("copilot.auth") + local c = require("copilot.client") local M = {} diff --git a/lua/copilot/client.lua b/lua/copilot/client.lua index df948ccf..fe4b8bfe 100644 --- a/lua/copilot/client.lua +++ b/lua/copilot/client.lua @@ -2,6 +2,7 @@ local api = require("copilot.api") local config = require("copilot.config") local util = require("copilot.util") +local cmd = {"/home/zach/Dev/copilot/copilot-rs/target/release/copilot-rs" } local is_disabled = false local M = { @@ -47,9 +48,9 @@ end ---@return string function M.get_node_version() if not M.node_version then - local node = config.get("copilot_node_command") + -- local node = config.get("copilot_node_command") - local cmd = { node, "--version" } + -- local cmd = { node, "--version" } local cmd_output_table = vim.fn.systemlist(cmd, nil, false) local cmd_output = cmd_output_table[#cmd_output_table] local cmd_exit_code = vim.v.shell_error @@ -176,9 +177,10 @@ local function prepare_client_config(overrides) M.startup_error = nil return vim.tbl_deep_extend("force", { - cmd = { - node, - agent_path, + cmd = cmd, + cmd_env = { + RUST_LOG="debug", + RUST_BACKTRACE="FULL", }, root_dir = vim.loop.cwd(), name = "copilot", @@ -190,20 +192,20 @@ local function prepare_client_config(overrides) M.capabilities = initialize_result.capabilities end - vim.schedule(function() - ---@type copilot_set_editor_info_params - local set_editor_info_params = util.get_editor_info() - set_editor_info_params.editorInfo.version = set_editor_info_params.editorInfo.version - .. " + Node.js " - .. M.get_node_version() - set_editor_info_params.editorConfiguration = util.get_editor_configuration() - set_editor_info_params.networkProxy = util.get_network_proxy() - api.set_editor_info(client, set_editor_info_params, function(err) - if err then - vim.notify(string.format("[copilot] setEditorInfo failure: %s", err), vim.log.levels.ERROR) - end - end) - end) + -- vim.schedule(function() + -- ---@type copilot_set_editor_info_params + -- local set_editor_info_params = util.get_editor_info() + -- set_editor_info_params.editorInfo.version = set_editor_info_params.editorInfo.version + -- .. " + Node.js " + -- .. M.get_node_version() + -- set_editor_info_params.editorConfiguration = util.get_editor_configuration() + -- set_editor_info_params.networkProxy = util.get_network_proxy() + -- -- api.set_editor_info(client, set_editor_info_params, function(err) + -- -- if err then + -- -- vim.notify(string.format("[copilot] setEditorInfo failure: %s", err), vim.log.levels.ERROR) + -- -- end + -- end) + -- end) end, on_exit = function(_code, _signal, client_id) if M.id == client_id then diff --git a/lua/copilot/util.lua b/lua/copilot/util.lua index 1dc75c98..b60a8165 100644 --- a/lua/copilot/util.lua +++ b/lua/copilot/util.lua @@ -182,7 +182,6 @@ function M.get_doc_params(overrides) relativePath = params.doc.relativePath, } params.position = params.doc.position - return params end