Skip to content

Commit 22fd954

Browse files
committed
Copilot.vim 1.17.0
1 parent a8142d4 commit 22fd954

File tree

9 files changed

+229
-222
lines changed

9 files changed

+229
-222
lines changed

autoload/copilot.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ function! s:commands.setup(opts) abort
641641

642642
let status = copilot#Call('checkStatus', {})
643643
if has_key(status, 'user')
644-
let data = {}
644+
let data = {'status': 'AlreadySignedIn', 'user': status.user}
645645
else
646646
let data = copilot#Call('signInInitiate', {})
647647
endif
@@ -692,6 +692,8 @@ function! s:commands.setup(opts) abort
692692
else
693693
let status = request.result
694694
endif
695+
elseif get(data, 'status', '') isnot# 'AlreadySignedIn'
696+
return 'echoerr ' . string('Copilot: Something went wrong')
695697
endif
696698

697699
let user = get(status, 'user', '<unknown>')

autoload/copilot/agent.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function! s:RequestAwait() dict abort
8181
if has_key(self, 'result')
8282
return self.result
8383
endif
84-
throw 'copilot#agent:E' . self.error.code . ': ' . self.error.message
84+
throw 'Copilot:E' . self.error.code . ': ' . self.error.message
8585
endfunction
8686

8787
function! s:RequestAgent() dict abort
@@ -464,6 +464,9 @@ function! copilot#agent#EditorInfo() abort
464464
let info.networkProxy.password = s:UrlDecode(matchstr(match[1], ':\zs[^@]*'))
465465
endif
466466
endif
467+
if type(get(g:, 'copilot_auth_provider_url')) == v:t_string
468+
let info.authProvider = {'url': g:copilot_auth_provider_url}
469+
endif
467470
return info
468471
endfunction
469472

autoload/copilot/logger.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function! copilot#logger#Exception(...) abort
5353
let [_, type, code, message; __] = matchlist(v:exception, '^\%(\(^[[:alnum:]_#]\+\)\%((\a\+)\)\=\%(\(:E-\=\d\+\)\)\=:\s*\)\=\(.*\)$')
5454
let stacklines = []
5555
for frame in split(substitute(v:throwpoint, ', \S\+ \(\d\+\)$', '[\1]', ''), '\.\@<!\.\.\.\@!')
56-
let fn_line = matchlist(frame, '^\%(function \)\=\(\S\+\)\[\(\d+\)\]$')
56+
let fn_line = matchlist(frame, '^\%(function \)\=\(\S\+\)\[\(\d\+\)\]$')
5757
if !empty(fn_line)
5858
call add(stacklines, {'function': substitute(fn_line[1], '^<SNR>\d\+_', '<SID>', ''), 'lineno': +fn_line[2]})
5959
elseif frame =~# ' Autocmds for "\*"$'

autoload/copilot/version.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function! copilot#version#String() abort
2-
return '1.16.0'
2+
return '1.17.0'
33
endfunction

dist/agent.js

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

dist/agent.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
18.3 KB
Binary file not shown.
19.4 KB
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)