Re: Class Variables autocompletion

Andras Mantia <[email protected]>
Newsgroups gmane.comp.kde.devel.quanta.user
Message-ID <[email protected]>
On Sunday 04 February 2007, Andras Mantia wrote:
> I will give up some details, but I also have to look at the source
> first. ;-)

Here is the information (line numbers are referring to the current svn 
version from the 3.5 branch):

- the member autocompletion is done in Document::getTagCompletions if 
the current line contains the "MemberAutoCompleteAfter" regexp right 
before the cursor. In PHP, this regexp is (?:\.|->)$, matchin "." 
or  "->".
- the interesting part of the code starts from document.cpp, line 1229, 
when we are sure that the above regular expression comes after a text 
which denotes an "usage of a class". Below we find the name of the 
class. This will go to the "classStr" variable. You may safely ignore 
the mechanism how this name is determined.
- line 1318 is where the member functions are added to the completion 
list. This happens if the current "tag" (a structure used to store 
information about a XML tag, an entity, a class, a function or a 
variable) belongs to a class with the name we found (tag->className == 
classStr) or to a class derived from this "classStr" class.

So as it can be seen, the important thing is to add the 
correct "className" to all the variables which are declared inside the 
class, but not inside the member functions of a class.

The variables are found in the parser, namely in the SAGroupParser 
(special area group parser: Special Area = non-XML area. Group = 
variables, links, functions, classes, objects or so. They are defined 
in the description.rc).

Everything interesting regarding the class members is done between lines 
203-220 of sagroupparser.cpp. This is what needs to be modified so the 
className is corectly set.

Patch is welcome.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

_______________________________________________
Quanta mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/quanta
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFyGCpTQdfac6L/08RAvJFAJ0bb8R7THf0T6J5cc9VglUsyNCiVACgz+jl
Viwe/M4k1gK6xtI2v2Op7ZQ=
=FIAE
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.