-
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
Elm,Units: Type and constructor tags exclude parameters etc. #3297
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3297 +/- ##
=======================================
Coverage 85.27% 85.27%
=======================================
Files 211 211
Lines 49826 49826
=======================================
Hits 42488 42488
Misses 7338 7338
Continue to review full report at Codecov.
|
@niksilver, thank you.
|
Hello @masatake. Thank you for accepting my code change. I'm currently trying to build a PackCC parser for Elm which will be more robust than the current regexp parser. As part of that I will see if I can add your suggestions. However, it's very slow going as I'm only a hobbyist developer. So I dare not give a timeframe, but it is something I'm working on. |
Interesting. Have you ever considered using the If you are interested in the option, I will write a small initial version of mtable-regex based Elm parser. |
Thanks, @masatake, that looks very promising. I'm going to pursue the PackCC parser for a while longer, but will revert to the mtable regexp approach if I feel like I'm losing the battle. |
@niksilver does your ctags link to pcre2? |
Apparently no pcre2...
|
This has been tested with
which passes.
This is based on a problem encountered in Vim using ctags. It's possible this problem is entirely different (or maybe isn't even a problem!) with a different Vim configuration, a different editor, or a different use case.
To understand the problem being addressed, consider the following code:
If the cursor is positioned under the
Cons
of the last line, then hittingCtrl-]
should take us to the definition ofCons
on line 2. However, this fails because Vim identifies the tag under the cursor as the pure alphanumeric stringCons
, but the tag in the tag file isCons a
.Similarly for when the cursor is placed under
Param
in the third line from the bottom.Also, if the definition of
Param
wasthen its tag would be recorded as
Param a =
. Even though that's not the recommended way to format Elm it would still be helpful to generate a useful tag.So this change is to have tags for types and constructors limited to the initial alphanumeric part, which solves all these problems.