Skip to content

RFC: Using FQ name in scope field ( Asciidoc: structure isn't resembled ) #2063

Open
@hupfdule

Description

@hupfdule

The name of the parser: ctags

The command line you used to run ctags:

$ ctags --options=NONE -o - b.adoc

The content of input file:

= Title

Lorem Ipsum.

== a

Lorem Ipsum.

=== a.a

Lorem Ipsum.

==== a.a.a

Lorem Ipsum.

[[label-a.a.a]]

Lorem Ipsum.

===== a.a.a.a

Lorem Ipsum.

== b

Lorem Ipsum.

=== b.a

Lorem Ipsum.

==== b.a.a

Lorem Ipsum.

[[label-b.a.a]]

Lorem Ipsum.

===== b.a.a.a

Lorem Ipsum.

The tags output you are not satisfied with:

ctags: Notice: No options will be read from files or environment
Title   b.adoc  /^= Title$/;"   c
a       b.adoc  /^== a$/;"      s       chapter:Title
a.a     b.adoc  /^=== a.a$/;"   S       section:a
a.a.a   b.adoc  /^==== a.a.a$/;"        t       subsection:a.a
a.a.a.a b.adoc  /^===== a.a.a.a$/;"     T       subsubsection:a.a.a
b       b.adoc  /^== b$/;"      s       chapter:Title
b.a     b.adoc  /^=== b.a$/;"   S       section:b
b.a.a   b.adoc  /^==== b.a.a$/;"        t       subsection:b.a
b.a.a.a b.adoc  /^===== b.a.a.a$/;"     T       subsubsection:b.a.a
label-a.a.a     b.adoc  /^[[label-a.a.a]]$/;"   a       subsubsection:a.a.a
label-b.a.a     b.adoc  /^[[label-b.a.a]]$/;"   a       subsubsection:b.a.a
...

The tags output you expect:

ctags: Notice: No options will be read from files or environment
Title   b.adoc  /^= Title$/;"   c
a       b.adoc  /^== a$/;"      s       chapter:Title
a.a     b.adoc  /^=== a.a$/;"   S       section:Title""a
a.a.a   b.adoc  /^==== a.a.a$/;"        t       subsection:Title""a""a.a
a.a.a.a b.adoc  /^===== a.a.a.a$/;"     T       subsubsection:Title""a""a.a""a.a.a
b       b.adoc  /^== b$/;"      s       chapter:Title
b.a     b.adoc  /^=== b.a$/;"   S       section:Title""b
b.a.a   b.adoc  /^==== b.a.a$/;"        t       subsection:Title""b""b.a
b.a.a.a b.adoc  /^===== b.a.a.a$/;"     T       subsubsection:Title""b""b.a""b.a.a
label-a.a.a     b.adoc  /^[[label-a.a.a]]$/;"   a       subsubsection:a.a.a
label-b.a.a     b.adoc  /^[[label-b.a.a]]$/;"   a       subsubsection:b.a.a
...

The version of ctags:

$ ctags --version
Universal Ctags 0.0.0, Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Mar 26 2019, 14:11:21
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml

How do you get ctags binary:

source package from Debian buster and added patch #2062


I noticed the problem with the vim-tagbar. See preservim/tagbar#529 for some screenshots of the problem. The tags aren't correctly structured. I compared it to the Latex output which does correctly resemble the structure.

Two decisions have to be made:

  1. In the above "expected output" I used two double quotes to seperate the parts of the hierarchy (the rightmost column in the ctags output). I did this only because that is done with the Latex parser. Please decide if this the correct separator for asciidoc, too.
  2. I am not sure about the anchors. In the Latex parser the are not put into the structure, but are separate. The current asciidoc parser puts them in the hierarchy below the section the are defined in. I am not sure what is the best approach. Maybe the asciidoc parser should do the same like the Latex parser?

Disclaimer: I am not used to ctags, so the above mentioned "expected output" may be wrong. I just wrote it based on what I saw in the Latex output. Please look closely, I may have done something wrong there.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions