@@ -4,8 +4,8 @@ set cpoptions&vim
4
4
" Accepts a Funcref callback argument, to be called after the response is
5
5
" returned (synchronously or asynchronously) with the results
6
6
function ! OmniSharp#actions#diagnostics#Check (... ) abort
7
- let opts = a: 0 && a: 1 isnot 0 ? { ' Callback' : a: 1 } : {}
8
7
if bufname (' %' ) == # ' ' || OmniSharp#FugitiveCheck () | return [] | endif
8
+ let opts = a: 0 && a: 1 isnot 0 ? { ' Callback' : a: 1 } : {}
9
9
if pumvisible () || ! OmniSharp#IsServerRunning ()
10
10
let b: codecheck = get (b: , ' codecheck' , [])
11
11
if has_key (opts, ' Callback' )
@@ -23,11 +23,18 @@ function! OmniSharp#actions#diagnostics#Check(...) abort
23
23
endif
24
24
endfunction
25
25
26
+ " Find all solution/project diagnostics and populate the quickfix list.
27
+ " Optional argument:
28
+ " Callback: When a callback is passed in, the diagnostics will be sent to
29
+ " the callback *instead of* to the quickfix list.
26
30
function ! OmniSharp#actions#diagnostics#CheckGlobal (... ) abort
27
31
if bufname (' %' ) == # ' ' || OmniSharp#FugitiveCheck () | return [] | endif
28
- " Place the results in the quickfix window, if possible
29
- if g: OmniSharp_server_stdio
32
+ if a: 0 && a: 1 isnot 0
33
+ let Callback = a: 1
34
+ else
30
35
let Callback = function (' s:CBGlobalCodeCheck' )
36
+ endif
37
+ if g: OmniSharp_server_stdio
31
38
let opts = {
32
39
\ ' ResponseHandler' : function (' s:StdioCheckRH' , [Callback])
33
40
\}
@@ -36,7 +43,7 @@ function! OmniSharp#actions#diagnostics#CheckGlobal(...) abort
36
43
else
37
44
let quickfixes = OmniSharp#py#Eval (' globalCodeCheck()' )
38
45
if OmniSharp#py#CheckForError () | return | endif
39
- call s: CBGlobalCodeCheck (quickfixes)
46
+ call Callback (quickfixes)
40
47
endif
41
48
endfunction
42
49
0 commit comments