Spacevim: cscope: cannot open file cscope.out

Created on 3 May 2018  路  4Comments  路  Source: SpaceVim/SpaceVim

Expected behavior, english is required

SPC m c d
Can read the cscope database in the project root properly.

The reproduce ways from Vim starting (Required!)

Precondition:
The cscope.out file is at project root.

  1. Open vim in the project root
  2. SPC m c d --> search a definition and open the file
  3. SPC m c d --> search a definition. then Unite shows "cscope: cannot open file cscope.out"

This may because the work path changed after step 2, if I set work path to project root, it will work normally.

Debug info

Please press SPC h I, debug info will be put into clipboard, then paste all content below.

Screenshots

https://asciinema.org/a/6zkGApvgP5oIdPv2BtQkfrw7J

bug-upstream

Most helpful comment

@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.

All 4 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

well1791 picture well1791  路  4Comments

wsdjeg picture wsdjeg  路  4Comments

jetm picture jetm  路  5Comments

eperfect picture eperfect  路  4Comments

wsdjeg picture wsdjeg  路  3Comments