comparison autoload/gutentags.vim @ 250:d264db0126c2

Print jobs' stdout and stderr separately to help troubleshooting.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 25 Oct 2019 23:48:08 -0700
parents 97723c1818e0
children e61d20280c6c
comparison
equal deleted inserted replaced
249:36dabe30ab6e 250:d264db0126c2
576 echom "gutentags: Now running gutentags for real." 576 echom "gutentags: Now running gutentags for real."
577 endif 577 endif
578 echom "" 578 echom ""
579 endfunction 579 endfunction
580 580
581 function! gutentags#default_io_cb(chan, msg) abort 581 function! gutentags#default_stdout_cb(chan, msg) abort
582 call gutentags#trace('[job output]: '.string(a:msg)) 582 call gutentags#trace('[job stdout]: '.string(a:msg))
583 endfunction
584
585 function! gutentags#default_stderr_cb(chan, msg) abort
586 call gutentags#trace('[job stderr]: '.string(a:msg))
583 endfunction 587 endfunction
584 588
585 if has('nvim') 589 if has('nvim')
586 " Neovim job API. 590 " Neovim job API.
587 function! s:nvim_job_exit_wrapper(real_cb, job, exit_code, event_type) abort 591 function! s:nvim_job_exit_wrapper(real_cb, job, exit_code, event_type) abort
598 \'on_exit': function( 602 \'on_exit': function(
599 \ '<SID>nvim_job_exit_wrapper', 603 \ '<SID>nvim_job_exit_wrapper',
600 \ ['gutentags#'.a:module.'#on_job_exit']), 604 \ ['gutentags#'.a:module.'#on_job_exit']),
601 \'on_stdout': function( 605 \'on_stdout': function(
602 \ '<SID>nvim_job_out_wrapper', 606 \ '<SID>nvim_job_out_wrapper',
603 \ ['gutentags#default_io_cb']), 607 \ ['gutentags#default_stdout_cb']),
604 \'on_stderr': function( 608 \'on_stderr': function(
605 \ '<SID>nvim_job_out_wrapper', 609 \ '<SID>nvim_job_out_wrapper',
606 \ ['gutentags#default_io_cb']) 610 \ ['gutentags#default_stderr_cb'])
607 \} 611 \}
608 return l:job_opts 612 return l:job_opts
609 endfunction 613 endfunction
610 614
611 function! gutentags#start_job(cmd, opts) abort 615 function! gutentags#start_job(cmd, opts) abort
614 else 618 else
615 " Vim8 job API. 619 " Vim8 job API.
616 function! gutentags#build_default_job_options(module) abort 620 function! gutentags#build_default_job_options(module) abort
617 let l:job_opts = { 621 let l:job_opts = {
618 \'exit_cb': 'gutentags#'.a:module.'#on_job_exit', 622 \'exit_cb': 'gutentags#'.a:module.'#on_job_exit',
619 \'out_cb': 'gutentags#default_io_cb', 623 \'out_cb': 'gutentags#default_stdout_cb',
620 \'err_cb': 'gutentags#default_io_cb', 624 \'err_cb': 'gutentags#default_stderr_cb',
621 \'stoponexit': 'term' 625 \'stoponexit': 'term'
622 \} 626 \}
623 return l:job_opts 627 return l:job_opts
624 endfunction 628 endfunction
625 629