1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 03:20:27 +01:00

Better handling for typeinfo.deffile (#777)

Closes #776

Change the ordering of the --options field when executing ctags. This
allows overrides of things like the --<lang>-kinds definitions to omit
certain kinds.

Also add check to ensure the typeinfo.deffile exists before attempting
to use it in the ctags arguments.
This commit is contained in:
David Hegland
2021-06-24 09:37:26 -05:00
committed by GitHub
parent 285afffc47
commit 2da3443f5f

View File

@@ -1390,11 +1390,6 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
let ctags_args += [ '-V' ]
endif
" Include extra type definitions
if has_key(a:typeinfo, 'deffile')
let ctags_args += ['--options=' . expand(a:typeinfo.deffile)]
endif
" Third-party programs may not necessarily make use of this
if has_key(a:typeinfo, 'ctagstype')
let ctags_type = a:typeinfo.ctagstype
@@ -1409,6 +1404,12 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
let ctags_args += ['--language-force=' . ctags_type]
let ctags_args += ['--' . ctags_type . '-kinds=' . ctags_kinds]
endif
" Include extra type definitions - include last to allow for any
" overrides
if has_key(a:typeinfo, 'deffile') && filereadable(expand(a:typeinfo.deffile))
let ctags_args += ['--options=' . expand(a:typeinfo.deffile)]
endif
endif
if has_key(a:typeinfo, 'ctagsbin')