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

New code completion remarks/issues

<< < (16/54) > >>

killerbot:
the intended purpose of the first combo box, is that you can filter on what you want to see in the right combo box.

For example you filter on a namespace,  class, a class in a namespace.

Basically, my idea was inspired about how it works in M$ Visual Studio.

oBFusCATed:
I know the purpose of the combo,
but at the moment it is disabled and useless (wasting lots of gui-estate(place or something)).

By the way one combo with autocompletion/filtering (visual assist style) is better than two (visual c++ style).
Because it requires less actions to find what you want. But I think the combo in wx2.x can't do autocompletion easily :(

My question was, if you plan to make it work, though?

killerbot:
Back in the day I could not activate it yet, since the parser was not good enough.
Now it however still has some informative use : it shows the namespace::class, where the right hand side combobox only show the method names (+ arguments + return value) which it should.

But I think the left combobox could be reduced by half in width.

ollydbg:

--- Quote from: MortenMacFly on September 29, 2009, 05:51:50 pm ---
--- Quote from: ollydbg on September 29, 2009, 11:07:14 am ---This is the modified version of the "right search", it just solve this problem in my previous reply.

--- End quote ---
Committed that to trunk (including some other mods). Hence some cases still do not work, check this snippet:

--- Code: ---struct _s
{
  int   x;
  float y;
};
typedef struct _s t_s;

int main()
{
    struct _s  s;
    struct _s& rs = s;
    struct _s* ps = &s;
    t_s        ts;
    t_s&       rts = ts;
    t_s*       pts = &ts;

    s.    // works
    rs.   // works
    ps.   // works
    ps->  // does not work
    ts.   // works
    rts.  // works
    pts.  // works
    pts-> // does not work

    return 0;
}

--- End code ---
For ps and pts CC suggests... erm... ps and pts.
Probably I am missing something... it's late... ;-)

--- End quote ---


This bug can be fixed by this patch:


--- Code: ---Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 5826)
+++ nativeparser.cpp (working copy)
@@ -1207,7 +1207,7 @@
         --startAt;
     return startAt;
 }
-static bool IsOperator(int startAt, const wxString& line)
+static bool IsOperatorEnd(int startAt, const wxString& line)
 {
     return (   (startAt > 0)
             && (startAt < line.Length())
@@ -1216,6 +1216,17 @@
                 || (   (line.GetChar(startAt) == ':')
                     && (line.GetChar(startAt - 1) == ':') ) ) );
 }
+
+static bool IsOperatorBegin(int startAt, const wxString& line)
+{
+    return (   (startAt > 0)
+            && (startAt + 1< line.Length())
+            && (   (   (line.GetChar(startAt ) == '-') )
+                    && (line.GetChar(startAt + 1) == '>')
+                || (   (line.GetChar(startAt) == ':')
+                    && (line.GetChar(startAt + 1) == ':') ) ) );
+}
+
 static bool IsOperatorDot(int startAt, const wxString& line)
 {
     return (   (startAt >= 0)
@@ -1274,7 +1285,7 @@
         }
         // Check for [Class]-> ('>' pressed)
         // Check for [Class]:: (':' pressed)
-        else if (IsOperator(startAt, line))
+        else if (IsOperatorEnd(startAt, line))
         {
             startAt -= 2;
             repeat = true; // yes -> repeat.
@@ -1394,7 +1405,10 @@
                 ++nest;
         }
     }
+    if (IsOperatorBegin(startAt, line))
+        ++startAt;
 
+
 #if DEBUG_CC_AI
     Manager::Get()->GetLogManager()->DebugLog(F(_T("Return at %d (%c): res=%s"), startAt, line.GetChar(startAt), res.c_str()));
 #endif
@@ -1446,7 +1460,7 @@
         }
         // Check for [Class]-> ('>' pressed)
         // Check for [Class]:: (':' pressed)
-        else if (IsOperator(startAt, line))
+        else if (IsOperatorEnd(startAt, line))
         {
             if (line.GetChar(startAt) == ':')
                 tokenType = pttNamespace;

--- End code ---

Note: for checking IsOperator, we need to check whether "it is the beginning of the operator?" or "the end of the operator", because sometimes, we use a "left search" and sometimes we need a "right search".

blueshake:
May someboby notice that the cc suggestion list window style is different from the notepad++ whose window
stytle is something like pop menu.So if I want to change the cc suggestion list window style to make it similar with notepad++'s,what should I do?(change what codes, I read the codes,found nothing)
any comment? Thanks!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version