Skip to content

Commit 1ceae02

Browse files
committed
Simplify s:Request with explicit arguments
1 parent 226cfbc commit 1ceae02

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

autoload/OmniSharp/stdio.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function! OmniSharp#stdio#Request(command, opts) abort
199199
let sep = ''
200200
endif
201201

202-
call s:Request(job, body, a:command, a:opts, sep)
202+
call s:Request(job, body, a:command, a:opts, sep, bufnr)
203203

204204
if has_key(a:opts, 'ReplayOnLoad')
205205
let replay_opts = filter(copy(a:opts), 'v:key !=# "ReplayOnLoad"')
@@ -210,10 +210,10 @@ function! OmniSharp#stdio#Request(command, opts) abort
210210
endfunction
211211

212212
function! OmniSharp#stdio#RequestGlobal(job, command, opts) abort
213-
call s:Request(a:job, {}, a:command, a:opts)
213+
call s:Request(a:job, {}, a:command, a:opts, '', -1)
214214
endfunction
215215

216-
function! s:Request(job, body, command, opts, ...) abort
216+
function! s:Request(job, body, command, opts, sep, bufnr) abort
217217
call OmniSharp#log#Log(a:job, 'Request: ' . a:command, 1)
218218

219219
let a:body['Command'] = a:command
@@ -222,14 +222,14 @@ function! s:Request(job, body, command, opts, ...) abort
222222
if has_key(a:opts, 'Parameters')
223223
call extend(a:body.Arguments, a:opts.Parameters, 'force')
224224
endif
225-
let sep = a:0 ? a:1 : ''
226-
if sep !=# ''
227-
let encodedBody = substitute(json_encode(a:body), sep, '\\r\\n', 'g')
225+
if a:sep !=# ''
226+
let encodedBody = substitute(json_encode(a:body), a:sep, '\\r\\n', 'g')
228227
else
229228
let encodedBody = json_encode(a:body)
230229
endif
231230

232231
let s:requests[s:nextseq] = {
232+
\ 'BufNum': a:bufnr,
233233
\ 'Command': a:command,
234234
\ 'Seq': s:nextseq,
235235
\ 'StartTime': reltime()

0 commit comments

Comments
 (0)