Skip to content

Commit

Permalink
fix get_text_document_save_registration_options
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed Aug 27, 2017
1 parent 41da621 commit bab6364
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions autoload/lsp/capabilities.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ endfunction
" [supports_did_save (boolean), { 'includeText': boolean }]
function! lsp#capabilities#get_text_document_save_registration_options(server_name) abort
let l:capabilities = lsp#get_server_capabilities(a:server_name)
if !empty(l:capabilities) && has_key(l:capabilities, 'textDocumentSync') && type(l:capabilities['textDocumentSync']) == type({})
if has_key(l:capabilities['textDocumentSync'], 'save')
return [1, {
\ 'includeText': has_key(l:capabilities['textDocumentSync']['save'], 'includeText') ? l:capabilities['textDocumentSync']['save']['includeText'] : 0,
\ }]
if !empty(l:capabilities) && has_key(l:capabilities, 'textDocumentSync')
if type(l:capabilities['textDocumentSync']) == type({})
if has_key(l:capabilities['textDocumentSync'], 'save')
return [1, {
\ 'includeText': has_key(l:capabilities['textDocumentSync']['save'], 'includeText') ? l:capabilities['textDocumentSync']['save']['includeText'] : 0,
\ }]
else
return [1, { 'includeText': 0 }]
endif
else
return [1, { 'includeText': 0 }]
endif
endif
return [0, {}]
return [0, { 'includeText': 0 }]
endfunction

0 comments on commit bab6364

Please sign in to comment.