File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ function! OmniSharp#Complete(findstart, base) abort
5757endfunction
5858
5959
60+ function ! OmniSharp#CompleteRunningSln (arglead, cmdline, cursorpos) abort
61+ let jobs = OmniSharp#proc#ListRunningJobs ()
62+ return filter (jobs, {_,job - > job = ~? a: arglead })
63+ endfunction
64+
65+
6066function ! OmniSharp#IsAnyServerRunning () abort
6167 return ! empty (OmniSharp#proc#ListRunningJobs ())
6268endfunction
@@ -208,7 +214,7 @@ endfunction
208214
209215function ! OmniSharp#StopServer (... ) abort
210216 let force = a: 0 ? a: 1 : 0
211- let sln_or_dir = a: 0 > 1 ? a: 2 : OmniSharp#FindSolutionOrDir ()
217+ let sln_or_dir = a: 0 > 1 && len ( a: 2 ) > 0 ? a: 2 : OmniSharp#FindSolutionOrDir ()
212218 if force || OmniSharp#proc#IsJobRunning (sln_or_dir)
213219 if ! g: OmniSharp_server_stdio
214220 call OmniSharp#py#Uncache (sln_or_dir)
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ command! -buffer -bar OmniSharpRestartAllServers call OmniSharp#RestartAllServer
2424command ! - buffer - bar OmniSharpRestartServer call OmniSharp#RestartServer ()
2525command ! - buffer - bar -nargs =? -complete =file OmniSharpStartServer call OmniSharp#StartServer (<q-args> )
2626command ! - buffer - bar OmniSharpStopAllServers call OmniSharp#StopAllServers ()
27- command ! - buffer - bar OmniSharpStopServer call OmniSharp#StopServer ()
27+ command ! - buffer - bar - nargs =? - bang - complete = customlist ,OmniSharp#CompleteRunningSln OmniSharpStopServer call OmniSharp#StopServer (<bang> 0 , <q-args> )
2828
2929command ! - buffer - bar OmniSharpCodeFormat call OmniSharp#actions#format#Format ()
3030command ! - buffer - bar OmniSharpDocumentation call OmniSharp#actions#documentation#Documentation ()
You can’t perform that action at this time.
0 commit comments