Skip to content

Commit 0bf3c3b

Browse files
committed
fix
1 parent 424b562 commit 0bf3c3b

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

settings/copilot-language-server.vim

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ function! s:handle_finish(data) abort
1818
echomsg l:command['status']
1919
endfunction
2020

21-
function! s:handle_singin(data) abort
21+
function! s:handle_signin(data) abort
2222
let l:command = a:data['response']['result']
23-
echomsg printf('Set %s on %s', l:command['userCode'], l:command['verificationUri'])
24-
call getchar()
23+
while getchar() !=# 13
24+
echomsg printf('Set %s on %s then type ENTER', l:command['userCode'], l:command['verificationUri'])
25+
endwhile
2526
call lsp#send_request('copilot-language-server', {
2627
\ 'method': 'workspace/executeCommand',
2728
\ 'params': {'command': 'github.copilot.finishDeviceFlow', 'arguments': []},
@@ -30,14 +31,24 @@ function! s:handle_singin(data) abort
3031
\ })
3132
endfunction
3233

34+
function! s:handle_signout(data) abort
35+
let l:command = a:data['response']['result']
36+
echomsg l:command['status']
37+
endfunction
38+
3339
function! s:on_lsp_buffer_enabled() abort
3440
command! -buffer -nargs=0 CopilotSignIn call lsp#send_request('copilot-language-server', {
3541
\ 'method': 'signIn',
36-
\ 'params': {'command': 'github.copilot.signin', 'arguments': []},
42+
\ 'params': {},
3743
\ 'sync': v:false,
3844
\ 'on_notification': function('s:handle_signin'),
3945
\ })
40-
46+
command! -buffer -nargs=0 CopilotSignOut call lsp#send_request('copilot-language-server', {
47+
\ 'method': 'signOut',
48+
\ 'params': {},
49+
\ 'sync': v:false,
50+
\ 'on_notification': function('s:handle_signout'),
51+
\ })
4152
endfunction
4253

4354
augroup lsp_install_copilot

0 commit comments

Comments
 (0)