universal-ctags / ctags

A maintained ctags implementation
https://ctags.io
GNU General Public License v2.0
6.57k stars 627 forks source link

I18nRubyGem leading colon inside of tag name #3920

Closed akemrir closed 10 months ago

akemrir commented 10 months ago

The name of the parser: I18nRubyGem The command line you used to run ctags:

ctags --options=NONE test.yaml

The content of input file:

---
en:
  :sequel:
    :errors:
      :or: "or"

The tags output you are not satisfied with:

!_TAG_EXTRA_DESCRIPTION anonymous       /Include tags for non-named objects like lambda/
!_TAG_EXTRA_DESCRIPTION fileScope       /Include tags of file scope/
!_TAG_EXTRA_DESCRIPTION pseudo  /Include pseudo tags/
!_TAG_EXTRA_DESCRIPTION subparser       /Include tags generated by subparsers/
!_TAG_FIELD_DESCRIPTION epoch   /the last modified time of the input file (only for F\/file kind tag)/
!_TAG_FIELD_DESCRIPTION file    /File-restricted scoping/
!_TAG_FIELD_DESCRIPTION input   /input file/
!_TAG_FIELD_DESCRIPTION name    /tag name/
!_TAG_FIELD_DESCRIPTION pattern /pattern/
!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/
!_TAG_FILE_FORMAT       2       /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!Yaml     a,anchor        /anchors/
!_TAG_OUTPUT_EXCMD      mixed   /number, pattern, mixed, or combineV2/
!_TAG_OUTPUT_FILESEP    slash   /slash or backslash/
!_TAG_OUTPUT_MODE       u-ctags /u-ctags or e-ctags/
!_TAG_OUTPUT_VERSION    0.0     /current.age/
!_TAG_PARSER_VERSION!Yaml       0.0     /current.age/
!_TAG_PATTERN_LENGTH_LIMIT      96      /0 for no limit/
!_TAG_PROC_CWD  /home/akemrir/test/     //
!_TAG_PROGRAM_AUTHOR    Universal Ctags Team    //
!_TAG_PROGRAM_NAME      Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL       https://ctags.io/       /official site/
!_TAG_PROGRAM_VERSION   6.1.0   /v6.1.0/
!_TAG_ROLE_DESCRIPTION!Yaml!anchor      alias   /alias/
:or     test.yml        /^      :or: "or"$/;"   k       keyInMiddle:en.:sequel.:errors
:sequel.:errors.:or     test.yml        /^      :or: "or"$/;"   k       locale:en
en.:sequel.:errors.:or  test.yml        /^      :or: "or"$/;"   k       keyInMiddle:en.:sequel.:errors

The tags output you expect:

!_TAG_EXTRA_DESCRIPTION anonymous       /Include tags for non-named objects like lambda/
!_TAG_EXTRA_DESCRIPTION fileScope       /Include tags of file scope/
!_TAG_EXTRA_DESCRIPTION pseudo  /Include pseudo tags/
!_TAG_EXTRA_DESCRIPTION subparser       /Include tags generated by subparsers/
!_TAG_FIELD_DESCRIPTION epoch   /the last modified time of the input file (only for F\/file kind tag)/
!_TAG_FIELD_DESCRIPTION file    /File-restricted scoping/
!_TAG_FIELD_DESCRIPTION input   /input file/
!_TAG_FIELD_DESCRIPTION name    /tag name/
!_TAG_FIELD_DESCRIPTION pattern /pattern/
!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/
!_TAG_FILE_FORMAT       2       /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!Yaml     a,anchor        /anchors/
!_TAG_OUTPUT_EXCMD      mixed   /number, pattern, mixed, or combineV2/
!_TAG_OUTPUT_FILESEP    slash   /slash or backslash/
!_TAG_OUTPUT_MODE       u-ctags /u-ctags or e-ctags/
!_TAG_OUTPUT_VERSION    0.0     /current.age/
!_TAG_PARSER_VERSION!Yaml       0.0     /current.age/
!_TAG_PATTERN_LENGTH_LIMIT      96      /0 for no limit/
!_TAG_PROC_CWD  /home/akemrir/test/     //
!_TAG_PROGRAM_AUTHOR    Universal Ctags Team    //
!_TAG_PROGRAM_NAME      Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL       https://ctags.io/       /official site/
!_TAG_PROGRAM_VERSION   6.1.0   /v6.1.0/
!_TAG_ROLE_DESCRIPTION!Yaml!anchor      alias   /alias/
en.sequel.errors.or     test.yml        /^      or: "or"$/;"    k       keyInMiddle:en.sequel.errors
or      test.yml        /^      or: "or"$/;"    k       keyInMiddle:en.sequel.errors
sequel.errors.or        test.yml        /^      or: "or"$/;"    k       locale:en

The version of ctags:

$ ctags --version
Universal Ctags 6.1.0(v6.1.0), Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Dec 28 2023, 18:49:35
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc, +optscript, +pcre2

How do you get ctags binary:

Archlinux official repository extra/ctags 1:6.1.0-1


@masatake I missed during the check this kind of situation, when ruby output will be saved from symbolized keys not string keys. In some projects I saw mix of these two approaches.

masatake commented 10 months ago

@akemrir Thank you for your feedback. See #3921.

akemrir commented 10 months ago

Wow, very fast :) works

masatake commented 10 months ago

Thank you. I'll merge the pull request.