Skip to content

Commit 3a35313

Browse files
committed
fix(api): set_editor_info method
1 parent ac70821 commit 3a35313

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lua/copilot/api.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ end
3434
---@alias copilot_set_editor_info_params { editorInfo: copilot_editor_info, editorPluginInfo: copilot_editor_plugin_info, editorConfiguration: copilot_editor_configuration, networkProxy?: copilot_network_proxy }
3535

3636
---@param params copilot_set_editor_info_params
37-
function mod.set_editor_info(client, params)
38-
return mod.notify(client, "setEditorInfo", params)
37+
---@return any|nil err
38+
---@return nil data
39+
---@return table ctx
40+
function mod.set_editor_info(client, params, callback)
41+
return mod.request(client, "setEditorInfo", params, callback)
3942
end
4043

4144
---@alias copilot_editor_configuration { enableAutoCompletions: boolean, disabledLanguages: string[] }

lua/copilot/client.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ M.merge_server_opts = function(params)
153153
.. M.get_node_version()
154154
set_editor_info_params.editorConfiguration = util.get_editor_configuration()
155155
set_editor_info_params.networkProxy = util.get_network_proxy()
156-
api.set_editor_info(client, set_editor_info_params)
156+
api.set_editor_info(client, set_editor_info_params, function(err)
157+
if err then
158+
vim.notify(string.format("[copilot] setEditorInfo failure: %s", err), vim.log.levels.ERROR)
159+
end
160+
end)
157161
end)
158162
end,
159163
handlers = {

0 commit comments

Comments
 (0)