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

Ctags json output is wrongly formatted #3305

Closed
NimaAgm opened this issue Mar 13, 2022 · 5 comments
Closed

Ctags json output is wrongly formatted #3305

NimaAgm opened this issue Mar 13, 2022 · 5 comments

Comments

@NimaAgm
Copy link

NimaAgm commented Mar 13, 2022

The name of the parser:C-parser

The command line you used to run ctags:
ctags.exe -R --languages=C --sort=yes -x --kinds-C=* --file-scope=yes --output-format=json -f tag2.txt

The version of ctags:

ctags --version
Universal Ctags 5.9.0(p5.9.20220306.0), Copyright (C) 2015-2022 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Mar 6 2022, 01:06:23
URL: https://ctags.io/
Optional compiled features: +win32, +wildcards, +regex, +gnulib_regex, +internal-sort, +unix-path-separator, +iconv, +option-directory, +xpath, +json, +interactive, +yaml, +case-insensitive-filenames, +packcc, +optscript, +pcre2

the problem is the format of output json file is wrong and I cant not work with in python it says the formats is wrong and and I checked format in json format checker it was wrong

sample of json output
jsontags.txt

python error
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 93)

@masatake
Copy link
Member

Sorry for making you confused.
We should use the name of the output format jsonl instead of json; though we use the name 'json', the actual data emitted by ctags is jsonl.

@NimaAgm
Copy link
Author

NimaAgm commented Mar 14, 2022

Thanks I understood. I parsed the information line by line

@NimaAgm NimaAgm closed this as completed Mar 14, 2022
@masatake
Copy link
Member

@hawkinchina
Copy link

how to Compile with json supported ?

@masatake
Copy link
Member

See #3272.

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

No branches or pull requests

3 participants