[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem on generating GRTAGS for vim scripts
From: |
Shigio YAMAGUCHI |
Subject: |
Re: Problem on generating GRTAGS for vim scripts |
Date: |
Fri, 4 Jun 2021 09:36:27 +0900 |
Hello,
> Is this expected behavior ?
No, it isn't. It is a bug.
'pygments-parser.la' works by combining two parsers: Pygments and Ctags.
It seems that the parsers recognize symbols differently.
Ctags picks up symbols with namespace but Pygments do it without namespace.
Ctags lightline#highlight
Pygments highlight
> Is there any workaround on this ?
You can pick up both symbols using a regular expression 'highlight$'.
('$' matches the end of the symbol.)
$ global -x 'highlight$'
lightline#highlight 263 autoload/lightline.vim function!
lightline#highlight(...) abort
...
$ global -xrs 'highlight$'
highlight 54 autoload/lightline.vim autocmd
SessionLoadPost * call lightline#highlight()
highlight 56 autoload/lightline.vim \ | call
lightline#update() | call lightline#highlight() | endif
...
'global -xr' does not work, since global cannot understand that
'lightline#highlight' and 'highlight' are in a reference relationship.
I think the only way to fix it fundamentally is to rewrite one of the parsers.
Regards,
Shigio
2021年6月4日(金) 5:35 John Rama <john.rama01@gmail.com>:
>
> Hi,
>
> I keep using global/gtags for reading c/python/javascripts and it
> works greatly. Thank you for that !!
>
> But when trying to create tags files for vim script,
> GTAGS files are generated correctly, but GRTAGS files are not
> complete.
>
> - Environement
> $gtags --version
> gtags (GNU GLOBAL) 6.6
> $python3 -m pip list |grep Pygments
> Pygments 2.9.0
>
> - How to duplicate the problem
> $git clone https://github.com/itchyny/lightline.vim
> $gtags --gtagslabel=pygments -v
>
> - Problem
> For example, symbol for lightline#highlight() is generated in GTAGS
> file, but it's not in GRTAGS.
> So, it looks lightline#highlight symbol becomes "highlight".
>
> $gtags -d GTAGS |grep high
> lightline#highlight 42 @n 263 function! @n(...) abort
> s:suite 51 @n 1 let @n = themis#suite('highlight')
> suite.highlight 51 @n 21 function! s:@n()
>
> $gtags -d GRTAGS |grep high
> highlight 51 @n 21,19,17,16
> highlight 42 @n 54,2,146-1,21-1,38,7,40-1,121-1
> highlight 3 @n 22,2
>
> - Questions
> Is this expected behavior ?
> Is there any workaround on this ?
>
> Thanks for your help.
> John
>
>
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB