SPC m c d
Can read the cscope database in the project root properly.
Precondition:
The cscope.out file is at project root.
This may because the work path changed after step 2, if I set work path to project root, it will work normally.
Please press SPC h I, debug info will be put into clipboard, then paste all content below.
@wsdjeg: instead of reading manually cscope.out file, it could be read automatically:
" Autoloading Cscope Database
function! LoadCscope()
let db = findfile("cscope.out", ".;")
if (!empty(db))
let path = strpart(db, 0, match(db, "/cscope.out$"))
set nocscopeverbose " suppress 'duplicate connection' error
exe "cs add " . db . " " . path
set cscopeverbose
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endfunction
au BufEnter /* call LoadCscope()
@jetm all this code should be added into SpaceVim/cscope.vim, and I will improve that plugin.
@keai4le @wsdjeg
First, you need to verify that the code is C or C++.
Second, execute the command cscope -Rbkq under the code project to generate the cscop.out file.
Finally, try again and good luck for you.
I just test with neovim's repo, after running cscope -Rbkq, everything works well for me.
Most helpful comment
@keai4le @wsdjeg
First, you need to verify that the code is C or C++.
Second, execute the command
cscope -Rbkqunder the code project to generate thecscop.outfile.Finally, try again and good luck for you.