-
Notifications
You must be signed in to change notification settings - Fork 620
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
Add support for Vala (finish work by Alberto Fanjul) #2661
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2661 +/- ##
==========================================
- Coverage 86.91% 86.91% -0.01%
==========================================
Files 183 184 +1
Lines 39018 39238 +220
==========================================
+ Hits 33912 34102 +190
- Misses 5106 5136 +30
Continue to review full report at Codecov.
|
Please update win32/ctags_vs2013.vcxproj.filters . |
Though I don't know Vala wll but I think your evalation of the parser may not enough.
For the input, ctags repots only speak in the interface.
|
Thanks for the new test case, I'll have a look. In any case, I'm not worried about trying to make it perfect. I had a look at anjuta-tags, the ctags fork with Vala support for the Anjuta IDE. Here's the Vala parser: https://gitlab.gnome.org/GNOME/anjuta/-/blob/master/plugins/symbol-db/anjuta-tags/vala.c I see why you weren't able to include it, as it is mostly written in Vala. By using the Vala parser directly I guess it will provide accurate results. So, I may be able to use it as a comparison. In any case, that makes me think that it is better simply to have reasonable Vala support in universal-ctags, without worrying too much about making it perfect the first time. |
The class I would like you who knows Vala to take a bit more time for evalation. This comment is applicable to myself, too. The Ansibleplaybook parser that I wrote is broken. I should not merge it. |
Fix a misleading comment. Fix incorrect spacing of close brace. Remove unnecessary conversion to bool. Add an “else” before a mutually-exclusive “if”.
Attributes, in matched square brackets, should be ignored, as otherwise they upset parsing. Add a test.
signature fields are tested.
I tried your test case with
I'll see what I can do about that in universal-ctags. |
I made some improvements! I'm not satisfied yet, but I would be interested in your opinion on my changes so far. My method has been to compare with the output of anjuta-tags, which as you know uses the actual Vala compiler's parser. One of the reasons that I stopped is that I realized that logically, |
The original version which your work is based is just incompleted. So the reason may be just "no resource and no time." |
@@ -12,12 +12,12 @@ void main(string[] args) { | |||
print("Hello %s, you're %d years old\n", p.name, p.age); | |||
} | |||
|
|||
class Address { | |||
public class Address { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you can store "public" to "access:" field.
[yamato@control ctags-github]$ cat /tmp/foo.cc
cat /tmp/foo.cc
class A {
public:
int x;
};
[yamato@control ctags-github]$ ./ctags -o - --fields=+'{access}' /tmp/foo.cc
./ctags -o - --fields=+'{access}' /tmp/foo.cc
A /tmp/foo.cc /^class A {$/;" c language:C++ file:
x /tmp/foo.cc /^ int x;$/;" m language:C++ class:A typeref:typename:int file: access:public
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint, I did wonder about this.
Ah, OK. I saw from the original discussion that you helped a lot, and provided the basis, so I thought there might be a reason! Since there's not, I will go ahead and try to make the recursion. It seems that even in etags mode, the output of |
Good. I think we can record the information about generics as C++ parser does:
I don't say the approach is bad. However, Making the Vala parser of u-ctags the same as that of anjuta-tags is not our goal. As a Vala programmer, do you think ctags extracts what you expect with proper kinds? This is the most important question.
I don't know Vala, but I thought "Speaker" should be tagged with "interface" with my knowledge about some other OOP languages. Writing down ideal tags files (expected tags file) helps you design a parser.
(I wonder how "abstract" should be recorded.) |
What kind of .el for utilizing TAGS output? just xref? I think emacs should have xref-ctags.el. I believe you understand what I mean. If you are good at emacs-lisp, and have an interest in native tags file support in GNU Emacs, could you open a new issue for the topic? I'm talking about contributing to GNU Emacs. I have worked on u-ctags for years. However, I myself cannot enjoy our fruits of the efforts on my favorite editor, GNU Emacs. |
Yes, I am just using xref. I had the same idea, I think it would be an excellent idea to make Emacs support ctags, rather than require its own format. I would be very happy to look into that and try to develop xref-ctags.el. |
The code-exchange contract is concluded! |
I take over this Vala parser development in #2677. |
(@masatake edited)