-
Notifications
You must be signed in to change notification settings - Fork 23
when a record and a module have the same name. #14
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
Comments
vim-erlang-tags.erl generates extra tags (#rec for records), and when C-] is hit on a record, the # is counted as part of the name, so only records tags will be considered. If there are several records with the same name, it is still not guaranteed that C-] will jump to the correct one. Same was implemented for macros and '?'.
Hi, There is bad news and good news. The bad news The bad news is that vim-erlang-tags cannot always jump to the correct location because of Vim's limitations in handling tags. vim-erlang-tags uses only one trick (adding ":" to the list of keyword characters temporarily), and then uses Vim's mechanisms for deciding which tag to jump to. This mechanism is not very smart. In this Stack Overflow post, @weisslj tried to write a more intelligent function that decides where to jump when the user presses
and generate separate tags files for them:
and add them to Vim:
then hitting C-] on "g" in the body of "y:f" will erroneously jump to the definition of "x:g", because when it found the "best" match in the first tags file ("x.tags"), it didn't even look at the second tags file. The problem with writing a smart function that makes the decision instead of Vim is (as @weisslj explained) that "while taglist() and :tselect return the order independent of the file order in 'tags', but dependant on the current file, :tag uses the order in 'tags'. The best solution would be a new tagselect() function that can navigate exactly to an item in the list returned by taglist(). It was suggested on the mailing list in 2005 and received positive replies, but was not implemented since then." The good news 1 There is a simple workaround. When Vim jumps to a tag, it actually remembers all possible locations. So if you have both a module and a record named The good news 2 In this particular case, I implemented a fix in my "records" branch. Please try it and report back if it works. If you are standing on a record whose name is preceded with a |
Hi, it's reaaaaaally coooool! |
(#14) Jump to record/marco after '#' or '?'
Thanks for the feedback, I merged the patch in #15. |
hello,
I think ErlangTags is very nice,but I have a little bit problem is that when a record name is the same as any module,the
ctrl + ]
always jump to the module,not the record.I hope this can be solved.
thks.
The text was updated successfully, but these errors were encountered: