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: assigning to context
variable creates a broken tag
#453
Comments
A special case was added in 76dbed4 for some reason. I guess we should first find out why before just dropping it. |
It seems like the author wanted to add RSpec syntax support. RSpec is a popular Ruby testing framework and is used with such syntax: describe My::Class::Name, "some description" do
context "another description" do
...
end
end Behind the scenes, RSpec defines dynamic classes named after given parameters. However, those classes are internal, exist only at runtime, and are usually never referenced from code. Therefore, I'm not sure why someone would want tags generated from those definitions. My vote is to drop this obscure feature because it's proven to be brittle. Was it even written with tests? |
I guess the original code want to make a tag for "another description" as a context kind. BTW, @mislav, what kind of file extension for rspec file is popular? .rb or .rspec? |
I understand the things well. |
My suggestion was to drop this feature. I don't know why someone wanted to index the context & describe as tags. I don't even know how would you jump to such tag from the editor. |
For your purpose you can put --kinds-ruby=-dC to your .ctags. |
I'm still thinking about this issue.
Making the ruby parser handle two tokens after the keywords is possible. However, improving xcmd features to support ripper-tags is more attractive. I will continue to work on this issue. |
I think that was it: someone had their text editor configured to provide navigation within a file based on tags generated for that file, wanted to navigate between However since the implementation is lacking and creates false positives, you should either work on improving the implementation or dropping the feature. If you ask yourself whether you want to work on improving this feature and maintaining it in the long run with tests, and the answer is yes, then please go ahead and improve it. But as you said, it might be easier to concentrate on external parser support that would handle these complex cases, and focus on just the basic feature set for Ruby in universal-ctags. |
You are right. Howerver, these issue gives me a chance to think about ctags and its internal deeply. |
In 1.0.0 I will remove 'd' and 'c'. |
You are both correct with the principal use for identifying tags or other strings following context and describe blocks is for summarization of the file. Many IDEs offer various UIs for outlining and other summarization of project files. Since test files can have more highly varied structure to the nomenclature of the blocks, I understand they are more eratic. Summarizing test files is very useful because well-written tests describe the functional dimensions of a library in a wholistic and integrated fashion. Relying on a standardized tag parser is preferable due, not only, the range of file/language formats – but also because of the range of meaning that comes from testing frameworks. Developing a single-purpose solution seems harder to sustain. I would prefer to argue for the support or help support it myself (if I'm able). I welcome suggestions about better alternatives, or other avenues to pursue for the ends needed here (code summarization?) Maybe others that work that work closer to core tooling have another perspective. |
Two tasks remains.
|
There should be no tag generated from this code:
However, the parser creates a tag named
= A
. This only happens when assigning tocontext
variable; if the name is changed, the tag isn't defined.The text was updated successfully, but these errors were encountered: