@@ -7,15 +7,19 @@ set cpoptions&vim
7
7
" the callback *instead of* to the configured selector
8
8
" (g:OmniSharp_selector_findusages) or quickfix list.
9
9
function ! OmniSharp#actions#usages#Find (... ) abort
10
- let opts = a: 0 && a: 1 isnot 0 ? { ' Callback' : a: 1 } : {}
11
- let target = expand (' <cword>' )
10
+ if a: 0 && a: 1 isnot 0
11
+ let Callback = a: 1
12
+ else
13
+ let target = expand (' <cword>' )
14
+ let Callback = function (' s:CBFindUsages' , [target])
15
+ endif
16
+
12
17
if g: OmniSharp_server_stdio
13
- let Callback = function (' s:CBFindUsages' , [target, opts])
14
18
call s: StdioFind (Callback)
15
19
else
16
20
let locs = OmniSharp#py#Eval (' findUsages()' )
17
21
if OmniSharp#py#CheckForError () | return | endif
18
- return s: CBFindUsages (target, opts, locs)
22
+ return Callback ( locs)
19
23
endif
20
24
endfunction
21
25
@@ -39,12 +43,10 @@ function! s:StdioFindRH(Callback, response) abort
39
43
endif
40
44
endfunction
41
45
42
- function ! s: CBFindUsages (target, opts, locations) abort
46
+ function ! s: CBFindUsages (target, locations) abort
43
47
let numUsages = len (a: locations )
44
48
if numUsages == 0
45
49
echo ' No usages found'
46
- elseif has_key (a: opts , ' Callback' )
47
- call a: opts .Callback (a: locations )
48
50
elseif get (g: , ' OmniSharp_selector_findusages' , ' ' ) == ? ' fzf'
49
51
call fzf#OmniSharp#FindUsages (a: locations , a: target )
50
52
elseif get (g: , ' OmniSharp_selector_findusages' , ' ' ) == ? ' clap'
0 commit comments