The CC (r6200 debugger branch), adds () randomly after the completed text.
Steps:
1. type variable name (var_a, for example)
2. press ctrl + c
3. choose a method in the list
4. press enter
5. sometimes (randomly) CC adds "()" at the end and most of this times the "()" string is unwanted (by me).
Requests:
1. Please make this feature optional
2. You can improve it to kick in only if the cursor is at the end of the line
=> it will not mess with people when they are modifying already written code (changing the name of a method, for example).
Ctrl+space may switch language input method in Windows of some country, so I don't prefer this.
Maybe Alt+space or others, or as an option in Editor dialog.
actually it (the string "()" )is added if the item in the suggestion box is a function.
@oBFusCATed
from the your post ,it seems it don't work correctlly. :wink:
Yes, it does add "()" for class names too, but it is pretty random
QuoteYes, it does add "()" for class names too, but it is pretty random
for the random.
can you give me some test codes,please?
No, because it is random...
Most of the times it happens when I copy the function/method declaration from the .h file,
paste it in the .cpp file and type class_name:: (in the middle of the typing I hit ctrl+space to do auto completion)
@oBFusCATed
please try to change codes (int CodeCompletion::CodeComplete() in the file codecompletion.cpp) from
if (token->m_TokenKind == tkFunction || token->m_TokenKind == tkConstructor || token->m_TokenKind == tkDestructor)
to
if (token->m_TokenKind == tkFunction)// || token->m_TokenKind == tkConstructor || token->m_TokenKind == tkDestructor)
I hope this can fix your trouble. :D
blueshake: have you seen this problem on your code or you're just guessing a fix?
p.s. I'm using the debugger branch
yes,I have try it in ccbranch.it work well
for example :
test codes:
class qq
{
qq() {}
int x;
int y;
};
q|
when you edit in the positon "|", cc give you codecompletion suggestion box, and you press enter,in the before, it wil auto add the "()" ,but now it will not after applied the modifation.
The reason is :
the class name is the same to the class's construtor,when we generate the suggestion list,we think class construtor is funciton,but actually it maybe is class.and that is why you type class ,but the "()" is added automatically.
Quote from: oBFusCATed on May 03, 2010, 03:34:39 PM
Requests:
1. Please make this feature optional
I think we need
remove this feature.
BTW. The patch based cc branch.
[attachment deleted by admin]
> Please make this feature optional
done in cc branch (svn6361) :lol: