Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong path to files outside project #362

Open
Holton181 opened this issue Oct 1, 2024 · 0 comments
Open

Wrong path to files outside project #362

Holton181 opened this issue Oct 1, 2024 · 0 comments

Comments

@Holton181
Copy link

Holton181 commented Oct 1, 2024

EDIT

I have realized Below description is not correct. I had done a lot of testing involving Cscope-maps as well an also quite tired when writing it up. My brain must have mixed up different testcases.
I will try to clarify.

Described behaviour was with relative paths in cscope.files, NOT full paths! Full paths makes gutentags to fail creating cscope db files all together. That is because gutentags prepends CWD to all paths internally and therefore can't find any files.

A request is to have a setting to disable this prepending of the CWD.

Below behavior is due to an issue with Cscope-maps (and no, it did not run fine as stated below), I will file an issue for that on their github.

I am sorry for the total confusion I may have caused.


When trying to open an #include file that is lokated outside project, full path in cscope.files and tagfiles (tags, cscope.out), the CWD getts appended to the full path and an emty buffer is opend. The path shown in the quickfix list is the full path without the appended CWD.
Files within the project, also full path in cscope.files and tagfiles, only show relative path in quickfix list (despite above) and open correctly.

Doesn't matter if cache dir is used or not.

Running cscope from terminal or with Cscope-maps (vim-gutentags disabled) works fine, also full paths in cscope.files and tagfiles.

Termux: 0.118.1
Neovim: v0.10.1
Universal Ctags: 6.1.0
Cscope: 15.9
cscope_maps: from 2024-09-24
vim-gutentags: well, latest

init.vim:
" gutentags --------------------------
let g:gutentags_enabled=0
let g:gutentags_define_advanced_commands = 1
let g:gutentags_trace=1
let g:gutentags_modules=['ctags', 'cscope_maps']
let g:gutentags_add_default_project_roots=0
let g:gutentags_project_root=['.root']
let g:gutentags_cache_dir=expand('~/.cache/tags')
let g:gutentags_file_list_command = 'cat cscope.files|tr -d "'
let g:gutentags_ctags_extra_args=['-R', '--tag-relative=yes', '--exclude=build','--fields=+ailmnSER', '--kinds-C++=+lp', '--kinds-C=+lp', '--extras=+frq']
let g:gutentags_cscope_build_inverted_index=1
let g:gutentags_cscope_build_inverted_index_maps=1
let g:gutentags_generate_on_new=1
let g:gutentags_generate_on_missing=1
let g:gutentags_generate_on_write=1
let g:gutentags_generate_on_empty_buffer=0
let g:gutentags_plus_switch=0
let g:gutentags_plus_nomap=1

(the cscope.files has " enclosing the paths, hence 'tr -d "' above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant