Skip to content

Commit 324ec9e

Browse files
committed
Copilot.vim 1.8.0
1 parent 2f4f925 commit 324ec9e

File tree

8 files changed

+100034
-30
lines changed

8 files changed

+100034
-30
lines changed

autoload/copilot/agent.vim

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let g:autoloaded_copilot_agent = 1
55

66
scriptencoding utf-8
77

8-
let s:plugin_version = '1.7.0'
8+
let s:plugin_version = '1.8.0'
99

1010
let s:error_exit = -1
1111

@@ -332,22 +332,8 @@ function! copilot#agent#LspHandle(agent_id, response) abort
332332
call s:OnResponse(s:instances[a:agent_id], a:response)
333333
endfunction
334334

335-
unlet! s:is_arm_macos
336-
function! s:IsArmMacOS() abort
337-
if exists('s:is_arm_macos')
338-
return s:is_arm_macos
339-
elseif has('win32') || !isdirectory('/private')
340-
let s:is_arm_macos = 0
341-
else
342-
let out = []
343-
call copilot#job#Stream(['uname', '-s', '-p'], function('add', [out]), v:null)
344-
let s:is_arm_macos = join(out, '') =~# '^Darwin arm'
345-
endif
346-
return s:is_arm_macos
347-
endfunction
348-
349335
function! s:Command() abort
350-
if !has('nvim-0.6') && v:version < 802
336+
if !has('nvim-0.6') && v:version < 900
351337
return [v:null, '', 'Vim version too old']
352338
endif
353339
let node = get(g:, 'copilot_node_command', '')
@@ -374,10 +360,8 @@ function! s:Command() abort
374360
if !get(g:, 'copilot_ignore_node_version')
375361
if major == 0
376362
return [v:null, node_version, 'Could not determine Node.js version']
377-
elseif major < 16 && s:IsArmMacOS()
363+
elseif major < 16
378364
return [v:null, node_version, 'Node.js version 16.x or newer required but found ' . node_version]
379-
elseif major < 14
380-
return [v:null, node_version, 'Node.js version 14.x or newer required but found ' . node_version]
381365
endif
382366
endif
383367
let agent = get(g:, 'copilot_agent_command', '')
@@ -410,9 +394,16 @@ function! copilot#agent#EditorInfo() abort
410394
else
411395
let proxy = ''
412396
endif
413-
let match = matchlist(proxy, '\C^\%([^:]\+://\)\=\%(\([^/:#]\+@\)\)\=\%(\([^/:#]\+\)\|\[\([[:xdigit:]:]\+\)\]\)\%(:\(\d\+\)\)\=\%(/\|$\)')
397+
let match = matchlist(proxy, '\c^\%([^:]\+://\)\=\%(\([^/:#]\+@\)\)\=\%(\([^/:#]\+\)\|\[\([[:xdigit:]:]\+\)\]\)\%(:\(\d\+\)\)\=\%(/\|$\|?strict_\=ssl=\(.*\)\)')
414398
if !empty(match)
415399
let info.networkProxy = {'host': match[2] . match[3], 'port': empty(match[4]) ? 80 : +match[4]}
400+
if match[5] =~? '^[0f]'
401+
let info.networkProxy.rejectUnauthorized = v:false
402+
elseif match[5] =~? '^[1t]'
403+
let info.networkProxy.rejectUnauthorized = v:true
404+
elseif exists('g:copilot_proxy_strict_ssl')
405+
let info.networkProxy.rejectUnauthorized = empty(g:copilot_proxy_strict_ssl) ? v:false : v:true
406+
endif
416407
if !empty(match[1])
417408
let info.networkProxy.username = s:UrlDecode(matchstr(match[1], '^[^:]*'))
418409
let info.networkProxy.password = s:UrlDecode(matchstr(match[1], ':\zs.*'))

autoload/copilot/doc.vim

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ function! copilot#doc#Get() abort
8282
let col_byte = col('.') - (mode() =~# '^[iR]' || empty(line))
8383
let col_utf16 = copilot#doc#UTF16Width(strpart(line, 0, col_byte))
8484
let doc.position = {'line': line('.') - 1, 'character': col_utf16}
85-
let lines = getline(1, '$')
86-
if &eol
87-
call add(lines, "")
85+
if !has('nvim')
86+
let lines = getline(1, '$')
87+
if &eol
88+
call add(lines, "")
89+
endif
90+
let doc.source = join(lines, "\n")
8891
endif
89-
let doc.source = join(lines, "\n")
9092
return doc
9193
endfunction
9294

copilot/dist/agent.js

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

copilot/dist/tokenizer_cushman002.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)