atom-haskell / ide-haskell-hasktags

Hasktags-powered replacement for symbols-view on Haskell projects
https://atom.io/packages/ide-haskell-hasktags
MIT License
6 stars 2 forks source link

auto update tags on save of files? #3

Closed wolftune closed 8 years ago

wolftune commented 8 years ago

I discussed this a long while back at https://discuss.atom.io/t/how-to-automatically-update-tags-file-upon-saving/20666/14

Is that related to what this ide-haskell-hasktags is for?

Incidentally, I had already been using hasktags with this command: git ls-tree -r HEAD --name-only | grep -E '*.hs' | xargs hasktags -x -c --ignore-close-implementation to look only at stuff that git is tracking

Using hasktags that way already works in Atom just fine, it just doesn't generate in atom, so it has to be run manually. However, this auto-updates with hasktags whenever git changes branches:

        cat >> .git/hooks/post-checkout <<EOF
        git ls-tree -r HEAD --name-only | grep -E '*.hs' | xargs hasktags -x -c --ignore-close-implementation
        EOF
        chmod u+x .git/hooks/post-checkout

and https://github.com/aloiscochard/codex is interesting too…

Perhaps I'm just confused because of lack of clear docs here, but I hope these references are helpful.

lierdakil commented 8 years ago

This package doesn't create a tags file. It does use hasktags internally, and it does rebuild internal tag list automatically whenever a file is added or changed on disk (doesn't matter if it's done in Atom or otherwise). It also offers a couple commands: show all tags, show tags in current file and go to declaration.

This was slapped together in an afternoon after I got tired of searching for declarations in one of my larger projects. I'm not a fan of how symbols-view implements using .TAGS file (more specifically, couldn't really make it work for me), so I kind of made a drop-in replacement (I say "kind of", because not everything is implemented, f.ex. going back to previous position)

wolftune commented 8 years ago

okay thanks, I guess this issue of auto-update is complete anyway