@@ -84,9 +84,9 @@ function! copilot#RunningAgent() abort
84
84
endfunction
85
85
86
86
function ! s: NodeVersionWarning ()abort
87
- if exists (' s:agent.node_version' )&& s: agent .node_version= ~#' ^16 \.'
87
+ if exists (' s:agent.node_version' )&& s: agent .node_version= ~#' ^1[67] \.'
88
88
echohl WarningMsg
89
- echo " Warning: Node.js 16 isapproaching end of life and support will be dropped in a future release of copilot.vim."
89
+ echo " Warning: Node.js" matchstr ( s: agent .node_version, ' ^\d\+ ' ) " is end-of- life and support will be dropped in a future release of copilot.vim."
90
90
echohl NONE
91
91
elseif exists (' s:agent.node_version_warning' )
92
92
echohl WarningMsg
@@ -95,6 +95,20 @@ function! s:NodeVersionWarning() abort
95
95
endif
96
96
endfunction
97
97
98
+ if has (' nvim-0.6' )&& ! has (luaeval (' vim.version().api_prerelease' ) ?' nvim-0.7.1' :' nvim-0.7.0' )
99
+ let s: editor_warning= ' Neovim 0.6 support is deprecated and will be dropped in a future release of copilot.vim.'
100
+ endif
101
+ if has (' vim_starting' )&& exists (' s:editor_warning' )
102
+ call copilot#logger#Warn (s: editor_warning )
103
+ endif
104
+ function ! s: EditorVersionWarning ()abort
105
+ if exists (' s:editor_warning' )
106
+ echohl WarningMsg
107
+ echo ' Warning:' .s: editor_warning
108
+ echohl None
109
+ endif
110
+ endfunction
111
+
98
112
function ! copilot#Request (method, params,... )abort
99
113
let agent= copilot#Agent ()
100
114
return call (agent.Request, [a: method ,a: params ]+ a: 000 )
@@ -192,6 +206,12 @@ function! copilot#Complete(...) abort
192
206
endif
193
207
let params= copilot#doc#Params ()
194
208
if ! exists (' b:_copilot.params' )|| b: _copilot .params!=# params
209
+ if exists (' b:_copilot.first' )
210
+ call copilot#agent#Cancel (b: _copilot .first )
211
+ endif
212
+ if exists (' b:_copilot.cycling' )
213
+ call copilot#agent#Cancel (b: _copilot .cycling)
214
+ endif
195
215
let b: _copilot= {' params' : params,' first' :
196
216
\ copilot#Request (' getCompletions' , params)}
197
217
let g: _copilot_last= b: _copilot
@@ -598,6 +618,7 @@ function! s:commands.status(opts) abort
598
618
endif
599
619
600
620
echo ' Copilot: Enabled and online'
621
+ call s: EditorVersionWarning ()
601
622
call s: NodeVersionWarning ()
602
623
endfunction
603
624
@@ -642,7 +663,7 @@ function! s:commands.setup(opts) abort
642
663
if get (a: opts ,' bang' )
643
664
call s: Echo (codemsg ." In your browser, visit" . uri)
644
665
elseif len (browser)
645
- call input (codemsg ." Press ENTER to open GitHub in your browser" )
666
+ call input (codemsg ." Press ENTER to open GitHub in your browser\n " )
646
667
let status= {}
647
668
call copilot#job#Stream (browser+ [uri],v: null ,v: null ,function (' s:BrowserCallback' , [status]))
648
669
let time= reltime ()
@@ -679,6 +700,7 @@ function! s:commands.setup(opts) abort
679
700
endfunction
680
701
681
702
let s: commands .auth= s: commands .setup
703
+ let s: commands .signin= s: commands .setup
682
704
683
705
function ! s: commands .help (opts)abort
684
706
return a: opts .mods .' help' . (len (a: opts .arg) ?' :Copilot_' .a: opts .arg :' copilot' )
@@ -700,10 +722,25 @@ function! s:commands.version(opts) abort
700
722
else
701
723
echo ' Node.js' .substitute (get (versions.Await (),' runtimeVersion' ,' ?' ),' ^node/' ,' ' ,' g' )
702
724
endif
703
- call s: NodeVersionWarning ()
704
725
else
705
726
echo ' Not running'
727
+ if exists (' s:agent.node_version' )
728
+ echo ' Node.js' .s: agent .node_version
729
+ endif
706
730
endif
731
+ if has (' win32' )
732
+ echo ' Windows'
733
+ elseif has (' macunix' )
734
+ echo ' macOS'
735
+ elseif ! has (' unix' )
736
+ echo ' Unknown OS'
737
+ elseif isdirectory (' /sys/kernel' )
738
+ echo ' Linux'
739
+ else
740
+ echo ' UNIX'
741
+ endif
742
+ call s: EditorVersionWarning ()
743
+ call s: NodeVersionWarning ()
707
744
endfunction
708
745
709
746
function ! s: UpdateEditorConfiguration ()abort
@@ -764,7 +801,7 @@ function! copilot#Command(line1, line2, range, bang, mods, arg) abort
764
801
let cmd= matchstr (a: arg ,' ^\%(\\.\|\S\)\+' )
765
802
let arg= matchstr (a: arg ,' \s\zs\S.*' )
766
803
if cmd== #' log'
767
- return a: mods .' split +$' . fnameescape ( copilot#logger#File ())
804
+ return a: mods .' split +$ copilot:///log '
768
805
endif
769
806
if ! empty (cmd)&& ! has_key (s: commands ,tr (cmd,' -' ,' _' ))
770
807
return ' echoerr' .string (' Copilot: unknown command' .string (cmd))
@@ -782,7 +819,7 @@ function! copilot#Command(line1, line2, range, bang, mods, arg) abort
782
819
endtry
783
820
if empty (cmd)
784
821
if opts.status== #' VimException'
785
- return a: mods .' split +$' . fnameescape ( copilot#logger#File ())
822
+ return a: mods .' split +$ copilot:///log '
786
823
elseif opts.status!=# ' OK' && opts.status!=# ' MaybeOK'
787
824
let cmd= ' setup'
788
825
else