Re: [Quanta] Class Variables autocompletion

Andras Mantia <[email protected]> Wed, 7 Feb 2007 13:28:05 +0200
Newsgroups gmane.comp.kde.devel.quanta
Message-ID <[email protected]>
Moved here from the user list...

> Thanks,
> I started to play with the code, and, without making any changes,
> except those to the description.rc file you suggested, it works!

Works, but has some bugs. ;-)

> Variables and functions are now listed (functions first, variables
> second....).
> The "wrong" variables (class function variables) are filtered as
> well!

Partly. Try to add an argument to a function and you will see that those 
are listed as well.

> The only real problem is when you select the autocomplete entry it
> appends the function open bracket "(" to the variables as well. I
> figure this is in the auto-complete section in document.cpp, rather
> then the sagroupparser.cpp file?

Hm, partly yes, I think. The problem is that with the modification in 
description.rc, variables are treated just like functions. In 
Document::slotFilterCompletion you can see that 
the "completionDTD->attrAutoCompleteAfter" is appended after the string 
if the type of the completion is "script". And in 
Document::getTagCompletions of course in case of PHP the type is set 
to "script". The easiest way might be to add a hint in to the qTag 
similar to className about the fact if it is a "function" 
or "variable". Than in the filtering code, 
the "completionDTD->attrAutoCompleteAfter" would be appended only for 
functions. This would also make it possible to sort the completion list 
(e.g variables first and methods later).

 Regarding the filtering, I see two solutions:

1) add a field in description.rc for the variables about how they are 
declared when they are member variables.
2) ignore variables that are inside ( ). If this is generic enough, I'd 
say it is better.

So from what I see, it is rather simple to do this. Will you do it? :-)

> I might look into reading doxygen/javadoc/PHPDoc, etc style comments
> and displaying them? any recomendations for how to implement?

What would you implement there? Sorry, I did not understood it.

BTW, something other to think about is support for PHP superglobals. I 
don't think it is too hard, somehow the .tag files have to describe the 
globals and they should be treated just like variables (members of the 
Variables group). 

> I will warn you, I am very rusty in my c++ :-)

Practicing will surely help. ;-)

Andras	

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

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

iD8DBQBFybfGTQdfac6L/08RAuqfAKC97MZAlM7+snR9M3hPbUqG/CHN4QCguOf9
USMS77fSEuvn+ckPNwnNGdM=
=HKGV
-----END PGP SIGNATURE-----