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

Ruby parser add support for --extra=q option #524

Open
lcmen opened this issue Aug 22, 2015 · 8 comments
Open

Ruby parser add support for --extra=q option #524

lcmen opened this issue Aug 22, 2015 · 8 comments
Milestone

Comments

@lcmen
Copy link

lcmen commented Aug 22, 2015

Hi!
Thanks all your hard work you put into this project.

I was wondering it would be possible to add support for --extra=q option for Ruby parser. When that option is specified tags should also include class with its namespace, i.e. A::B) not only B.

@masatake
Copy link
Member

Thank you for the request.

I don't know Ruby. Could you tell me the rule about scope separators? Which should I use :: or .?
One more when you want to enable --extra=q? I guess ctags developers don't have much interest --extra=q because, making q entries can be done in post processors which reading tags file generated by ctags.

I myself don't have much chance to use ctags, so I would like to know how people use it, especially about --extra=q.

@vhda
Copy link
Contributor

vhda commented Aug 25, 2015

This is mostly useful in vim, where you don't have access to the extra attributes of the tags. So if you want to search for the contents of, let's say, a class you need to search for class_name\..* or similar.
It is possible that this limitation exists in other tools, so having this support is always positive.

@masatake
Copy link
Member

@vhda, thank you for explanation.

I have got an inde to implement it in mainly main side.
But many parts must be modified. It will take long time.

Only the issue is about separators.
In my understanding a separator can be choose by relations between the kinds of parent and the kinds of child.

e.g.
If the kind of parent is class and the kind of child is method, the separator will be ..
If the kind of parent is namespace and the kind of child is class, the separator can be ::.
A parse should have a table(separators table?).
main part looks at the table when generating "q" related entry.

@lcmen
Copy link
Author

lcmen commented Aug 25, 2015

@masatake basically when class / module is nested (A::B), --extra=q would generate 2 records in ctags - one for class B and the other one for class A::B. It would be useful in vim so that I could immediately jump to the correct class if I highlight A::B. Currently I need to select B but if there are more B classes in other modules I would see all of them on the selection list.

The idea came from here - tmm1/ripper-tags#48. Currently I uses that gem to correctly generate ctags file for ruby.

Unfortunately I'm not very familiar with algorithm for generating tags file.

@masatake
Copy link
Member

How about method?
A.method?

@masatake masatake self-assigned this Sep 7, 2015
@masatake masatake modified the milestone: 1.1.0 Nov 15, 2015
@dgutov
Copy link

dgutov commented Jan 31, 2016

@masatake A#method for an instance (normal) method, and A.method for a class method (one defined with e.g. def self.method inside class A).

@masatake
Copy link
Member

The basic infrastructure is implemented as part of solving #787.
About python, fullQufalified tag is implemented on the infrastructure, and works fine.
Next one is ruby.

@masatake masatake removed their assignment Jan 24, 2019
@masatake masatake modified the milestones: Mn+1, Feature plan Nov 10, 2019
@zhengpd
Copy link

zhengpd commented May 6, 2022

Also looking forward to see namespaced tags with ctags. It's common to see same-name methods in different ruby modules in rails project. It could be really in-efficient to jump to the correct namespaced method tag.

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

5 participants