mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-17 12:00:29 +01:00
fix signin
This commit is contained in:
@@ -13,25 +13,29 @@ augroup vim_lsp_settings_copilot_language_server
|
|||||||
\ }
|
\ }
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
function! s:handle_execute_command(data) abort
|
function! s:handle_finish(data) abort
|
||||||
echom json_encode(a:data)
|
let l:command = a:data['response']['result']
|
||||||
"if lsp#client#is_error(a:data['response'])
|
echomsg l:command['status']
|
||||||
" call lsp#utils#error('Execute command failed on ' . a:server_name . ': ' . string(a:command) . ' -> ' . string(a:data))
|
|
||||||
"endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_lsp_buffer_enabled() abort
|
function! s:handle_singin(data) abort
|
||||||
command! -buffer -nargs=0 CopilotFinishDeviceFlow call lsp#send_request('copilot-language-server', {
|
let l:command = a:data['response']['result']
|
||||||
|
echomsg printf('Set %s on %s', l:command['userCode'], l:command['verificationUri'])
|
||||||
|
call getchar()
|
||||||
|
call lsp#send_request('copilot-language-server', {
|
||||||
\ 'method': 'workspace/executeCommand',
|
\ 'method': 'workspace/executeCommand',
|
||||||
\ 'params': {'command': 'github.copilot.finishDeviceFlow', 'arguments': []},
|
\ 'params': {'command': 'github.copilot.finishDeviceFlow', 'arguments': []},
|
||||||
\ 'sync': v:false,
|
\ 'sync': v:false,
|
||||||
\ 'on_notification': function('s:handle_execute_command'),
|
\ 'on_notification': function('s:handle_finish'),
|
||||||
\ })
|
\ })
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:on_lsp_buffer_enabled() abort
|
||||||
command! -buffer -nargs=0 CopilotSignIn call lsp#send_request('copilot-language-server', {
|
command! -buffer -nargs=0 CopilotSignIn call lsp#send_request('copilot-language-server', {
|
||||||
\ 'method': 'workspace/executeCommand',
|
\ 'method': 'workspace/executeCommand',
|
||||||
\ 'params': {'command': 'github.copilot.signIn', 'arguments': []},
|
\ 'params': {'command': 'github.copilot.signIn', 'arguments': []},
|
||||||
\ 'sync': v:false,
|
\ 'sync': v:false,
|
||||||
\ 'on_notification': function('s:handle_execute_command'),
|
\ 'on_notification': function('s:handle_signin'),
|
||||||
\ })
|
\ })
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user