Author Topic: New code completion remarks/issues  (Read 212008 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New code completion remarks/issues
« Reply #15 on: September 15, 2009, 03:56:14 pm »
This one does not work for me either in r5790.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New code completion remarks/issues
« Reply #16 on: September 15, 2009, 04:01:57 pm »
This one does not work for me either in r5790.
...which one?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New code completion remarks/issues
« Reply #17 on: September 15, 2009, 04:03:40 pm »
This one does not work for me either in r5790.
...which one?
Lieven's sample-code.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New code completion remarks/issues
« Reply #18 on: September 16, 2009, 01:44:32 pm »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: New code completion remarks/issues
« Reply #19 on: September 23, 2009, 09:34:35 am »
in the latest cc,
in the function void CodeCompletion::EditorEventHook(cbEditor* editor, wxScintillaEvent& event)
inside the function body,
cbStyledTextCtrl* control = editor->GetControl();

there is variable named control,
but when I type cont, the cc don't work.(no control in suggestion list and control's member list didn't work too)
I am sure it work before,at least at ver 5713.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: New code completion remarks/issues
« Reply #20 on: September 23, 2009, 09:37:29 am »
the same to variable event
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: New code completion remarks/issues
« Reply #21 on: September 23, 2009, 03:55:39 pm »
hello,did anyboby notice that codecompletion bar that miss some function in codecompletion.cpp.
see my snap3 .I can confirm that it work at rev 5731 see  the snap4 .
it seems that the codecompletion's member function were not included in this situation.what is going on ?

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: New code completion remarks/issues
« Reply #22 on: September 23, 2009, 05:10:45 pm »
I can confirm that it work at rev 5731 see  the snap4 .
I noticed the same (I told you and Jens...), but this info (the revision) is not really helpful as it is before the merge.

I wonder if it was working in your own test branch before the merge. Because that would be easier to compare.
« Last Edit: September 23, 2009, 05:12:47 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: New code completion remarks/issues
« Reply #23 on: September 24, 2009, 03:46:07 am »
yes,I remember it worked in my local copy(I just modify the codecompletion.cpp file),but unluckly,my old  machine is down ,I lost everything. :(
« Last Edit: September 24, 2009, 04:13:46 am by blueshake »
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: New code completion remarks/issues
« Reply #24 on: September 24, 2009, 05:07:20 am »
hello,Morten

good news: :D
the issue killerbot report can be solved by this patch.
bad news:
can not make a clear explaination here.
Code
Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- src/plugins/codecompletion/parser/parserthread.cpp (revision 5816)
+++ src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -1051,7 +1051,11 @@
     if (ns == ParserConsts::opbrace)
     {
         // parse inside anonymous namespace
+        Token* lastParent = m_pLastParent;
+        TokenScope lastScope = m_LastScope;
         DoParse();
+        m_pLastParent = lastParent;
+        m_LastScope = lastScope;
     }
     else
     {
« Last Edit: September 24, 2009, 10:19:40 am by blueshake »
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New code completion remarks/issues
« Reply #25 on: September 24, 2009, 07:42:01 am »
hello,did anyboby notice that codecompletion bar that miss some function in codecompletion.cpp.
see my snap3 .I can confirm that it work at rev 5731 see  the snap4 .
it seems that the codecompletion's member function were not included in this situation.what is going on ?
Hi, I can confirm this bug in my local copy(based on rev 5816). :D
Investigating now!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New code completion remarks/issues
« Reply #26 on: September 24, 2009, 07:54:52 am »
I think I have locate the bug. See the image below.



It seems the function before the current scope was shown.

So, the parser may fails parsing this function, especially "//" or "\\".


Code
wxArrayString GetIncludeDirs(cbProject &project)
{
    wxArrayString dirs;
    {
        wxArrayString target_dirs = project.GetIncludeDirs();

        for(size_t ii = 0; ii < target_dirs.GetCount(); ++ii)
        {
            wxFileName filename;
            NormalizePath(filename, target_dirs[ii]);

            wxString fullname = filename.GetFullPath();
            fullname.Replace(_T("\\"), _T("/"), true);
            if(dirs.Index(fullname) == wxNOT_FOUND)
                dirs.Add(fullname);
        }
    }

    wxString target_name = project.GetActiveBuildTarget();
    ProjectBuildTarget *target = project.GetBuildTarget(target_name);
    if(target)
    {
        wxArrayString target_dirs = target->GetIncludeDirs();
        for(size_t ii = 0; ii < target_dirs.GetCount(); ++ii)
        {
            wxFileName filename;
            NormalizePath(filename, target_dirs[ii]);

            wxString fullname = filename.GetFullPath();
            fullname.Replace(_T("\\"), _T("/"), true);
            if(dirs.Index(fullname) == wxNOT_FOUND)
                dirs.Add(fullname);
        }
    }
    return dirs;
}

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: New code completion remarks/issues
« Reply #27 on: September 24, 2009, 08:01:54 am »
@ollydbg


can you provide the patch?
I believe there is some connection among reply #19,20,21.if this issue can be solved,
others wil too.
« Last Edit: September 24, 2009, 08:05:56 am by blueshake »
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: New code completion remarks/issues
« Reply #28 on: September 24, 2009, 08:29:10 am »
hello,Morten

goog news: :D
the issue killerbot report can be solved by this patch.
bad news:
can not make a clear explaination here.
Code
Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- src/plugins/codecompletion/parser/parserthread.cpp (revision 5816)
+++ src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -1051,7 +1051,11 @@
     if (ns == ParserConsts::opbrace)
     {
         // parse inside anonymous namespace
+        Token* lastParent = m_pLastParent;
+        TokenScope lastScope = m_LastScope;
         DoParse();
+        m_pLastParent = lastParent;
+        m_LastScope = lastScope;
     }
     else
     {


YES, I can confirm this works now !!!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: New code completion remarks/issues
« Reply #29 on: September 24, 2009, 08:30:02 am »
@ollydbg


can you provide the patch?
I believe there is some connection among reply #19,20,21.if this issue can be solved,
others wil too.

I can't figure out yet till now :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.