ludovicchabant / vim-gutentags

A Vim plugin that manages your tag files
https://bolt80.com/gutentags/
MIT License
2.29k stars 175 forks source link

g:gutentags_resolve_symlinks=0 not working #244

Open laur89 opened 5 years ago

laur89 commented 5 years ago

Describe the bug Setting named setting (which should be default) doesn't seem to be working. I have a git repo that has a symlink that points to a directory in a homedir; opening a file in said repo triggers tags generation, and I can see projects from the symlink are resolved, resulting into tag file of multiple hundred lines long.

Steps to reproduce

  1. Have a project similar to this:

    /path/to/my/project
    ▸ backups/
    ▸ configs/
    ▾ home/
        ▸ bin/
        ▾ dev/ -> /data/dev/
            ▸ projects/  <-- this contains loads of directories that'll get processed
  2. Open a file in /path/to/my/project (that's not on a symlinked path when looking from /path/to/my/project)

  3. /path/to/my/project/.tags will contain tags from projects under /data/dev/projects

Share your setup

Post the logs

    "/path/to/my/project/file.sh" 4675L, 168929C
    gutentags: Scanning buffer '/path/to/my/project/file.sh' for gutentags setup...
    gutentags: No specific project type.
    gutentags: Setting gutentags for buffer '/path/to/my/project/file.sh'
    gutentags: Generating missing tags file: /path/to/my/project/.tags
    gutentags: Generating wildignore options: /tmp/nvimgmmVkR/4
    gutentags: Running: ['/home/laur89/.vim/bundle/vim-gutentags/plat/unix/update_tags.sh', '-e', 'ctags', '-t', '.tags', '-p', '.', '-o', '/home/laur89/.vim/bundle/vim-gutentags/res/ctags_recursive.options', '-x', '@/tmp/nvimgmmVkR/4', '-l', '.tags.log']
    gutentags: In:      /path/to/my/project
    gutentags: [job output]: ['Locking tags file...', '']
    gutentags: [job output]: ['Running ctags on whole project', 'ctags -f ".tags.temp"  --options=/home/laur89/.vim/bundle/vim-gutentags/res/ctags_recursive.options --exclude=@/tmp/nvimgmmVkR/4 .', '']
    gutentags: [job output]: ['ctags: Warning: Language "Go" already defined', '']

Also bunch of lines like

gutentags: [job output]: ['ctags: Warning: cannot open source file "home/dev/projects/some_project/node_modules" : No such file or directory', '']

which demonstrates it is trying to resolve symlinks. Note the path in that warning is /home/dev not /data/dev, because /path/to/my/project is a homeshick castle (everything under ./home/ will be symlinked from ~ for easier dotfile management)

All my plugin config is

    let g:gutentags_trace=1
    let g:gutentags_ctags_tagfile = '.tags'
    let g:gutentags_resolve_symlinks=0
smemsh commented 3 months ago

the following workarounds are possible:

" ctags
let g:gutentags_ctags_extra_args = ['--links=no']

" gtags
let $GTAGS_ARGS = '--skip-symlink'