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

Can't get yaml parsing working #1322

Closed
haizaar opened this issue Mar 20, 2017 · 8 comments
Closed

Can't get yaml parsing working #1322

haizaar opened this issue Mar 20, 2017 · 8 comments

Comments

@haizaar
Copy link

haizaar commented Mar 20, 2017

I've built ctags from master (rev cbbf4fe). And I can't get the yaml pasring working:

$ ./ctags --list-languages |grep -i yaml
Yaml
$ cat /tmp/my.yml
a:
  b:
    c: 1
$ ./ctags /tmp/my.yml
$ cat tags 
!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE	u-ctags	/u-ctags or e-ctags/
!_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	0.0.0	/cbbf4fe/

Am I missing something?

@masatake
Copy link
Member

masatake commented Mar 20, 2017

Currently the yaml parser tags only anchors and aliases(only when r(reference extra tag) is enabled).

For

a:
  b:
    c: 1
    d: something

What kind of output do you expect?
a, b, c, and d? How about something?

@haizaar
Copy link
Author

haizaar commented Mar 20, 2017 via email

@haizaar
Copy link
Author

haizaar commented Mar 21, 2017

Tried with anchors - works fine. Thanks!

@haizaar haizaar closed this as completed Mar 21, 2017
masatake added a commit that referenced this issue Mar 21, 2017
@masatake
Copy link
Member

However since swagger format is quite specific, it may be worth creating a dedicated parser (plugin) for swagger.

That is the point.
I'm working on implementing an infrastructure (API) for writing subparsers on a base parser.
In your case yaml is a base parser and swagger is a subparser.

P.S. running ctags --list-kinds reveals that anchors misspelled as "anchros".

Thanks. Fixed in HEAD.

@haizaar
Copy link
Author

haizaar commented Mar 22, 2017

Great. I'll appreciate if you update this post when the API is ready, so I can try it out.

@masatake
Copy link
Member

I submit a patch set for implementing a subparser. 9ac9b7a

Swagger parser can be implemented on yaml parser with this new infrastructure. However, it is not enough.
Token API is not powerful enough. After implementing the token API, I can work on swagger parser. It takes more time.

@t-b
Copy link
Contributor

t-b commented Apr 17, 2020

I found this issue as ctags could not find anything in my gitlab-ci.yml files.
As I'm only interested in the array names starting at the start of line I added

--kinddef-Yaml=a,array,array at start of line
--regex-Yaml=/^([[:graph:]]+):[[:space:]]*^/\1/a/i

to my ctags config file. Works so far :)

@masatake
Copy link
Member

masatake commented Jan 7, 2022

See #3245 and #3254. Now OpenAPI/Swagger parser is available.

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