@@ -231,7 +231,7 @@ pub trait ILanguageClient: IVim {
231
231
lines. pop ( ) ;
232
232
}
233
233
self . command ( "1,$d" ) ?;
234
- if self . call ( None , "setline" , json ! ( [ 1 , lines] ) ) ? != 0 {
234
+ if self . call :: < _ , i64 > ( None , "setline" , json ! ( [ 1 , lines] ) ) ? != 0 {
235
235
bail ! ( "Failed to set preview buffer content!" ) ;
236
236
}
237
237
debug ! ( "End apply TextEdits" ) ;
@@ -313,10 +313,14 @@ pub trait ILanguageClient: IVim {
313
313
314
314
match self . get ( |state| Ok ( state. diagnosticsList . clone ( ) ) ) ? {
315
315
DiagnosticsList :: Quickfix => {
316
- self . call ( None , "setqflist" , [ qflist] ) ?;
316
+ if self . call :: < _ , i64 > ( None , "setqflist" , [ qflist] ) ? != 0 {
317
+ bail ! ( "Failed to set quickfix list!" ) ;
318
+ }
317
319
}
318
320
DiagnosticsList :: Location => {
319
- self . call ( None , "setloclist" , json ! ( [ 0 , qflist] ) ) ?;
321
+ if self . call :: < _ , i64 > ( None , "setloclist" , json ! ( [ 0 , qflist] ) ) ? != 0 {
322
+ bail ! ( "Failed to set location list!" ) ;
323
+ }
320
324
}
321
325
}
322
326
@@ -342,7 +346,7 @@ pub trait ILanguageClient: IVim {
342
346
343
347
// Highlight.
344
348
// TODO: Optimize.
345
- self . call ( None , "nvim_buf_clear_highlight" , json ! ( [ 0 , source, 1 , -1 ] ) ) ?;
349
+ self . notify ( None , "nvim_buf_clear_highlight" , json ! ( [ 0 , source, 1 , -1 ] ) ) ?;
346
350
for dn in diagnostics. iter ( ) {
347
351
let severity = dn. severity . unwrap_or ( DiagnosticSeverity :: Information ) ;
348
352
let hl_group = diagnosticsDisplay
@@ -542,7 +546,7 @@ pub trait ILanguageClient: IVim {
542
546
. ok_or_else ( || err_msg ( "No highlight source" ) )
543
547
} ) ;
544
548
if let Ok ( hlsource) = hlsource {
545
- self . call (
549
+ self . notify (
546
550
None ,
547
551
"nvim_buf_clear_highlight" ,
548
552
json ! ( [ 0 , hlsource, 1 , -1 ] ) ,
@@ -568,7 +572,7 @@ pub trait ILanguageClient: IVim {
568
572
if self . get ( |state| Ok ( state. is_nvim ) ) ? {
569
573
let bufnr: u64 = serde_json:: from_value ( self . call ( None , "bufnr" , bufname) ?) ?;
570
574
self . notify ( None , "nvim_buf_set_lines" , json ! ( [ bufnr, 0 , -1 , 0 , lines] ) ) ?;
571
- } else if self . call ( None , "setbufline" , json ! ( [ bufname, 1 , lines] ) ) ? != 0 {
575
+ } else if self . call :: < _ , i64 > ( None , "setbufline" , json ! ( [ bufname, 1 , lines] ) ) ? != 0 {
572
576
bail ! ( "Failed to set preview buffer content!" ) ;
573
577
// TODO: removing existing bottom lines.
574
578
}
@@ -625,7 +629,7 @@ pub trait ILanguageClient: IVim {
625
629
626
630
let trace = self . get ( |state| Ok ( state. trace . clone ( ) ) ) ?;
627
631
628
- let result = self . call (
632
+ let result: Value = self . call (
629
633
Some ( & languageId) ,
630
634
lsp:: request:: Initialize :: METHOD ,
631
635
InitializeParams {
0 commit comments