Difference between revisions of "Tags"

From HaskellWiki
Jump to navigation Jump to search
(Update list of projects providing tags)
m (hothasktags is Vim only)
Line 22: Line 22:
 
=== Actively developed ===
 
=== Actively developed ===
 
* [http://hackage.haskell.org/package/hasktags Hasktags]: Can produce either a ctags or etags compatible tag file. Uses its own parser.
 
* [http://hackage.haskell.org/package/hasktags Hasktags]: Can produce either a ctags or etags compatible tag file. Uses its own parser.
* [http://hackage.haskell.org/package/hothasktags hothasktags]: Knows about import lists and qualified imports. Uses haskell-src-exts for parsing.
+
* [http://hackage.haskell.org/package/hothasktags hothasktags]: Knows about import lists and qualified imports. Vim tags only. Uses haskell-src-exts for parsing.
 
* [http://hackage.haskell.org/package/lushtags lushtags]: Designed to have smooth integration with the [http://majutsushi.github.com/tagbar/ Vim Tagbar] plugin.
 
* [http://hackage.haskell.org/package/lushtags lushtags]: Designed to have smooth integration with the [http://majutsushi.github.com/tagbar/ Vim Tagbar] plugin.
   

Revision as of 11:47, 25 July 2014

Introduction

"Tags" are a listing of source code definitions in a group of files, together with their precise location, often used by text editors to quickly jump around in a program. For example, they allow you in a editor that supports tags to jump to the definition of a function when you come across a use of that function. ctags (for C) was the first tag-generation program. See the wikipedia article for more information.

There are currently a number of different ways to generate tags with Haskell.

Tags Formats

Tag files can be produced in a number of different formats supported by different editors. The two most common formats are 'ctags', which is supported by Vim and others, and 'etags', which is supported by Emacs. Note that the default names for the file in ctags format and the file in etags format are 'tags' and 'TAGS' respectively

Haskell tag generators

GHC

  • GHC can generate tag files from GHCi. Use either the ':ctags' or ':etags' commands to produce a tags file for the currently loaded modules.
For example:
echo ":ctags" | ghci -v0 Main.hs
echo ":etags" | ghci -v0 Main.hs

Actively developed

  • Hasktags: Can produce either a ctags or etags compatible tag file. Uses its own parser.
  • hothasktags: Knows about import lists and qualified imports. Vim tags only. Uses haskell-src-exts for parsing.
  • lushtags: Designed to have smooth integration with the Vim Tagbar plugin.

Other

  • haskdogs: Wrapper script for hasktags. (last update 2013)
  • fast-tags: Incremental Vim tag generation. Designed to be fast. Uses its own parser. (last update 2012)
  • gasbag: Attempts to choose the best available definition for a given tag. Will notice bindings that don't have an accompanying type signature. (last update 2011)
  • htags: Haskell 98 only. Uses haskell-src for parsing. (last update 2008)

GHC development

You can also find the source code for a tag generator in Chris Ryder and Simon Thompson paper on porting the Haskell Refactoring tool, HaRe, to the GHC API.

More Information

Vim

Others