@@ -435,7 +435,7 @@ function! s:UrlDecode(str) abort
435435 return substitute (a: str , ' %\(\x\x\)' , ' \=iconv(nr2char("0x".submatch(1)), "utf-8", "latin1")' , ' g' )
436436endfunction
437437
438- function ! s: EditorInfo () abort
438+ function ! copilot#agent# EditorInfo () abort
439439 if ! exists (' s:editor_version' )
440440 if has (' nvim' )
441441 let s: editor_version = matchstr (execute (' version' ), ' NVIM v\zs[^[:space:]]\+' )
@@ -446,6 +446,10 @@ function! s:EditorInfo() abort
446446 return {' name' : has (' nvim' ) ? ' Neovim' : ' Vim' , ' version' : s: editor_version }
447447endfunction
448448
449+ function ! copilot#agent#EditorPluginInfo () abort
450+ return {' name' : ' copilot.vim' , ' version' : s: plugin_version }
451+ endfunction
452+
449453function ! copilot#agent#Settings () abort
450454 let settings = {
451455 \ ' http' : {
@@ -465,8 +469,8 @@ endfunction
465469function ! s: InitializeResult (result, agent) abort
466470 let a: agent .capabilities = get (a: result , ' capabilities' , {})
467471 let info = {
468- \ ' editorInfo' : s: EditorInfo (),
469- \ ' editorPluginInfo' : { ' name ' : ' copilot.vim ' , ' version ' : s: plugin_version } ,
472+ \ ' editorInfo' : copilot#agent# EditorInfo (),
473+ \ ' editorPluginInfo' : copilot#agent#EditorPluginInfo () ,
470474 \ ' editorConfiguration' : extend (copilot#agent#Settings (), a: agent .editorConfiguration)}
471475 call a: agent .Request (' setEditorInfo' , info)
472476endfunction
0 commit comments