Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Some strange behaviors

<< < (3/4) > >>

blueshake:
so should we  add the codes

--- Code: ---                while ((x >= 0) && (line.GetChar(x) == ' ' || line.GetChar(x) == '\t'))
                     --x;
--- End code ---
to the function or others?

MortenMacFly:
Both of you got me irritated by now... So I am simply looking forward to a new patch... ;-)

ollydbg:
Step into the CC plugin when I enter the "." after


--- Code: ---while   ()

--- End code ---

I find that the "BreakUpComponents" function will give the components as "while".

See the screenshot


So, the code-completion related code will firstly search the global token trees, and the Keywords list, finally, it find one match "while".

So, the wrong call tip displayed.

I think the expect result that BreakUpcomponents return should be *empty* instead of a "while".

blueshake:
i think the problem can be solved by this patch too.
which one is better, still need to further discussed.

--- Code: ---Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 5744)
+++ nativeparser.cpp (working copy)
@@ -1248,21 +1247,20 @@
             ++startAt;
         }
     }
-
-//    Manager::Get()->GetLogManager()->DebugLog(_T("at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str());
-    while ((startAt < line.Length()) && (wxIsalnum(line.GetChar(startAt)) || line.GetChar(startAt) == '_'))
+    //Manager::Get()->GetLogManager()->DebugLog(F(_T("at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str()));
+    while ((startAt < line.Length()) && (wxIsalnum(line.GetChar(startAt)) || line.GetChar(startAt) == '_' || line.GetChar(startAt) == ' ' || line.GetChar(startAt) == '\t'))
     {
         res << line.GetChar(startAt);
         ++startAt;
     }
-
+    res.Trim();
     while ((nest > 0) && (startAt < line.Length()))
     {
         if (line.GetChar(startAt) == ')')
             --nest;
         ++startAt;
     }
-    //Manager::Get()->GetLogManager()->DebugLog("Done nest: at %d (%c): res=%s", startAt, line.GetChar(startAt), res.c_str());
+    //Manager::Get()->GetLogManager()->DebugLog(F(_T("Done nest: at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str()));
 
     if ((startAt < line.Length()) && (line.GetChar(startAt) == '(' || line.GetChar(startAt) == '['))
     {

--- End code ---

MortenMacFly:

--- Quote from: blueshake on August 27, 2009, 05:44:42 am ---
--- Code: ---Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 5744)
+++ nativeparser.cpp (working copy)
@@ -1248,21 +1247,20 @@
             ++startAt;
         }
     }
-
-//    Manager::Get()->GetLogManager()->DebugLog(_T("at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str());
-    while ((startAt < line.Length()) && (wxIsalnum(line.GetChar(startAt)) || line.GetChar(startAt) == '_'))
+    //Manager::Get()->GetLogManager()->DebugLog(F(_T("at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str()));
+    while ((startAt < line.Length()) && (wxIsalnum(line.GetChar(startAt)) || line.GetChar(startAt) == '_' || line.GetChar(startAt) == ' ' || line.GetChar(startAt) == '\t'))
     {
         res << line.GetChar(startAt);
         ++startAt;
     }
-
+    res.Trim();
     while ((nest > 0) && (startAt < line.Length()))
     {
         if (line.GetChar(startAt) == ')')
             --nest;
         ++startAt;
     }
-    //Manager::Get()->GetLogManager()->DebugLog("Done nest: at %d (%c): res=%s", startAt, line.GetChar(startAt), res.c_str());
+    //Manager::Get()->GetLogManager()->DebugLog(F(_T("Done nest: at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str()));
 
     if ((startAt < line.Length()) && (line.GetChar(startAt) == '(' || line.GetChar(startAt) == '['))
     {

--- End code ---

--- End quote ---
...so is this the only thing to apply and the other two modifications are obsolete?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version