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

New code completion remarks/issues

<< < (21/54) > >>

ollydbg:

--- Quote from: blueshake on October 05, 2009, 05:26:33 am ---hello,another bad news.
It seems some bugs hide in the codecompletion.In the file codecompletion.cpp,in this place:

--- Code: ---            // Remove duplicate items
            for (size_t i=0; i<items.Count()-1; i++)
                if (items.Item(i)==items.Item(i+1))
                    items.RemoveAt(i);
Manager::ge|

--- End code ---
when you type Mana,yes,the suggestion show,then you type ::,yes work again,but when you type ge,the issue come out,the suggestion list flash again,and not show.what is going on here,the suggestion list is try to show,but cancle by something.

Note:
I just use the latest cc,change nothing.
Edit:

--- Code: ---Manager::Get()->|
--- End code ---
And in the "|" position, the cc not work.

--- End quote ---

I can confirm both the two bugs.
Is it possible to create a simple test case. So that I can debug it. Currently, Opening the codeblocks's whole source code is not necessary.

Also: I think it's time to create some standard test code for codecompletion now. :D Any comments?

Also 1: @morten, in the current CC code, there are many code using the preprocessor guard.like:


--- Code: ---#if PARSERTHREAD_DEBUG_OUTPUT
            Manager::Get()->GetLogManager()->DebugLog(F(_T("HandlePreprocessorBlocks() : Special case \"#if 0\" not skipped.")));
#endif

--- End code ---

Is there any way we can just clean up these code, and use something like this:


--- Code: ---#if PARSERTHREAD_DEBUG_OUTPUT
#define DebugOutput(a,b,c)  Manager::Get()->GetLogManager()->DebugLog(a,b,c)
#else
#define DebugOutput(a,b,c)  
#endif

--- End code ---

So, the the source code, we can only use this:


--- Code: ---DebugOutput(F(_T("HandlePreprocessorBlocks() : Special case \"#if 0\" not skipped.")));

--- End code ---
This will make the source code more clean.


Also 2:

There are many variable names which are not following the source style guard. like:


--- Code: ---    Parser parser(this);
    parser.ParseBufferForFunctions(control->GetTextRange(0, pos));

    wxArrayString funcs;
    TokensTree* tmptree = parser.GetTempTokens();

    // look for implementation functions that enclose our current line number
    for(size_t i = 0; i < tmptree->size();i++)

--- End code ---

the tmptree should be tmpTree.

Also, there are many other variables should be renamed. such as:


--- Code: ---// find current function's namespace so we can include local scope's tokens
    // we ' ll get the function's token (all matches) and add its parent namespace
    TokenIdxSet scope_result;
    TokenIdxSet proc_result;
    if (FindCurrentFunctionToken(editor, proc_result) != 0)
    {
        for (TokenIdxSet::iterator it = proc_result.begin(); it != proc_result.end(); ++it)
        {
            Token* token = parser->GetTokens()->at(*it);
            if (!token)
                continue;
            scope_result.insert(token->m_ParentIndex);
#if DEBUG_CC_AI
            if (s_DebugSmartSense)
            {
                Token* parent = parser->GetTokens()->at(token->m_ParentIndex);
                Manager::Get()->GetLogManager()->DebugLog(_T("Adding search namespace: ") + (parent ? parent->m_Name : _T("Global namespace")));
            }
#endif
        }
    }

--- End code ---

These name should be "scopeResult" and so on...




ollydbg:
@blueshake:

look at the Get function prototype, it is a static function.

--- Code: ---class DLLIMPORT Manager
{
    static Manager* Get();
}

--- End code ---
but, in the symbol tree debug dialog, you will see that the

--- Quote ---type is Manager *
actual type is Manager
--- End quote ---

That's may be the cause of bug...

blueshake:

--- Quote from: ollydbg on October 05, 2009, 06:06:39 am ---@blueshake:

look at the Get function prototype, it is a static function.

--- Code: ---class DLLIMPORT Manager
{
    static Manager* Get();
}

--- End code ---
but, in the symbol tree debug dialog, you will see that the

--- Quote ---type is Manager *
actual type is Manager
--- End quote ---

That's may be the cause of bug...



--- End quote ---
But it worked before.I updated the local copy,and it don't work.
look at these codes.The static are ignored.

--- Code: ---        else if (token==ParserConsts::kw_static ||
            token==ParserConsts::kw_virtual ||
            token==ParserConsts::kw_inline)
        {
            // do nothing (skip it)
        }
--- End code ---

blueshake:
anther issue.

--- Code: ---std::string ss;
ss. not work

--- End code ---

--- Code: ---string ss;
ss.work
--- End code ---
parser error:

--- Code: ---string ss("abc");
ss.
--- End code ---
it should be a variable,but ss is parsed as function.

[attachment deleted by admin]

MortenMacFly:
Just a tiny remark: For testing if the current modification (a.k.a patch) does not break something else please make sure that after applying the patch do the following:
1.) Open Code::Blocks having the debug log enabled.
2.) Open CodeBlocks.cbp (project files of core and core plugins)
3.) Wait, until the parser has completed.
3.) Check the debug log for the number of tokens, it should look like the following:
Parsing stage done (1570 total parsed files, 92637 tokens in 1 minute(s), 8.922 seconds).
The tokens should be round about 90000 - 100000 (depending on the patch level of C::B).

Furthermore: I am still happy to collect sample projects for testing CC I already have some...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version