Skip to content

Commit 49e0348

Browse files
committed
Copilot.vim 1.15.0
1 parent 1a55183 commit 49e0348

File tree

6 files changed

+261
-196
lines changed

6 files changed

+261
-196
lines changed

autoload/copilot/agent.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
scriptencoding utf-8
22

3-
let s:plugin_version = '1.14.0'
3+
let s:plugin_version = copilot#version#String()
44

55
let s:error_exit = -1
66

autoload/copilot/logger.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function! copilot#logger#Exception(...) abort
6565
endif
6666
endfor
6767
return agent.Request('telemetry/exception', {
68-
\ 'origin': a:0 ? a:1 : 'none',
68+
\ 'transaction': a:0 ? a:1 : '',
6969
\ 'platform': 'other',
7070
\ 'exception_detail': [{
7171
\ 'type': type . code,

autoload/copilot/version.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function! copilot#version#String() abort
2+
return '1.15.0'
3+
endfunction

dist/agent.js

Lines changed: 236 additions & 182 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/agent.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lua/_copilot.lua

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ copilot.lsp_start_client = function(cmd, handler_names)
77
for _, name in ipairs(handler_names) do
88
handlers[name] = function(err, result)
99
if result then
10-
local retval = vim.call('copilot#agent#LspHandle', id, {method = name, params = result})
11-
if type(retval) == 'table' then return retval.result, retval.error end
10+
local retval = vim.call('copilot#agent#LspHandle', id, { method = name, params = result })
11+
if type(retval) == 'table' then
12+
return retval.result, retval.error
13+
end
1214
end
1315
end
1416
if name:match('^copilot/') then
@@ -32,16 +34,18 @@ copilot.lsp_start_client = function(cmd, handler_names)
3234
vim.schedule(function()
3335
vim.call('copilot#agent#LspExit', client_id, code, signal)
3436
end)
35-
end
37+
end,
3638
})
3739
return id
3840
end
3941

4042
copilot.lsp_request = function(client_id, method, params)
4143
local client = vim.lsp.get_client_by_id(client_id)
42-
if not client then return end
44+
if not client then
45+
return
46+
end
4347
pcall(vim.lsp.buf_attach_client, 0, client_id)
44-
for _, doc in ipairs({params.doc, params.textDocument}) do
48+
for _, doc in ipairs({ params.doc, params.textDocument }) do
4549
if doc and type(doc.uri) == 'number' then
4650
local bufnr = doc.uri
4751
pcall(vim.lsp.buf_attach_client, bufnr, client_id)
@@ -51,24 +55,28 @@ copilot.lsp_request = function(client_id, method, params)
5155
end
5256
local _, id
5357
_, id = client.request(method, params, function(err, result)
54-
vim.call('copilot#agent#LspResponse', client_id, {id = id, error = err, result = result})
58+
vim.call('copilot#agent#LspResponse', client_id, { id = id, error = err, result = result })
5559
end)
5660
return id
5761
end
5862

5963
copilot.rpc_request = function(client_id, method, params)
6064
local client = vim.lsp.get_client_by_id(client_id)
61-
if not client then return end
65+
if not client then
66+
return
67+
end
6268
local _, id
6369
_, id = client.rpc.request(method, params, function(err, result)
64-
vim.call('copilot#agent#LspResponse', client_id, {id = id, error = err, result = result})
70+
vim.call('copilot#agent#LspResponse', client_id, { id = id, error = err, result = result })
6571
end)
6672
return id
6773
end
6874

6975
copilot.rpc_notify = function(client_id, method, params)
7076
local client = vim.lsp.get_client_by_id(client_id)
71-
if not client then return end
77+
if not client then
78+
return
79+
end
7280
return client.rpc.notify(method, params)
7381
end
7482

0 commit comments

Comments
 (0)