Skip to content
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

get fast-tags to work with other editors, e.g. Atom #19

Open
wolftune opened this issue Sep 14, 2015 · 9 comments
Open

get fast-tags to work with other editors, e.g. Atom #19

wolftune opened this issue Sep 14, 2015 · 9 comments

Comments

@wolftune
Copy link

Currently, for reasons I don't understand (but haven't deeply investigated), fast-tags tags files don't work fully with Atom. Atom does allow browsing by tags but not jumping to tag under cursor. By contrast, hasktags -x -c works fully with Atom. The Hasktags option also works fully with Vim without trouble. I like using fast-tags so I get easy updates with Vim, but would want to have it work for Atom too, both for me on occassion and for others who don't use Vim.

Whatever the difference, it seems we should be able to figure out what's happening and fix it to make it work. I was hoping the 1.1.1 update would do it, but apparently not (by my testing).

@elaforge
Copy link
Owner

Here's what hasktags -x generates:

!_TAG_FILE_FORMAT   2   /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED   1   /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_NAME  hasktags
f   Test.hs /^f x = 10$/;"  fi  line:3

fast-tags generates this:

!_TAG_FILE_SORTED   1   ~
$   Test.hs 1 ;" o
f   Test.hs 3 ;" f

So there are lots of differences. I don't have atom, so I don't know what it doesn't like, but it would be easy to test by editing the hasktags output until it looked like the fast-tags one and seeing where atom stops liking it. If you do the testing I'd be happy to implement the change.

@wolftune
Copy link
Author

Ok, here's the answer: the only part of the hasktags output that Atom needed, the part that made all the difference was /^f x = 10$/ i.e. the funny /^ and the function line in questions and $/ before the finishing ;". It also failed if I removed any part of the line, it needed the whole line…

The headers at the top of the tags file seem irrelevant

@chreekat
Copy link
Contributor

The part between the filename and ;" is interpreted as a command by vim. Numbers are commands; they take you to the line number they indicate. But searches are also commands.

Atom must not be understanding number-as-command.

@wolftune
Copy link
Author

ah, well, knowing that then, could be simple to file a bug with Atom to recognize number-as-command as an alternative option. Of course, search works too and for Vim as well…

@elaforge
Copy link
Owner

Strange that atom would implement the hard one but not the easy one. I think historically /.../ syntax was added because it was less likely to be wrong when a line is added above, but that doesn't really apply to fast-tags, since it's intended to be run after every edit.

If atom doesn't want to add this feature I can add it to fast-tags, but it wouldn't be entirely trivial. It already saves a bit of the line for emacs tags (I don't really understand how those work), so I'd have to extend that to save the whole line.

@wolftune
Copy link
Author

Here's the real Atom ticket already existed: atom/symbols-view#92

@ntc2
Copy link

ntc2 commented Jun 27, 2018

Perhaps related, TAGS generated by fast-tags don't work with xref, the new TAGS navigator in recent versions of Emacs (I'm using Emacs 25.3.2). Searching for <name> with M-. / xref-find-definitions fails with No definitions found for: <name>. In contrast, TAGS generated by hasktags do work with xref.

This thread discusses how xref-find-definitions is stricter than find-tag:
https://groups.google.com/forum/#!topic/gnu.emacs.bug/G3DResYSSVE

elaforge added a commit that referenced this issue Jul 8, 2018
I didn't add the original code and I don't know anything about emacs, so
this is just a guess, but it seems to produce the same output as hasktags,
which is reported as working.

issue #19
@elaforge
Copy link
Owner

elaforge commented Jul 9, 2018

@ntc2 This should fix your problem, give it a try.

I'm leaving the issue open because it's for a different thing, namely that atom supports "/search" syntax but not ":linenumber" syntax.

@fommil
Copy link
Contributor

fommil commented Sep 27, 2018

it is possible that #43 will fix this, if these editors use Emacs formatted TAGS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants