Haskell:ctags(和凯特编辑)

时间:2017-12-16 18:35:52

标签: haskell text-editor ctags kate

我为Kate编辑器尝试过CTags插件。它有点工作,索引构建静默(没有错误消息),数据库文件以及必要的菜单条目出现。然后Go to definition - No hits found

我并不感到惊讶。显然,凯特以这种方式构建索引:

ctags -R --c++-types=+px --extra=+q --excmd=pattern --exclude=Makefile --exclude=.

它暗示了C ++;我说不出更多。 Haskell ctags的正确命令行是什么?

UPD:

hasktags已被建议。我设法安装并暂时运行它:

$ stack exec hasktags
Usage: hasktags [OPTION...] [files or directories...]
directories will be replaced by DIR/**/*.hs DIR/**/*.lhs
Thus hasktags . tags all important files in the current
directory.

    If directories are symlinks they will not be followed
unless you pass -L.

A special file "STDIN" will make hasktags read the line separated file
list to be tagged from STDIN.

  -c            --ctags                        generate CTAGS file (ctags)
  -e            --etags                        generate ETAGS file (etags)
  -b            --both                         generate both CTAGS and ETAGS
  -a            --append                       append to existing CTAGS and/or ETAGS file(s). Afterward this file will no longer be sorted!
                --ignore-close-implementation  ignores found implementation if it is closer than 7 lines - so you can jump to definition in one shot
  -o            --output=                      output to given file, instead of 'tags', '-' file is stdout
  -f            --file=                        same as -o, but used as compatibility with ctags
  -x            --extendedctag                 Generate additional information in ctag file.
                --cache                        Cache file data.
  -L            --follow-symlinks              follow symlinks when recursing directories
  -S[.hs,.lhs]  --suffixes[=.hs,.lhs]          list of hs suffixes including "."
  -R            --tags-absolute                make tags paths absolute. Useful when setting tags files in other directories
  -h            --help                         This help

凯特CTags database file还有一些路径:

/home/alexey/.local/share/kate/katectags/session_db_20171216_180641

我无法从hasktags自述文件中获取更多信息。

1 个答案:

答案 0 :(得分:0)

我在.zshrc中使用hasktags和shell函数来简化操作:

hasktags --ignore-close-implementation --ctags .