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

New code completion remarks/issues

<< < (26/54) > >>

blueshake:
I just noticed that in the codecompletion.cpp

--- Code: ---    if (event.GetEventType() == wxEVT_SCI_CHARADDED &&
            !control->AutoCompActive()) { // not already active autocompletion
--- End code ---

They have been changed to

--- Code: ---    if (event.GetEventType() == wxEVT_SCI_CHARADDED)
--- End code ---

why we do this here,what are the better things?

blueshake:

--- Quote from: ollydbg on October 06, 2009, 05:00:00 am ---what I have found is that these code:


--- Code: ---  if (local_result.size() == 1)
    {
        int id = *local_result.begin();
        Token* token = tree->at(id);

        if (token->m_TokenKind == tkTypedef)
        {
            std::queue<ParserComponent> type_components;
            BreakUpComponents(parser, token->m_ActualType, type_components);

            while(!components.empty())
            {
                ParserComponent comp = components.front();
                components.pop();
                type_components.push(comp);
            }

#if DEBUG_CC_AI
            if (s_DebugSmartSense)
            #if wxCHECK_VERSION(2, 9, 0)
                Manager::Get()->GetLogManager()->DebugLog(F(_T("FindAIMatches() : Replacing %s to %s"), token->m_Name.wx_str(), token->m_ActualType.wx_str()));
            #else
                Manager::Get()->GetLogManager()->DebugLog(F(_T("FindAIMatches() : Replacing %s to %s"), token->m_Name.c_str(), token->m_ActualType.c_str()));
            #endif
#endif
            return FindAIMatches(parser, type_components, result, parentTokenIdx, noPartialMatch, caseSensitive, use_inheritance, kindMask, search_scope);
        }

    }


--- End code ---

Is added from rev 5682 to rev5840 of nativeparser.cpp.



--- End quote ---


Can somebody make some explanation about adding these codes here? Thanks.

ollydbg:
I would like Morten could give some explanation on the above two reply (reply#125, reply#126).
I also have the same question. :D
Thanks.

ollydbg:
Dear Morten,Jens and other devs.
In the post

http://forums.codeblocks.org/index.php/topic,11187.msg76809.html#msg76809
I would like to make the code of DebugLog more clean. Now, I have finally find the way, please see here:

we can define this macro:


--- Code: ---#define TOKENIZER_DEBUG_OUTPUT 1

#if TOKENIZER_DEBUG_OUTPUT
    #define TRACE(format, args...)\
    Manager::Get()->GetLogManager()->DebugLog(F( format , ## args))
#else
    #define TRACE(format, args...)
#endif

--- End code ---

So, the code can change like below:

--- Code: ---#if TOKENIZER_DEBUG_OUTPUT
        Manager::Get()->GetLogManager()->DebugLog(F(_T("Init() : Called without filename.")));
#endif

--- End code ---
to

--- Code: ---TRACE(_T("Init() : Called without filename."));
--- End code ---

Also,


--- Code: ---#if TOKENIZER_DEBUG_OUTPUT
        Manager::Get()->GetLogManager()->DebugLog(F(_T("Init() : m_Filename='%s'"), m_Filename.c_str()));
#endif
--- End code ---

to


--- Code: ---TRACE(_T("Init() : m_Filename='%s'"), m_Filename.c_str());

--- End code ---

I have already tested, and it works great! :D

I think all the DebugLog related code can change to this format, which make the code more clean. :)

Any comments? Thanks.



MortenMacFly:

--- Quote from: ollydbg on October 06, 2009, 09:27:01 am ---
--- Code: ---#define TOKENIZER_DEBUG_OUTPUT 1

#if TOKENIZER_DEBUG_OUTPUT
    #define TRACE(format, args...)\
    Manager::Get()->GetLogManager()->DebugLog(F( format , ## args))
#else
    #define TRACE(format, args...)
#endif

--- End code ---
Any comments? Thanks.

--- End quote ---
Sure this looks nice. But keep in mind that this should be in implementation files only, or rename TRACE into a more specific TRACE_NATIVEPARSER or alike. Otherwise you might define the macros also for other files (debug outputs). Patches against trunk are welcome.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version