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

gtags: .LfCache/gtags/____/GTAGS seems corrupted. #651

Closed
2 of 6 tasks
guoang opened this issue Jun 30, 2020 · 6 comments
Closed
2 of 6 tasks

gtags: .LfCache/gtags/____/GTAGS seems corrupted. #651

guoang opened this issue Jun 30, 2020 · 6 comments

Comments

@guoang
Copy link

guoang commented Jun 30, 2020

  • vim or neovim?
    • vim
    • neovim
  • Output of vim --version or nvim --version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 24 2020 23:42:24)
macOS version
包含补丁: 1-1050
编译者 Homebrew
巨型版本 无图形界面。  可使用(+)与不可使用(-)的功能:
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
-clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua               +ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
     系统 vimrc 文件: "$VIM/vimrc"
     用户 vimrc 文件: "$HOME/.vimrc"
 第二用户 vimrc 文件: "~/.vim/vimrc"
      用户 exrc 文件: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
         $VIM 预设值: "/usr/local/share/vim"
编译方式: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
链接方式: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/[email protected]/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.15 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin -lpython3.8 -framework CoreFoundation  -lruby.2.7
  • Output of :echo has("python"):
  • Output of :echo has("python3"):
  • Output of :echo &pythondll(only vim, not neovim):
  • Output of :echo &pythonthreedll(only vim, not neovim):
  • Output of :py print(sys.version):
  • Output of :py3 print(sys.version):
  • Output of :echo g:Lf_Debug_Cmd:
  • Output of :echo g:Lf_FilesFromCache:
  • Operating system:
    • Linux
    • Windows
    • Mac OS X
    • Etc.
  • Configurations related to LeaderF in vimrc:
let g:Lf_Gtagslabel = 'native-pygments'
let g:Lf_GtagsAutoGenerate = 1

Describe your question, feature request, or bug.

如果GTAGS文件是空的话,会在编辑区弹出报错:
gtags: .LfCache/gtags/____/GTAGS seems corrupted.

参考:ludovicchabant/vim-gutentags#225

Steps to reproduce

Actual behaviour

Expected behaviour

@Yggdroot
Copy link
Owner

重新生成。

@guoang
Copy link
Author

guoang commented Jun 30, 2020

重新生成也还是会报错,因为这个仓库就是没有tags的,但是我又想保留 let g:Lf_GtagsAutoGenerate = 1,所以最好是对空的GTAGS不要报错就好了。
另外对于比较大的仓库,后台生成tags期间,GTAGS文件也是空的,这个时候就也会报错。

@Yggdroot
Copy link
Owner

Yggdroot commented Jul 4, 2020

这个错误怎么复现?

@ouyangjunyi
Copy link

这个错误怎么复现?

大佬,我这边也遇到只要项目大一点,生成的tags就是空的,这个怎么过滤只对特定后缀的文件进行索引呢?

@Yggdroot
Copy link
Owner

这个错误怎么复现?

大佬,我这边也遇到只要项目大一点,生成的tags就是空的,这个怎么过滤只对特定后缀的文件进行索引呢?

LeaderF/doc/leaderf.txt

Lines 657 to 678 in f55c96b

g:Lf_GtagsSource *g:Lf_GtagsSource*
Gtags accepts a list of files as target files. This option indicates
where the target files come from. It has 3 values: 0, 1, 2.
0 - gtags search the target files by itself.
1 - the target files come from FileExplorer.
2 - the target files come from |g:Lf_GtagsfilesCmd|.
Default value is 0.
g:Lf_GtagsfilesCmd *g:Lf_GtagsfilesCmd*
If |g:Lf_GtagsSource| is 2, use the command defined by this option to
generate the target files.
Default value is: >
let g:Lf_GtagsfilesCmd = {
\ '.git': 'git ls-files --recurse-submodules',
\ '.hg': 'hg files',
\ 'default': 'rg --no-messages --files'
\}
<
, which means use command `git ls-files --recurse-submodules` for git
repository and `hg files` for hg repository, use `rg --no-messages --files`
otherwise.

@caizimin
Copy link
Contributor

这个问题复现方法:
下一个 AOSP 全套代码执行
Leaderf gtags --update --debug
cd "/home2/zmcai/sm8350_i5" && gtags -i --skip-symlink --gtagslabel default “/home/zmcai/.LfCache/gtags/_home2_zmcai_sm8350_i5
如果没有设定:GTAGSFORCECPP=1:,就会发生 gtags 产生 GTAGS 错误。之后如果不删除一直产生 corrupted 错误。

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

4 participants