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

Allow addition of new language types (#789) #792

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions autoload/tagbar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,12 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
let ctags_args += [ '-V' ]
endif

" Define a new language before adding --language-force to the list of
" arguments
if has_key(a:typeinfo, 'deflang')
let ctags_args += ['--langdef=' . expand(a:typeinfo.deflang)]
endif
Comment on lines +1402 to +1404
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to just key off the deffile instead. Then there wouldn't need to be any new config keys. Can you give this a try and see if this works?

Suggested change
if has_key(a:typeinfo, 'deflang')
let ctags_args += ['--langdef=' . expand(a:typeinfo.deflang)]
endif
if has_key(a:typeinfo, 'deffile')
let ctags_args += ['--langdef=' . a:typeinfo.ctagstype]
endif


" Third-party programs may not necessarily make use of this
if has_key(a:typeinfo, 'ctagstype')
let ctags_type = a:typeinfo.ctagstype
Expand Down