Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8f24a74

Browse files
committed
Copilot.vim 1.21.0
1 parent4d32b06 commit8f24a74

File tree

12 files changed

+467
-320
lines changed

12 files changed

+467
-320
lines changed

‎autoload/copilot.vim

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ function! copilot#RunningAgent() abort
8484
endfunction
8585

8686
function!s:NodeVersionWarning()abort
87-
ifexists('s:agent.node_version')&&s:agent.node_version=~#'^16\.'
87+
ifexists('s:agent.node_version')&&s:agent.node_version=~#'^1[67]\.'
8888
echohlWarningMsg
89-
echo"Warning: Node.js 16isapproachingend oflife 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."
9090
echohlNONE
9191
elseifexists('s:agent.node_version_warning')
9292
echohlWarningMsg
@@ -95,6 +95,20 @@ function! s:NodeVersionWarning() abort
9595
endif
9696
endfunction
9797

98+
ifhas('nvim-0.6')&&!has(luaeval('vim.version().api_prerelease') ?'nvim-0.7.1' :'nvim-0.7.0')
99+
lets:editor_warning='Neovim 0.6 support is deprecated and will be dropped in a future release of copilot.vim.'
100+
endif
101+
ifhas('vim_starting')&&exists('s:editor_warning')
102+
callcopilot#logger#Warn(s:editor_warning)
103+
endif
104+
function!s:EditorVersionWarning()abort
105+
ifexists('s:editor_warning')
106+
echohlWarningMsg
107+
echo'Warning:' .s:editor_warning
108+
echohl None
109+
endif
110+
endfunction
111+
98112
function!copilot#Request(method, params,...)abort
99113
let agent=copilot#Agent()
100114
returncall(agent.Request, [a:method,a:params]+a:000)
@@ -192,6 +206,12 @@ function! copilot#Complete(...) abort
192206
endif
193207
let params=copilot#doc#Params()
194208
if!exists('b:_copilot.params')||b:_copilot.params!=# params
209+
ifexists('b:_copilot.first')
210+
callcopilot#agent#Cancel(b:_copilot.first)
211+
endif
212+
ifexists('b:_copilot.cycling')
213+
callcopilot#agent#Cancel(b:_copilot.cycling)
214+
endif
195215
letb:_copilot= {'params': params,'first':
196216
\copilot#Request('getCompletions', params)}
197217
letg:_copilot_last=b:_copilot
@@ -598,6 +618,7 @@ function! s:commands.status(opts) abort
598618
endif
599619

600620
echo'Copilot: Enabled and online'
621+
calls:EditorVersionWarning()
601622
calls:NodeVersionWarning()
602623
endfunction
603624

@@ -642,7 +663,7 @@ function! s:commands.setup(opts) abort
642663
ifget(a:opts,'bang')
643664
calls:Echo(codemsg ."In your browser, visit" . uri)
644665
elseiflen(browser)
645-
callinput(codemsg ."Press ENTER to open GitHub in your browser")
666+
callinput(codemsg ."Press ENTER to open GitHub in your browser\n")
646667
let status= {}
647668
callcopilot#job#Stream(browser+ [uri],v:null,v:null,function('s:BrowserCallback', [status]))
648669
let time=reltime()
@@ -679,6 +700,7 @@ function! s:commands.setup(opts) abort
679700
endfunction
680701

681702
lets:commands.auth=s:commands.setup
703+
lets:commands.signin=s:commands.setup
682704

683705
function!s:commands.help(opts)abort
684706
returna:opts.mods .' help' . (len(a:opts.arg) ?':Copilot_' .a:opts.arg :'copilot')
@@ -700,10 +722,25 @@ function! s:commands.version(opts) abort
700722
else
701723
echo'Node.js' .substitute(get(versions.Await(),'runtimeVersion','?'),'^node/','','g')
702724
endif
703-
calls:NodeVersionWarning()
704725
else
705726
echo'Not running'
727+
ifexists('s:agent.node_version')
728+
echo'Node.js' .s:agent.node_version
729+
endif
706730
endif
731+
ifhas('win32')
732+
echo'Windows'
733+
elseifhas('macunix')
734+
echo'macOS'
735+
elseif!has('unix')
736+
echo'Unknown OS'
737+
elseifisdirectory('/sys/kernel')
738+
echo'Linux'
739+
else
740+
echo'UNIX'
741+
endif
742+
calls:EditorVersionWarning()
743+
calls:NodeVersionWarning()
707744
endfunction
708745

709746
function!s:UpdateEditorConfiguration()abort
@@ -764,7 +801,7 @@ function! copilot#Command(line1, line2, range, bang, mods, arg) abort
764801
let cmd=matchstr(a:arg,'^\%(\\.\|\S\)\+')
765802
let arg=matchstr(a:arg,'\s\zs\S.*')
766803
if cmd==#'log'
767-
returna:mods .' split +$' .fnameescape(copilot#logger#File())
804+
returna:mods .' split +$ copilot:///log'
768805
endif
769806
if!empty(cmd)&&!has_key(s:commands,tr(cmd,'-','_'))
770807
return'echoerr' .string('Copilot: unknown command' .string(cmd))
@@ -782,7 +819,7 @@ function! copilot#Command(line1, line2, range, bang, mods, arg) abort
782819
endtry
783820
ifempty(cmd)
784821
if opts.status==#'VimException'
785-
returna:mods .' split +$' .fnameescape(copilot#logger#File())
822+
returna:mods .' split +$ copilot:///log'
786823
elseif opts.status!=#'OK'&& opts.status!=#'MaybeOK'
787824
let cmd='setup'
788825
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp