codecompletion's problem

Jens Zurheide jens.zurheide at gmx.de
Thu Feb 21 00:04:03 UTC 2002


Looking deep into the sources of kwrite... Yes, 13 is the attribute for a 
HlCSymbol which seems to be kind of a fallback value (if nothing else 
matches). I am referring to CHighlight::makeContextList() in file 
highlight.cpp here. So Roberto's approach is rather limited to C/C++ but 
seems to be correct. (col is column, isn't it ;-) )

Regards,
Jens

Wednesday 20 February 2002 19:05 Roberto Raggi
>hi Walter,
>i'm not sure.. but i think that attribute is different from color..
>
>ciaor robe
>
>On Wednesday 20 February 2002 18:31, W. Tasin wrote:
>> Hi Roberto,
>>
>> if I understand it correctly you are using the color to decide wheter it
>> should be activated or not...
>> this isn't IMHO a good idea because you can change the color on
>> highlighted sources.
>>
>> Ciao
>>
>> Walter
>>
>> Roberto Raggi wrote:
>> >hi all,
>> >if you press . or -> in a comment region or within a string, the code
>> >completion is activated!! i wrote a simple patch
>> >that solves the problem, but i don't know if it's a clean solution..
>> >in fact i use the TextLine attributes from highlight engine..
>> >
>> >what do you think?? shall i apply my patch?
>> >
[...]
>> >Index: cppcodecompletion.cpp
>> >===================================================================
>> >RCS file: /home/kde/kdevelop/kdevelop/Attic/cppcodecompletion.cpp,v
>> >retrieving revision 1.1.2.9
>> >diff -u -r1.1.2.9 cppcodecompletion.cpp
>> >--- cppcodecompletion.cpp	2002/02/18 19:00:15	1.1.2.9
>> >+++ cppcodecompletion.cpp	2002/02/20 13:47:12
>> >@@ -156,7 +156,11 @@
>> >                          col > 0 && m_edit->textLine( line )[ col-1 ]
>> > == '-') ) { kdDebug() << "---------------------------> complete
>> > (enabled by robe :-)" << endl; m_edit->insertText( ke->text() );
>> >-                completeText();
>> >+                TextLine* l = m_edit->doc()->textLine( line );
>> >+                int attr = l->getAttr( col );
>> >+                if( attr == 13 ){
>> >+                    completeText();
>> >+                }
>> >                 return TRUE;




More information about the KDevelop-devel mailing list