Skip to content

Commit 1e135c5

Browse files
committed
Copilot.vim 1.29.0
1 parent f45ecd9 commit 1e135c5

File tree

7 files changed

+209
-211
lines changed

7 files changed

+209
-211
lines changed

autoload/copilot.vim

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ function! s:Start() abort
4646
if s:Running()
4747
return
4848
endif
49-
let s:agent = copilot#agent#New({'methods': {
50-
\ 'PanelSolution': function('copilot#panel#Solution'),
51-
\ 'PanelSolutionsDone': function('copilot#panel#SolutionsDone'),
52-
\ },
53-
\ 'editorConfiguration' : s:EditorConfiguration()})
49+
let s:agent = copilot#agent#New({'editorConfiguration' : s:EditorConfiguration()})
5450
endfunction
5551

5652
function! s:Stop() abort
@@ -176,8 +172,8 @@ function! copilot#Enabled() abort
176172
\ && empty(s:BufferDisabled())
177173
endfunction
178174

179-
let s:inline_invoked = 0
180175
let s:inline_automatic = 1
176+
let s:inline_invoked = 2
181177

182178
function! copilot#Complete(...) abort
183179
if exists('g:_copilot_timer')
@@ -330,7 +326,7 @@ endfunction
330326
function! s:UpdatePreview() abort
331327
try
332328
let [text, outdent, delete, item] = s:SuggestionTextWithAdjustments()
333-
let text = split(text, "\n", 1)
329+
let text = split(text, "\r\n\\=\\|\n", 1)
334330
if empty(text[-1])
335331
call remove(text, -1)
336332
endif

autoload/copilot/agent.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ function! s:DispatchMessage(agent, method, handler, id, params, ...) abort
297297
if a:id isnot# v:null
298298
call s:Send(a:agent, extend({'id': a:id}, response))
299299
endif
300-
return response
300+
if !has_key(s:notifications, a:method)
301+
return response
302+
endif
301303
endfunction
302304

303305
function! s:OnMessage(agent, body, ...) abort
@@ -586,7 +588,7 @@ function! s:Progress(params, agent) abort
586588
endif
587589
endfunction
588590

589-
let s:common_handlers = {
591+
let s:notifications = {
590592
\ '$/progress': function('s:Progress'),
591593
\ 'featureFlagsNotification': function('s:Nop'),
592594
\ 'statusNotification': function('s:StatusNotification'),
@@ -618,7 +620,7 @@ function! copilot#agent#New(...) abort
618620
\ 'Cancel': function('s:AgentCancel'),
619621
\ 'StartupError': function('s:AgentStartupError'),
620622
\ }
621-
let instance.methods = extend(copy(s:common_handlers), get(opts, 'methods', {}))
623+
let instance.methods = copy(s:notifications)
622624
let [command, node_version, command_error] = s:Command()
623625
if len(command_error)
624626
if empty(command)

autoload/copilot/panel.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function! s:Render(state) abort
2626
endif
2727
let leads = {}
2828
for item in sorted
29-
let insert = split(item.insertText, "\n", 1)
29+
let insert = split(item.insertText, "\r\n\\=\\|\n", 1)
3030
let insert[0] = strpart(a:state.line, 0, copilot#util#UTF16ToByteIdx(a:state.line, item.range.start.character)) . insert[0]
3131
let lines += [s:separator] + insert
3232
if !has_key(leads, string(item.range.start))

autoload/copilot/version.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function! copilot#version#String() abort
2-
return '1.28.0'
2+
return '1.29.0'
33
endfunction

dist/agent.js

Lines changed: 195 additions & 195 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ copilot.lsp_start_client = function(cmd, handler_names, opts, settings)
3131
id = vim.lsp.start_client({
3232
cmd = cmd,
3333
cmd_cwd = vim.call('copilot#job#Cwd'),
34-
name = 'copilot',
34+
name = 'GitHub Copilot',
3535
init_options = opts.initializationOptions,
3636
workspace_folders = workspace_folders,
3737
settings = settings,

0 commit comments

Comments
 (0)