Skip to content

Commit 80cd62f

Browse files
authored
Support sync option in vim8 native client (#1425)
`additionalTextEdits` was not working with native client because it uses `'sync': 1` which was not handled by the code. This PR gets it working.
1 parent 65628c3 commit 80cd62f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

autoload/lsp/client.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@ function! lsp#client#send_request(client_id, opts) abort
371371
if has_key(a:opts, 'on_notification')
372372
let l:ctx['on_notifications'][l:request['id']] = a:opts['on_notification']
373373
endif
374+
if get(a:opts, 'sync', 0) !=# 0
375+
let l:timeout = get(a:opts, 'sync_timeout', -1)
376+
if lsp#utils#_wait(l:timeout, {-> !has_key(l:ctx['requests'], l:request['id'])}, 1) == -1
377+
throw 'lsp#client#send_request: timeout'
378+
endif
379+
endif
374380
let l:ctx['request_sequence'] = l:request['id']
375381
return l:request['id']
376382
else

0 commit comments

Comments
 (0)