Skip to content

Commit a9fa794

Browse files
committed
Copilot.vim 1.39.0
1 parent 25f7397 commit a9fa794

File tree

7 files changed

+326
-366
lines changed

7 files changed

+326
-366
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-addi
4848
git clone https://github.com/github/copilot.vim.git `
4949
$HOME/AppData/Local/nvim/pack/github/start/copilot.vim
5050

51-
4. Start Neovim and invoke `:Copilot setup`.
51+
4. Start Vim/Neovim and invoke `:Copilot setup`.
5252

5353
[Node.js]: https://nodejs.org/en/download/
5454
[Neovim]: https://github.com/neovim/neovim/releases/latest

autoload/copilot.vim

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
scriptencoding utf-8
22

3-
let s:has_nvim_ghost_text = has('nvim-0.6') && exists('*nvim_buf_get_mark')
3+
let s:has_nvim_ghost_text = has('nvim-0.7') && exists('*nvim_buf_get_mark')
44
let s:vim_minimum_version = '9.0.0185'
55
let s:has_vim_ghost_text = has('patch-' . s:vim_minimum_version) && has('textprop')
66
let s:has_ghost_text = s:has_nvim_ghost_text || s:has_vim_ghost_text
@@ -69,16 +69,8 @@ function! copilot#RunningClient() abort
6969
endif
7070
endfunction
7171

72-
function! s:NodeVersionWarning() abort
73-
if exists('s:client.node_version_warning')
74-
echohl WarningMsg
75-
echo 'Warning:' s:client.node_version_warning
76-
echohl NONE
77-
endif
78-
endfunction
79-
80-
if has('nvim-0.6') && !has(luaeval('vim.version().api_prerelease') ? 'nvim-0.7.1' : 'nvim-0.7.0')
81-
let s:editor_warning = 'Neovim 0.6 support is deprecated and will be dropped in a future release of copilot.vim.'
72+
if has('nvim-0.7') && !has(luaeval('vim.version().api_prerelease') ? 'nvim-0.8.1' : 'nvim-0.8.0')
73+
let s:editor_warning = 'Neovim 0.7 support is deprecated and will be dropped in a future release of copilot.vim.'
8274
endif
8375
if has('vim_starting') && exists('s:editor_warning')
8476
call copilot#logger#Warn(s:editor_warning)
@@ -648,7 +640,6 @@ function! s:commands.status(opts) abort
648640

649641
echo 'Copilot: Ready'
650642
call s:EditorVersionWarning()
651-
call s:NodeVersionWarning()
652643
endfunction
653644

654645
function! s:commands.signout(opts) abort
@@ -775,7 +766,6 @@ function! s:commands.version(opts) abort
775766
echo 'UNIX'
776767
endif
777768
call s:EditorVersionWarning()
778-
call s:NodeVersionWarning()
779769
endfunction
780770

781771
function! s:UpdateEditorConfiguration() abort

autoload/copilot/client.vim

+16-27
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ function! s:Warn(msg) abort
2626
echohl NONE
2727
endfunction
2828

29-
let s:node_target = '18.x or newer'
30-
function! s:UpgradeNodeMsg(node) abort
31-
if get(a:node, 0, 'node') ==# 'node'
32-
return 'Upgrade to ' . s:node_target
33-
else
34-
return 'Change g:copilot_node_command to ' . s:node_target
35-
endif
36-
endfunction
37-
3829
function! s:VimClose() dict abort
3930
if !has_key(self, 'job')
4031
return
@@ -387,8 +378,10 @@ function! s:OnExit(instance, code, ...) abort
387378
call remove(a:instance, 'client_id')
388379
endif
389380
let message = 'Process exited with status ' . a:code
390-
if a:code == 2
391-
let message = 'Node.js too old. ' . s:UpgradeNodeMsg(a:instance.node)
381+
if a:code >= 18 && a:code < 100
382+
let message = 'Node.js too old. ' .
383+
\ (get(a:instance.node, 0, 'node') ==# 'node' ? 'Upgrade' : 'Change g:copilot_node_command') .
384+
\ ' to ' . a:code . '.x or newer'
392385
endif
393386
if !has_key(a:instance, 'serverInfo') && !has_key(a:instance, 'startup_error')
394387
let a:instance.startup_error = message
@@ -496,7 +489,7 @@ endfunction
496489

497490
let s:script_name = 'dist/language-server.js'
498491
function! s:Command() abort
499-
if !has('nvim-0.6') && v:version < 900
492+
if !has('nvim-0.7') && v:version < 900
500493
return [[], [], 'Vim version too old']
501494
endif
502495
let script = get(g:, 'copilot_command', '')
@@ -566,10 +559,6 @@ function! s:PostInit(result, instance) abort
566559
let a:instance.serverInfo = get(a:result, 'serverInfo', {})
567560
if !has_key(a:instance, 'node_version') && has_key(a:result.serverInfo, 'nodeVersion')
568561
let a:instance.node_version = a:result.serverInfo.nodeVersion
569-
if a:instance.node_version =~# '^1[67]\.'
570-
let a:instance.node_version_warning = 'Node.js ' . a:instance.node_version . ' support will soon be dropped. ' . s:UpgradeNodeMsg(a:instance.node)
571-
call s:Warn(a:instance.node_version_warning)
572-
endif
573562
endif
574563
let a:instance.AfterInitialized = function('copilot#util#Defer')
575564
for Fn in remove(a:instance, 'after_initialized')
@@ -686,21 +675,21 @@ function! copilot#client#New(...) abort
686675
endfor
687676
if has('nvim')
688677
call extend(instance, {
689-
\ 'Close': function('s:NvimClose'),
690-
\ 'Notify': function('s:NvimNotify'),
691-
\ 'Request': function('s:NvimRequest'),
692-
\ 'Attach': function('s:NvimAttach'),
693-
\ 'IsAttached': function('s:NvimIsAttached'),
694-
\ })
678+
\ 'Close': function('s:NvimClose'),
679+
\ 'Notify': function('s:NvimNotify'),
680+
\ 'Request': function('s:NvimRequest'),
681+
\ 'Attach': function('s:NvimAttach'),
682+
\ 'IsAttached': function('s:NvimIsAttached'),
683+
\ })
695684
let instance.client_id = eval("v:lua.require'_copilot'.lsp_start_client(command, keys(instance.methods), opts, settings)")
696685
let instance.id = instance.client_id
697686
else
698687
call extend(instance, {
699-
\ 'Close': function('s:VimClose'),
700-
\ 'Notify': function('s:VimNotify'),
701-
\ 'Attach': function('s:VimAttach'),
702-
\ 'IsAttached': function('s:VimIsAttached'),
703-
\ })
688+
\ 'Close': function('s:VimClose'),
689+
\ 'Notify': function('s:VimNotify'),
690+
\ 'Attach': function('s:VimAttach'),
691+
\ 'IsAttached': function('s:VimIsAttached'),
692+
\ })
704693
let state = {'headers': {}, 'mode': 'headers', 'buffer': ''}
705694
let instance.open_buffers = {}
706695
let instance.methods = extend(s:vim_handlers, instance.methods)

autoload/copilot/version.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function! copilot#version#String() abort
2-
return '1.38.0'
2+
return '1.39.0'
33
endfunction

dist/crypt32.node

5.18 KB
Binary file not shown.

dist/language-server.js

+302-321
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/language-server.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)