News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

New code completion remarks/issues

Started by killerbot, September 15, 2009, 12:24:28 PM

Previous topic - Next topic

Jenna

This one does not work for me either in r5790.

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna


MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

blueshake

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?

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?

blueshake

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?

MortenMacFly

#22
Quote from: blueshake on September 23, 2009, 03:55:39 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

blueshake

#23
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. :(
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?

blueshake

#24
hello,Morten

good news: :D
the issue killerbot report can be solved by this patch.
bad news:
can not make a clear explaination here.
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
    {

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?

ollydbg

Quote from: blueshake 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 ?
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.

ollydbg

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 "\\".



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.

blueshake

#27
@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.
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?

killerbot

Quote from: blueshake on September 24, 2009, 05:07:20 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.
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 !!!

ollydbg

Quote from: blueshake 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.

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.