#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
::Mess // HERE,no-work. if not use global namespace, it's work fine.
return 0;
}
<::>
<![CDATA[]]>
</::>
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 6089)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1638,9 +1638,9 @@
}
Manager::Get()->GetLogManager()->DebugLog(F(_T("BreakUpComponents() Found component: '%s' (%s)"), tok.wx_str(), tokenTypeString.wx_str()));
}
+ if (tok.Length() != 0 || tokenType == pttSearchText)
+ components.push(pc);
- components.push(pc);
-
if (tokenType == pttSearchText)
break;
}
Patch for it. :DNice one. Can you do me a favor (for the future) and comment such changes? It's not very clear in the first place what the if statement actually means. Thanks! :-)
[...]
welcome to test it.
I try to add a rule, and adding this rules, and CB not start now.You do know how often "::" appears in C++ code (e.g. MyClass::MyMethod)?! ;-)Code<::>
<![CDATA[]]>
</::>
continue my comment.So, you mean: if we breakUP this statement"::abc".
so for pttNameSpace type ,if its text(tok) is empty.we need to eat this component.that is why the statement tok.Length() != 0 in the if condition.
but for pttSearchText type ,we can do this.because for such search codes(ss::),so we need another statement tokenType == pttSearchText in the if condition too.
But there is a small problem, see the picture prompts.
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 6089)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1638,9 +1638,9 @@
}
Manager::Get()->GetLogManager()->DebugLog(F(_T("BreakUpComponents() Found component: '%s' (%s)"), tok.wx_str(), tokenTypeString.wx_str()));
}
+ if (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
+ components.push(pc);
- components.push(pc);
-
if (tokenType == pttSearchText)
break;
}
@LoadenIt's OK now! perfect!
can you try this patch and give me feedback?
Is this issue still there?
QuoteBut there is a small problem, see the picture prompts.
patch:CodeIndex: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 6089)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1638,9 +1638,9 @@
}
Manager::Get()->GetLogManager()->DebugLog(F(_T("BreakUpComponents() Found component: '%s' (%s)"), tok.wx_str(), tokenTypeString.wx_str()));
}
+ if (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
+ components.push(pc);
- components.push(pc);
-
if (tokenType == pttSearchText)
break;
}
@Loaden
can you try this patch and give me feedback?
Is this issue still there?
QuoteBut there is a small problem, see the picture prompts.
patch:CodeIndex: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 6089)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1638,9 +1638,9 @@
}
Manager::Get()->GetLogManager()->DebugLog(F(_T("BreakUpComponents() Found component: '%s' (%s)"), tok.wx_str(), tokenTypeString.wx_str()));
}
+ if (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
+ components.push(pc);
- components.push(pc);
-
if (tokenType == pttSearchText)
break;
}
seems you don't apply this patch correctly,so in current cc, when you type "(" ,cc will give a lot of wrong tips.can you check this??Work fine here...?! What exactly do you mean? Remember that this is just for global namespace. IIRC we had discussed this. So that's why it is as it is now.
if (tok.Length() != 0 || tokenType == pttSearchText)
if (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
please check out the nativeparser.cpp file. in about line 1656I apply the patch, and test it.Codeif (tok.Length() != 0 || tokenType == pttSearchText)
but in my above patch , it isCodeif (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
if you apply the patch I provided in this thread.http://forums.codeblocks.org/index.php/topic,12096.msg82256.html#msg82256 (http://forums.codeblocks.org/index.php/topic,12096.msg82256.html#msg82256)
when you type "(" , you will get what I mean.