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

Improve handling of anonymous tags #3059

Merged
merged 6 commits into from Feb 12, 2022
Merged

Improve handling of anonymous tags #3059

merged 6 commits into from Feb 12, 2022

Commits on Jan 10, 2022

  1. Rename pointerOrder TMtag member to flags

    We now use varType instead of pointerOrder and it has been the case for
    quite and we can use the pointerOrder field for storing something useful.
    When we store something else inside the renamed pointerOrder, we will
    break compatibility with some very old tag files but I don't think there
    are any such files around (also pointerOrder was probably just reported
    by the C parser).
    
    Bump API for the pointerOrder change to flags
    techee committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    9cfd7eb View commit details
    Browse the repository at this point in the history
  2. Use XTAG_ANONYMOUS in Fortran parser

    Report anonymous tags using XTAG_ANONYMOUS. These anonymous tags aren't
    generated by the upstream uctags parser so this change hasn't been made
    available there (will have to be part of some future sync).
    techee committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    8805f56 View commit details
    Browse the repository at this point in the history
  3. Add a flag representing anonymous tags

    The flag is set when XTAG_ANONYMOUS is defined and is used for detecting
    anonymous tags inside tm_tag_is_anon().
    techee committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    b4afb8e View commit details
    Browse the repository at this point in the history
  4. Determine anonymous tags based on name only when necessary

    At this point all built in parsers should report anonymous tags correctly
    so for them we don't need to determine anonymous tags based on tag name.
    Since tag files might be generated without this information, we still
    have to determine anonymous tags based on name for them.
    techee committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    ea660f8 View commit details
    Browse the repository at this point in the history
  5. Consistently rename anonymous tags and drop the last ctags diff

    Check all the collected tags once a file is parsed (i.e. when
    we have all tags, including those from subparsers) and renamea
    them in the form
    
    anon_enum_1
    anon_struct_1
    anon_enum_2
    anon_struct_2
    
    where the second component is a ctags kind and the number is
    per-kind.
    
    In addition, scopes of the nested tags have to be updated if the parent
    tag is an anonymous tag.
    
    Finally, for anonymous tags of the form typedef struct Foo{int a;};
    we can use the name of the typedef instead of generating the
    anonymous name. In this case we can drop the typedef tag once
    the anonymous tag is updated with its name.
    
    More details can be found in comments.
    techee committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    dbd0ebc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6f62616 View commit details
    Browse the repository at this point in the history