-
Notifications
You must be signed in to change notification settings - Fork 628
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
Julia: generate reference tags for external entities #2727
Conversation
Please, run "make tmain" locally. You must update "stdout-expected.txt" file(s). |
What you are missing is I will review this pull request more. You can do "push --force" anytime you want. |
If the language is not Sexp based, all the languages are the same for us, aren't they? |
Haha ;) Mostly true, but the The patch is now partially fixed, but still has some problems. Run $ ctags --options=args.ctags -f- input.jl in
|
About 1. and 3. , see my review comments.
I decided not to be too strict about the way of style because e-ctags was not so strict. If you want to edit an existing .C file, you have to do (1) \C-x \C-f the file, (2) M-x c-guess. |
Oh yes! This is really cool. Thank you! |
The following change fixes the pattern.
|
Thanks! I think I know why. Although I don't totallly understand |
|
||
skipWhitespace(lexer, false); | ||
if (lexer->cur_c == ',') | ||
while (lexer->cur_token == TOKEN_IDENTIFIER || lexer->cur_token == TOKEN_MACROCALL) |
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.
It seems a tab char may be used here. M-x untabify may be needed.
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.
OK. Didn't know untabify
before. Actually I ran c-guess
on this file and seems it didn't set up the correct style for me.
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.
As far as I can remember, it doesn't distinguish tab and space.
This is the most important topic. They do not interfere with each other. |
Most of the things work well now. The only problem left is for something like: import Lib1.func1, Lib1.func2 It will create 2 tags for import Lib1.func1
import Lib1.func2 and generate
Exactly.
Ok. I'll change it. |
Yes. 'Lib1' is referenced twice. Therefore two reference tags are needed. |
You must update Tmain/list-roles.d/stdout-expected.txt. |
Codecov Report
@@ Coverage Diff @@
## master #2727 +/- ##
==========================================
+ Coverage 86.96% 86.97% +0.01%
==========================================
Files 193 193
Lines 44000 44048 +48
==========================================
+ Hits 38263 38310 +47
- Misses 5737 5738 +1
Continue to review full report at Codecov.
|
Could you squash the commits into one commit, and do push --force ? |
ba501ba
to
444d411
Compare
Done. |
Hi, using Module6,
Module7,
Module8
using Module9: func1,
func2,
func3 To make sure these are parsed correctly. They are well parsed now but just in case maybe. Also, ideally, when code is written inside a module: module Module1
function func1() end
struct Struct1 end
end the definitions should be in Please let me know if you need my help. |
Just to let you know of a possibility in Julia: using Module1
import Module1: func1 the whole |
Thanks! using Module6,
Module7,
Module8 This isn't handled well in my experiment. I must fix it.
I haven't tried the commented code you mentioned, but let's do it in a separate patch. However I do want to point out a problem with file-based tagging: If something is directly defined in a file (with no module wrapping it), and when that file is executed, it's in the module Now let's support we have module MyModule
include("module-file1.jl")
include("module-file2.jl")
end Then when we
I guess you could just Edit: Though out of topic... I think the behavior is: with |
This is similar to "#include <stdio.h>" in C language. What we have to do as the first is:
You can add more tags in the second pass if you have "multipass parsing". |
I could track only some of the comments but...you don't need to put all the ideas into one pull request. |
4df8c75
to
fefb20b
Compare
I think our CI has some problems on macOS... |
In such a case, trigger "Re-run all jobs". With my account, I can do it. I wonder whether you can do it with your account or not. |
I can. In fact, I already tried it several times, but that didn't help. Also, the CI on the recent merge commit also ran into problem on macOS:
So maybe it's a problem on GitHub's side. |
I disabled macos-11.0 at |
20e3529
to
61dca52
Compare
Done. |
I'm very sorry to be late. I rethink the kinds and roles. How about these ones? # your proposal:
# Lib: kind:module,roles:using
# my idea:
# Lib: kind:module,roles:used
using Lib
# your proposal:
# BigLib: kind:module,roles:using
# thing1: kind:unknown,roles:using
# thing2: kind:unknown,roles:using
# my idea:
# BigLib: kind:module, roles:namespace
# thing1: kind:unknown,roles:used
# thing2:> kind:unknown,roles:used
using BigLib: thing1, thing2
# your proposal:
# Base: kind:module,roles:imported
# thing1: kind:unknown,roles:imported
# my idea:
# Base: kind:module, roles:namespace
# thing1: kind:unknown,roles:imported
import Base.show I think
Acceptable? If yes, it is better to have one page like man/ctags-lang-python.1.rst.in. |
Totally agree. Using a |
@masatake I've finished it. I still want to do some refactor because the code parsing |
820df21
to
b0d414e
Compare
@AmaiKinono, the man looks good to me. |
The unknown kind will be resolved in the future with #2741 :-P. |
15ddf1c
to
421345a
Compare
421345a
to
f1bfe7b
Compare
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.
LGTM. Please, merge the commits with "Squash and merge" button.
This is an unsuccessful try, but at least you can use it as a reference. I put all the julia
using/imported
forms in the comment, and created a test case (with the expected output).I haven't write C code for 7 or 8 years, so maybe my code is too bad to fix, but if you think this can still be fixed and merged, here are the problems:
(This part is outdated. See the added part below).
Here are some minor considerations:
Update:
The patch is now partially fixed, but still has some problems. Run
$ ctags --options=args.ctags -f- input.jl
in
Units/parser-julia.r/library.d/
to see them.The lexer doesn't jump accross dots. From other unit tests I guess this is the desired behavior, but then for
Library4
, it capturesLibrary4.func1
as a whole, which is unwanted.Some pattern fields are generated for the wrong lines. I wonder why this happens...