Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed Jan 1, 2021
1 parent 5ae4f8a commit 1828e59
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions autoload/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ function! s:on_notification(server_name, id, data, event) abort

if lsp#client#is_server_instantiated_notification(a:data)
if has_key(l:response, 'method')
if a:data['response']['method'] ==# 'textDocument/publishDiagnostics'
echom json_encode(['old', a:data['response']])
call lsp#log('pubdiag', a:data['response'])
endif
if g:lsp_diagnostics_enabled && l:lsp_diagnostics_config_enabled && l:response['method'] ==# 'textDocument/publishDiagnostics'
call lsp#ui#vim#diagnostics#handle_text_document_publish_diagnostics(a:server_name, a:data)
elseif l:response['method'] ==# 'textDocument/semanticHighlighting'
Expand Down Expand Up @@ -981,6 +985,7 @@ function! lsp#stream(...) abort
if a:0 == 0
return lsp#callbag#share(s:Stream)
else
call lsp#log('streamv', a:1, a:2)
call s:Stream(a:1, a:2)
endif
endfunction
Expand Down
1 change: 1 addition & 0 deletions autoload/lsp/internal/diagnostics/state.vim
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function! lsp#internal#diagnostics#state#_get_all_diagnostics_grouped_by_uri_and
endfunction

function! s:on_text_documentation_publish_diagnostics(server, response) abort
echom json_encode(['new', a:response])
if lsp#client#is_error(a:response) | return | endif
let l:normalized_uri = lsp#utils#normalize_uri(a:response['params']['uri'])
if !has_key(s:diagnostics_state, l:normalized_uri)
Expand Down
1 change: 1 addition & 0 deletions autoload/lsp/internal/document_formatting.vim
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function! lsp#internal#document_formatting#format(options) abort
\ )),
\ lsp#callbag#toList(),
\ ).wait({ 'sleep': get(a:options, 'sleep', 1), 'timeout': get(a:options, 'timeout', g:lsp_format_sync_timeout) })
echom json_encode(['xformat', l:x])
call s:format_next(l:x[0])
call s:format_complete()
catch
Expand Down
5 changes: 5 additions & 0 deletions autoload/lsp/ui/vim/diagnostics.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function! lsp#ui#vim#diagnostics#handle_text_document_publish_diagnostics(server
if lsp#client#is_error(a:data['response'])
return
endif
echom json_encode(['old', a:data['response']])
let l:uri = a:data['response']['params']['uri']
let l:uri = lsp#utils#normalize_uri(l:uri)
if !has_key(s:diagnostics, l:uri)
Expand Down Expand Up @@ -220,6 +221,10 @@ function! s:get_diagnostics(uri) abort
return [0, {}]
endfunction

function! lsp#ui#vim#diagnostics#get_all() abort
return s:get_all_buffer_diagnostics()
endfunction

" Get diagnostics for the current buffer URI from all servers
function! s:get_all_buffer_diagnostics(...) abort
let l:target_server_name = get(a:000, 0, '')
Expand Down
1 change: 0 additions & 1 deletion test/testproject-rust/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod calc;

mod documentdefinition;
mod documentformat;

fn main() {
Expand Down

0 comments on commit 1828e59

Please # to comment.