File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,17 +130,24 @@ function! codequery#make_codequery_db(args) abort
130130 continue
131131 endif
132132
133- " TODO: Rewrite it when Vim8 is coming
134- " ----------------------------------------------------------------
135- if exists (' :Start' )
133+ if v: version >= 800
134+ echom ' Making ...'
135+ let mydict = {' db_path' : db_path,
136+ \' callback': function (" codequery#db#make_db_callback" )}
137+ let options = {' out_io' : ' null' ,
138+ \' exit_cb': mydict.callback}
139+ let s: build_job = job_start ([' /bin/sh' , ' -c' , shell_cmd], options )
140+ let timer = timer_start (500 ,
141+ \{ - > execute (" call job_status(s:build_job)" ," " )},
142+ \{ ' repeat' : 60 })
143+ elseif exists (' :Start' )
136144 silent execute ' Start! -title=Make_CodeQuery_DB -wait=error ' . shell_cmd
137145 redraw !
138- echom ' Making ' . db_path ' => Run :CodeQueryViewDB to Check Status'
146+ echom ' Making ... ' . db_path ' => Run :CodeQueryViewDB to Check Status'
139147 else
140148 silent execute ' !' . shell_cmd
141149 redraw !
142150 endif
143- " ----------------------------------------------------------------
144151 endfor
145152 call s: restore_cwd ()
146153endfunction
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ function! codequery#db#find_db_path(filetype) abort
3636endfunction
3737
3838
39+ function ! codequery#db#make_db_callback (job, status) dict
40+ echom ' Done! (' . self .db_path . ' )'
41+ endfunction
42+
43+
3944function ! codequery#db#construct_python_db_build_cmd (db_path) abort
4045 let find_cmd = ' find . -iname "*.py" > python_cscope.files'
4146 let pycscope_cmd = ' pycscope -f "python_cscope.out" -i python_cscope.files'
You can’t perform that action at this time.
0 commit comments