#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;
}
I try to add a rule, and adding this rules, and CB not start now.
<::>
<![CDATA[]]>
</::>
Patch for it. :D
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;
}
see the screen shot.
welcome to test it.
[attachment deleted by admin]
Yes, it works well Thank you very much!
But there is a small problem, see the picture prompts.
[attachment deleted by admin]
All other tests are good.
[attachment deleted by admin]
ok,I will continue to improve it.
Quote from: blueshake on January 17, 2010, 08:02:23 AM
Patch for it. :D
[...]
welcome to test it.
Nice 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! :-)
Quote from: Loaden on January 06, 2010, 10:39:41 AM
I try to add a rule, and adding this rules, and CB not start now.
<::>
<![CDATA[]]>
</::>
You
do know how often "::" appears in C++ code (e.g.
MyClass::MyMethod)?! ;-)
well.
it mean nothing if the tokenType is not pttSearchText.
for example:
for global codecompletion,such codes:
::abc
when we type these codes,the search will break the texts(::abc) into two compesents.
one is "" ,type is pttNameSpace
another is "abc" ,type is pttSearchText.
continue my comment.
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 not do this.because for such search codes(ss:: ),so we need another statement tokenType == pttSearchText in the if condition too.
Quote from: blueshake on January 18, 2010, 02:48:08 AM
continue my comment.
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.
So, you mean: if we breakUP this statement"::abc".
We should result only
One ParserComponent. right?
yes,only abc should be keeped.so the cc will work like global search.
@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:
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;
}
Quote from: blueshake on January 18, 2010, 04:20:51 AM
@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:
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;
}
It's OK now! perfect!
[attachment deleted by admin]
Quote from: blueshake on January 18, 2010, 04:20:51 AM
@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:
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;
}
@morten
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??
Quote from: blueshake on May 01, 2010, 06:15:57 AM
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.
please check out the nativeparser.cpp file. in about line 1656
if (tok.Length() != 0 || tokenType == pttSearchText)
but in my above patch , it is
if (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
if you apply the patch I provided in this thread.http://forums.next.codeblocks.org/index.php/topic,12096.msg82256.html#msg82256 (http://forums.next.codeblocks.org/index.php/topic,12096.msg82256.html#msg82256)
when you type "(" , you will get what I mean.
Quote from: blueshake on May 01, 2010, 07:54:37 AM
please check out the nativeparser.cpp file. in about line 1656
if (tok.Length() != 0 || tokenType == pttSearchText)
but in my above patch , it is
if (!tok.IsEmpty() || (tokenType == pttSearchText && components.size() != 0))
if you apply the patch I provided in this thread.http://forums.next.codeblocks.org/index.php/topic,12096.msg82256.html#msg82256 (http://forums.next.codeblocks.org/index.php/topic,12096.msg82256.html#msg82256)
when you type "(" , you will get what I mean.
I apply the patch, and test it.
I can confirm this.