javasupport

Bernd Gehrmann bernd at physik.hu-berlin.de
Sun Jun 3 22:32:23 UTC 2001


On Sun, 3 Jun 2001, Richard Dale wrote:
> BTW - what does the new ctags stuff do? I thought you had ported the
> ctags parser to use the KDevelop class store - but I can't find any code to do
> that. 

That was the original plan, and I think Sandy will remember me
talking about it ;-) There are basically two ways of employing
ctags as a parser: First, you can use the ctags command externally
and read the tags file it writes from disk. Second, you can use
the parsers (like ruby.c) and write some C++ code around it such
that the parsers deliver their tags to KDevelop's class store.
I still think that the latter is possible, although it requires
some non-trivial work to isolate the code that is really necessary 
from the code that is specific to the command line program.

Nevertheless, this approach is quite unsatisfactory. ctags outputs
only tags, i.e. identifier strings, and little more. For C++,
you don't get e.g. the full method signature which includes the
types of parameters. For other languages, it is simpler, but
I would prefer to write real parsers written in C++ in KDevelop's
framework whereever possible. For many scripting languages it is
quite easy to implement some hacks with regular expressions like
I did with Python and Perl. Since ctags parsers are also hacks
without proper tokenizers, we are not much worse then ;-)
I think it's possible for Ruby.

> I'm keen on KDevelop Ruby support, and I see this in ctagsdlg.cpp:
> 
> static CTagsKindMapping kindMappingRuby[] = {
>     { 'c', I18N_NOOP("class")               },
>     { 'f', I18N_NOOP("function")            },
>     { 'm', I18N_NOOP("mixin")               },
>     { 0  , 0                                }
> };

Hmm, now I see it I'm a bit surprised. The mixin is
mentioned in the manpage, but I don't think ctags really
generates such tags.

> What is it all about, if that isn't a silly question?

It's not a silly question :-) That part was a 1-evening hack to
get at least some basic support for all the languages we don't
have proper support for yet. It allows you to open a dialog
where you can enter a search string which is then searched for
in the tags file. The search string supports regular expressions,
e.g. you can search for '.*Factory' to get all identifiers which
end on Factory, i.e. all class names and function names or whatever
the parser supports. In a check list with tag types, you can choose
which types you want to use. By clicking in the result list, you
go to the source file location. There is no connection to the class
store or the class view.

Bernd.


-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list