Skip to content

Commit 719dd8d

Browse files
committed
Copilot.vim 1.10.2
1 parent 1729557 commit 719dd8d

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
*.vim eol=lf
2-
/dist/* -whitespace -diff
2+
/dist/** -whitespace -diff

autoload/copilot.vim

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ function! copilot#RunningAgent() abort
8888
endif
8989
endfunction
9090

91+
function! s:NodeVersionWarning() abort
92+
if exists('s:agent.node_version') && s:agent.node_version =~# '^16\.'
93+
echohl WarningMsg
94+
echo "Warning: Node.js 16 is approaching end of life and support will be dropped in a future release of copilot.vim."
95+
if get(g:, 'copilot_node_command', 'node') isnot# 'node'
96+
echo "g:copilot_node_command is set to a non-default value. Consider removing it from your" (has('nvim') ? 'Neovim' : 'Vim') "configuration."
97+
endif
98+
echohl NONE
99+
endif
100+
endfunction
101+
91102
function! copilot#Request(method, params, ...) abort
92103
let agent = copilot#Agent()
93104
return call(agent.Request, [a:method, a:params] + a:000)
@@ -395,11 +406,10 @@ function! copilot#IsMapped() abort
395406
return get(g:, 'copilot_assume_mapped') ||
396407
\ hasmapto('copilot#Accept(', 'i')
397408
endfunction
398-
let s:is_mapped = copilot#IsMapped()
399409

400410
function! copilot#Schedule(...) abort
401411
call copilot#Clear()
402-
if !s:is_mapped || !s:has_ghost_text || !copilot#Enabled()
412+
if !s:has_ghost_text || !copilot#Enabled() || !copilot#IsMapped()
403413
return
404414
endif
405415
let delay = a:0 ? a:1 : get(g:, 'copilot_idle_delay', 75)
@@ -568,6 +578,7 @@ function! s:commands.status(opts) abort
568578
endif
569579

570580
echo 'Copilot: Enabled and online'
581+
call s:NodeVersionWarning()
571582
endfunction
572583

573584
function! s:commands.signout(opts) abort
@@ -662,6 +673,7 @@ function! s:commands.version(opts) abort
662673
if exists('s:agent.node_version')
663674
echo 'dist/agent.js ' . s:agent.Call('getVersion', {}).version
664675
echo 'Node.js ' . s:agent.node_version
676+
call s:NodeVersionWarning()
665677
else
666678
echo 'dist/agent.js not running'
667679
endif

autoload/copilot/agent.vim

Lines changed: 1 addition & 1 deletion
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.10.1'
8+
let s:plugin_version = '1.10.2'
99

1010
let s:error_exit = -1
1111

dist/agent.js

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

dist/agent.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)