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

JSON full attributes path #4164

Closed
akemrir opened this issue Dec 29, 2024 · 3 comments · Fixed by #4165
Closed

JSON full attributes path #4164

akemrir opened this issue Dec 29, 2024 · 3 comments · Fixed by #4165

Comments

@akemrir
Copy link

akemrir commented Dec 29, 2024

The name of the parser: json

The command line you used to run ctags:

$ ctags --options=NONE file.json

The content of input file:

{
  "welcome": {
    "x": {
      "c": "hello {{.Name}}"
    }
  }
}

The tags output you are not satisfied with:

...
!_TAG_PROGRAM_URL       https://ctags.io/       /official site/
!_TAG_PROGRAM_VERSION   6.1.0   /v6.1.0/
c       i18n/en.json    /^      "c": "hello {{.Name}}"$/;"      s       object:welcome.x
welcome i18n/en.json    /^  "welcome": {$/;"    o
x       i18n/en.json    /^    "x": {$/;"        o       object:welcome

The tags output you expect:

...
!_TAG_PROGRAM_URL       https://ctags.io/       /official site/
!_TAG_PROGRAM_VERSION   6.1.0   /v6.1.0/
c       i18n/en.json    /^      "c": "hello {{.Name}}"$/;"      s       object:welcome.x
welcome i18n/en.json    /^  "welcome": {$/;"    o
x       i18n/en.json    /^    "x": {$/;"        o       object:welcome
welcome.x       i18n/en.json    /^    "x": {$/;"        o       object:welcome
welcome.x.c      i18n/en.json    /^    "c": "hello {{.Name}}"$/;"        o       object:welcome.x

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: Mar 17 2024, 12:18:39
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc, +optscript, +pcre2

I've got it from archlinux repository.

extra/ctags 1:6.1.0-2
    Generates an index file of language objects found in source files
masatake added a commit to masatake/ctags that referenced this issue Dec 30, 2024
Close universal-ctags#4164

The test input is taken from universal-ctags#4164 submitted by Karol
Jakusz-Gostomski.
@masatake
Copy link
Member

The JSON parser didn't support to emit full-qualified tags.
I made the parser support it in #4165.
You must specify --extras=+q on the command line to emit full-qualified tags.

masatake added a commit to masatake/ctags that referenced this issue Dec 30, 2024
Close universal-ctags#4164

The test input is taken from universal-ctags#4164 submitted by Karol
Jakusz-Gostomski.
masatake added a commit to masatake/ctags that referenced this issue Dec 30, 2024
Close universal-ctags#4164

The test input is taken from universal-ctags#4164 submitted by Karol
Jakusz-Gostomski.
@akemrir
Copy link
Author

akemrir commented Dec 30, 2024

Thanks for very fast reaction, works very well.
obraz

obraz

@masatake
Copy link
Member

Thank you for verifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants