preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.14k stars 489 forks source link

Allow custom language definitions #876

Open AndyMcAliley opened 8 months ago

AndyMcAliley commented 8 months ago

Fixes #789

This PR adds a second duplicate --option directive to the ctags command, using deffile twice. The first --option comes prior to --language-force and lets ctags know the custom language. The second --option comes last to override the default --kinds-<lang> definition.

This PR addresses the same problem that #792 addresses, but in a different way that doesn't require additional user options.

This fix needs testing, especially on the use case described in #776.

AndyMcAliley commented 8 months ago

I added a commit to check if the language is recognized by ctags, and only include the first --option directive for custom languages, which is better. I added another commit to only call ctags --list-languages once.