-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Error on configuration of g:tagbar_type_bib #856
Comments
It looks like the Wiki page entry is for a custom defined version for bibtex with a custom regex parser for bibtex files. Do you if universal-ctags has native support for bibtex now? Or do we still need to have the regex pattern definition? Another part of this might be that we have to let vim know the correct file type. If vim has been updated since that wiki entry to know about bibtex files, then that could be the cause too. I.E. in a previous version vim may have just recognized the file extension and used that as the filetype, but now it may know the language and correctly label the filetype as bibtex. Either way, ya it looks like the wiki page is out of date. If you can provide me with a sample bibtex file I can do some testing and look at updating it. |
Thanks for answering.
Universal-ctags has native support for bibtex (
I'm using
Here's a sample of
|
@andregpss I've created a PR that adds native bibtex support. Can you help me identify which ones need the |
My opinion is that all kinds should be marked with 1 for both. Something like:
|
As near as I can tell, there are not child tags under any of these. Is the format of bibtex such that all these tag kinds are at 'global' scope for lack of a better description? Or can there be nested tags? In the example file, it looks like all the tag kinds are at the global scope level and there are no tag kinds for anything inside of those definitions from what I can see. |
There are no nested tags. References are listed without dependencies between them. Bibtex is a simple list of references. |
It is also essential to consider the types introduced by additional packages commonly used on Latex docs. The main packages are biblatex and natbib. So, here goes a complete type declaration for Taglib i have created: |
I'm hesitant to add kinds that aren't officially supported by ctags. Currently it looks If support is needed for something that universal-ctags does not support itself, then a custom configuration would be needed. For these additional packages you are referencing, do they have a plugin for universal-ctags to add the additional kinds? Without that, even if we defined the extra kinds in our definition, we'd never see them if ctags can't output them.
For now I'll plan to merge in the changes I have pushed up already, and we can always add more later if needed and ctags support is there. |
I don't know if there is a plugin for u-Ctags to add Bibtex additional kings. I search for it but not find it.
When will this merge be available? Thanks. |
It should be merged into the master branch already. I merged it in yesterday. |
Ok. Now But it is a pity that additional and very popular types such as |
If you want to open an issue on the universal-ctags github for additional support you can try that. Then if that is supported from the ctags side, we can add support here. |
|
Fixes #856 Note: VIM does not have a known file extension to differentiate between .bib and a BibLaTeX file. From what I can see, there is no common file-extension for a BibLaTeX file, so a custom filetype configuration will be needed in vim to differentiate between the two.
@andregpss I merged in the support for this. Note however, that vim does not have a recognized file extension type for biblatex files so a custom definition is needed. I've updated the doc page in the With this change, the |
@raven42 |
Thanks @andregpss let me know if pulled the latest and if you got it working with my merged code. If you have any issues, let me know. |
@raven42 I have updated |
This is intentional. The universal-ctags implementation was done by defining a new tag kind of biblatex that is independent and incompatible with bibtex. Take for example the 'B' kind. In the bor.al bibtex definition, this is defined as 'Inbook', but in the biblatex definition, it is 'Audio' From the tagbar perspective, we have to have only a single language definition, especially if we have overlapping kinds like this. I'm not sure how we would merge the two effectively and accurately given yhe way it was implemented in universal-ctags. |
|
Hmm... ok it appears that universal-ctags is using both the bibtex and biblatex parsers when processing a .bib file. Even if the language type is forced to just bibtex. I'm not sure if this is by design or not, but we can try to accommodate in tagbar.
I can update the existing
|
Closes preservim#856 The universal-ctags update includes both the bibtex and biblatex parser when processing a .bib file even when language is forced. This will merge the two as much as possible. There are a number of conflicts and will use the bibtex standard type in that instance.
Closes #856 The universal-ctags update includes both the bibtex and biblatex parser when processing a .bib file even when language is forced. This will merge the two as much as possible. There are a number of conflicts and will use the bibtex standard type in that instance.
@andregpss Ok I pushed in another change that merges the bibtex and biblatex versions as much as possible. Give the latest a shot and let me know how it goes. As I stated in my last comment, there are a number of biblatex kinds that conflict with the bibtex kinds, so in those instances I used the bibtex kind definition. |
@raven42 This new update satisfies me. |
I think there is an error on the suggested configuration for Bibtex files on the Wiki page.
The
ctagstype
variable must be set tobibtex
, instead ofbib
. When i usebib
, it does not work.By the way,
Misc
references are not shown on Tagbar, although other types of references (Article, Books, etc) work.The text was updated successfully, but these errors were encountered: