On Mon, 05 Dec 2011 13:20:25 +0000, Bryan Hunt <bryan.hunt@...> wrote:
> On Thu, 1 Dec 2011 21:34:57 -0600, Darren Hiebert <Darren@...> wrote:
> > Peng,
> >
> > Exuberant Ctags provides the option —extra-tags=+q to include extra class-qualified tags to the tag file (e.g. “ClassName.methodName”). This allows you to go to the tag you want (e.g. “:tag ClassName.methodName” in vim). Granted, an editor generally cannot figure out which tag is intended when you jump to “methodName”, but that is something you aren’t going to be able to get without integrated compiler support like you have in an IDE.
> >
> > Regards,
> > Darren
I use the following config to give me the class/filename from which the
definition originated, while using CTAGS with VIM.
% cat .vimrc.actionscript
au BufWritePost *.as,*.mxml silent !astags
" Actionscript files are incorrectly mapped to Atlas filetype.
au BufRead,BufNewFile *.mxml,*.as set filetype=actionscript
au BufRead,BufNewFile *.as set syntax=actionscript
au BufRead,BufNewFile *.mxml set syntax=mxml
"au FileType actionscript set omnifunc=actionscriptcomplete#CompleteAS
au BufRead,BufNewFile *.mxml set syntax=mxml
% cat ~/bin/astags
#!/usr/bin/env zsh
#The purpose of this script is when processing mxml files, to remove the .mxml suffix
#from the link to the first line of the file, this in turn is generated by adding the flag
# --extra=+f to the ctags config, stored in ~/.ctags
if [[ $PWD == $HOME* ]]
then echo "Don't run this program under your home directory!" > /dev/stderr
exit 1
fi
ctags -R -f - . 2> /dev/null | sed -r -e 's_([a-zA-Z0-9]*)\.(scala|mxml|as)(\s.*\s1;.*)_\1\3_g' > tags
% cat .ctags
--langdef=actionscript
--langmap=actionscript:.as.mxml
--extra=+fq
--regex-actionscript=/^[ \t]*package[ \t]+([A-Za-z0-9_.]+)[ \t]*/\1/a,package,packages/
--regex-actionscript=/^[ \t]*[(private|public|protected|static) ( \t)]+function[ \t]+([A-Za-z0-9_]+)[ \t]*\(/\1/f, function, functions/
--regex-actionscript=/^[ \t]*[(public|static|internal|final|override)( \t)]*function[ \t]+(set|get)[ \t]+([A-Za-z0-9_]+)[ \t]*\(/\2/p,property, properties/
--regex-actionscript=/^[ \t]*[(private|public|protected) ( \t)(static)]+const[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/t,constant, constants/
--regex-actionscript=/^[ \t]*public[ \t]+class[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class, classes/
--regex-actionscript=/^[ \t]*public[ \t]+interface[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/i,interface, interfaces/
--regex-actionscript=/[ \t]id=['"]([A-Za-z0-9_]+)['"]/\1/v, variable, variables/
--regex-actionscript=/^[ \t]*[(public|static|internal|final|override)( \t)]*var[ \t]+([A-Za-z0-9_]+)[: \t]*/\1 \2/v,variable, variables/
Regards,
Bryan Hunt
|