I broke up with neovim....vim is my best friend now
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
function! lsp#callbag#pipe(source, filter, sink) abort
|
||||
let s:Filter = a:filter
|
||||
let s:Next = a:sink.next
|
||||
return {-> extend(s:, {'disposed': v:true})}
|
||||
endfunction
|
||||
|
||||
function! lsp#callbag#filter(pred) abort
|
||||
return a:pred
|
||||
endfunction
|
||||
|
||||
function! lsp#callbag#subscribe(sink) abort
|
||||
return a:sink
|
||||
endfunction
|
||||
|
||||
" Functions for tests
|
||||
|
||||
function! lsp#callbag#piped() abort
|
||||
return s:Filter isnot v:null && s:Next isnot v:null
|
||||
endfunction
|
||||
|
||||
function! lsp#callbag#disposed() abort
|
||||
return s:disposed
|
||||
endfunction
|
||||
|
||||
function! lsp#callbag#reset() abort
|
||||
let s:Filter = v:null
|
||||
let s:Next = v:null
|
||||
let s:disposed = v:false
|
||||
endfunction
|
||||
|
||||
function! lsp#callbag#mock_receive(res) abort
|
||||
if s:Filter(a:res)
|
||||
call s:Next(a:res)
|
||||
endif
|
||||
endfunction
|
||||
@@ -0,0 +1,7 @@
|
||||
function! lsp#internal#diagnostics#state#_is_enabled_for_buffer(bufnr) abort
|
||||
return a:bufnr == g:lsp_ale_test_mock_bufnr
|
||||
endfunction
|
||||
|
||||
function! lsp#internal#diagnostics#state#_get_all_diagnostics_grouped_by_server_for_uri(uri) abort
|
||||
return g:lsp_ale_test_mock_diags
|
||||
endfunction
|
||||
@@ -0,0 +1,19 @@
|
||||
function! lsp#ui#vim#utils#diagnostics_to_loc_list(res) abort
|
||||
if len(s:loclists) == 0
|
||||
return []
|
||||
endif
|
||||
|
||||
let ret = s:loclists[0]
|
||||
let s:loclists = s:loclists[1:]
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
function! lsp#ui#vim#utils#mock_diagnostics_to_loc_list(loclists) abort
|
||||
let s:loclists = copy(a:loclists)
|
||||
endfunction
|
||||
|
||||
function! lsp#ui#vim#utils#reset() abort
|
||||
let s:loclists = []
|
||||
endfunction
|
||||
|
||||
call lsp#ui#vim#utils#reset()
|
||||
@@ -0,0 +1,11 @@
|
||||
function! lsp#utils#get_buffer_uri(bufnr) abort
|
||||
return 'file://' . s:bufname
|
||||
endfunction
|
||||
|
||||
function! lsp#utils#uri_to_path(uri) abort
|
||||
return s:bufname
|
||||
endfunction
|
||||
|
||||
function! lsp#utils#mock_buf_name(name) abort
|
||||
let s:bufname = a:name
|
||||
endfunction
|
||||
Reference in New Issue
Block a user