tagbar
tagbar copied to clipboard
AsciiDoc sections reprinted as pseudotags
From the documentation, this doesn't seem like correct behavior. The tag for the section is found by ctags, and the scope of the subsection tag refers to that tag.
AsciiDoc file:
= Hello
== Section
Bla bla bla
=== Subsection
Actual Tagbar buffer:
" Press <F1>, ? for help
▼ Hello : chapter
Section : section
▼ Section* : section
Subsection : subsection
Expected Tagbar buffer:
" Press <F1>, ? for help
▼ Hello : chapter
▼ Section : section
Subsection : subsection
Log file and ctags output are attached.
Apparently the search for the Section tag fails when parsing the Subsection tag (it doesn't find a parent), so it creates a new pseudo tag.
During parsing of the Subsection tag, the algorithm sees there is supposed to be a Section parent based on the pathinfo (which is ['Section']), but I guess because the Section tag was created as a child of the Hello tag, it cannot find the tag.
Some more detailed debug logging:
2020-06-07 14:12:14.726788: Parsing ctags output
2020-06-07 14:12:14.730658: add_tag_recursive ENTRY: NONE; [NAME: Hello; PSEUDO: 0]; []
2020-06-07 14:12:14.731049: add_tag_recursive EXIT 1: NONE; [NAME: Hello; PSEUDO: 0]; []
2020-06-07 14:12:14.732638: add_tag_recursive ENTRY: NONE; [NAME: Section; PSEUDO: 0]; ['Hello']
2020-06-07 14:12:14.732900: GRANDPARENT: {}
2020-06-07 14:12:14.733006: PARENTNAME: Hello
2020-06-07 14:12:14.733128: PATHLIST: []
2020-06-07 14:12:14.733569: NAME_SIBLINGS: [{'isSplitTag': function('<SNR>45_isSplitTag'), ...
2020-06-07 14:12:14.734783: PARENTS: [{'isSplitTag': function('<SNR>45_isSplitTag'), ...
2020-06-07 14:12:14.735662: add_tag_recursive ENTRY: [NAME: Hello; PSEUDO: 0]; [NAME: Section; PSEUDO: 0]; []
2020-06-07 14:12:14.736030: add_tag_recursive EXIT 1: [NAME: Hello; PSEUDO: 0]; [NAME: Section; PSEUDO: 0]; []
2020-06-07 14:12:14.736207: add_tag_recursive EXIT 2: NONE; [NAME: Section; PSEUDO: 0]; []
2020-06-07 14:12:14.737988: add_tag_recursive ENTRY: NONE; [NAME: Subsection; PSEUDO: 0]; ['Section']
2020-06-07 14:12:14.738308: GRANDPARENT: {}
2020-06-07 14:12:14.738418: PARENTNAME: Section
2020-06-07 14:12:14.738529: PATHLIST: []
2020-06-07 14:12:14.738672: NAME_SIBLINGS: []
2020-06-07 14:12:14.738817: PARENTS: []
2020-06-07 14:12:14.740672: add_tag_recursive ENTRY: [NAME: Section; PSEUDO: 1]; [NAME: Subsection; PSEUDO: 0]; []
2020-06-07 14:12:14.741106: add_tag_recursive EXIT 1: [NAME: Section; PSEUDO: 1]; [NAME: Subsection; PSEUDO: 0]; []
2020-06-07 14:12:14.741376: add_tag_recursive EXIT 2: NONE; [NAME: Subsection; PSEUDO: 0]; []