2009-09-24 11 views

Odpowiedz

3

Rozciągliwe ctags już obsługuje tag field "moduł" dla Erlang.

$ /usr/bin/ctags --version 
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert 
    Compiled: Aug 17 2010, 17:33:33 
    Addresses: <[email protected]>, http://ctags.sourceforge.net 
    Optional compiled features: +wildcards, +regex 
$ /usr/bin/ctags xref_parser.erl 

Typowa slogan z polem tag o nazwie „moduł” wygląda następująco:

yeccgoto_const xref_parser.erl /^yeccgoto_const(24=_S, Cat, Ss, Stack, T, Ts, Tzr) ->$/;"  f  module:xref_parser 

Właściwie, to VIM która nie obsługuje tego pola tag jak na razie. Od VIM doc:

{field} .. A list of optional fields. Each field has the form: 

      <Tab>{fieldname}:{value} 

     The {fieldname} identifies the field, and can only contain 
     alphabetical characters [a-zA-Z]. 
     The {value} is any string, but cannot contain a <Tab>. 

     There is one field that doesn't have a ':'. This is the kind 
     of the tag. It is handled like it was preceded with "kind:". 
     See the documentation of ctags for the kinds it produces. 

     The only other field currently recognized by Vim is "file:" 
     (with an empty value). It is used for a static tag. 

To wszystko. Tylko "rodzaj" i "plik" to obsługiwane nazwy pól tagów.

+0

To narzędzie generuje moduł: znaczniki funkcji dla plików Erlang w taki sposób, że Vim może z nich korzystać: https://github.com/vim-erlang/vim-erlang-tags – hcs42

1

Wygląda na to, że nie używasz modułu Erlang etags: Generate Emacs TAGS file from Erlang source files.

+0

etagi są dla Emacsa, a ja używam Vima. – hcs42

+0

Korekta: Vim może również używać etagów skompilowanych za pomocą funkcji + emacs_tags. Jednak wydaje się, że etagi nie obsługują także kwalifikatorów modułów. – hcs42

0

Jestem wysublimowanym użytkownikiem 2 tekstowym i znajduję ctags działający poprawnie na moim komputerze. i używam ctags plugin dla wysublimowanej 2.


-> ctags version

Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert 
Compiled: Jul 24 2012, 11:45:55 
Addresses: <[email protected]>, http://ctags.sourceforge.net 
Optional compiled features: +wildcards, +regex 
3

Jak LHT napisał Żywiołowy Ctags 5.8 już przechowuje moduł funkcji w pliku tagi. Przynajmniej z ostatnimi wersjami Vima (7.4) można uzyskać dostęp do tych informacji. Można wtedy wyszukać "moduł: funkcja" przy użyciu niestandardowej funkcji "znacznika", np .:

function! ErlangTag() 
    let isk_orig = &isk 
    set isk+=: 
    let keyword = expand('<cword>') 
    let &isk = isk_orig 
    let parts = split(keyword, ':') 
    if len(parts) == 1 
     execute 'tag' parts[0] 
    elseif len(parts) == 2 
     let [mod, fun] = parts 
     let i = 1 
     let fun_taglist = taglist('^' . fun . '$') 
     for item in fun_taglist 
      if item.kind == 'f' && item.module == mod 
       silent execute i . 'tag' fnameescape(item.name) 
       break 
      endif 
      let i += 1 
     endfor 
    endif 
endfunction 

nnoremap <buffer> <c-]> :call ErlangTag()<cr>