Would be cool to add below along with
https://defect.opensolaris.org/bz/show_bug.cgi?id=17849

looking for generic way how to manage ctags, who can design it ?

--
L

On 12.6.2011 19:10, Felix Annan wrote:
Thanks for incorporating the changes. I appreciate your efforts to improve this 
product. It's very very cool stuff.

I was also trying to get the ctags to work with visual basic to be able to get 
the Navigate functionality to work with visual basic code files.
I found some instructions on creating a ctags.cnf file with regular expressions 
for visual basic here:
http://www.rutherfurd.net/2003/apr/

I extended the functionality of the regular expressions to become this:

--langdef=vb
--langmap=vb:.bas.cls.ctl.frm.vbs.vb
--regex-vb=/^[ \t]*(Public|Private|\b)[ \t]*Sub[ 
\t]+([a-zA-Z0-9_]+)/\2/s,subroutine/i
--regex-vb=/^[ \t]*(Public|Private|\b)[ \t]*Function[ 
\t]+([a-zA-Z0-9_]+)/\2/f,function/i
--regex-vb=/^[ \t]*(Public|Private|\b)[ \t]*Class[ 
\t]+([a-zA-Z0-9_]+)/\2/c,class/i
--regex-vb=/^[ \t]*(Public|Private)[ \t]+([a-zA-Z0-9_]+)[ \t]+As[ 
\t]+/\2/v,variable/i
--regex-vb=/^[ \t]*(Public|Private|\b)[ \t]*Dim[ \t]+([a-zA-Z0-9_]+)[ \t]+As[ 
\t]+/\2/v,variable/i
--regex-vb=/^[ \t]*(Public|Private|\b)[ \t]*Const[ \t]+([a-zA-Z0-9_]+)[ 
\t]+(As|=)[ \t]+/\2/c,const/i
--regex-vb=/^[ \t]*(Public|\b)[ \t]*Property[ \t]*(Get|Let|Set)[ 
\t]+([a-zA-Z0-9_]+)/\3/n,name/i
--regex-vb=/^[ \t]*(Public|Private|\b)[ \t]*Enum[ 
\t]+([a-zA-Z0-9_]+)/\2/e,enum/i
--regex-vb=/^[ \t]*([a-zA-Z_]+):/\1/l,label/i

I added the path to ctags.exe to my environment path variable so I had to put 
the ctags.cnf file in the root of the drive that ctags runs from eg. 
D:\ctags.cnf. For some reason it doesn't find it when I put it in the same 
folder as the ctags executable.
Then I was able to reindex all necessary files and the Navigate pop-up now 
shows all variables, functions and classes. Being an external file it can be 
extended over time to include more types that aren't represented yet. eg 
Interfaces . Currently this flags all variables whether they are within 
functions or not, so you end up with a ton of variable names in the variables 
section. That could be good or bad depending on your point of view.
-- This message posted from opensolaris.org _______________________________________________ opengrok-discuss mailing list opengrok-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opengrok-discuss

_______________________________________________
opengrok-discuss mailing list
opengrok-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opengrok-discuss

Reply via email to