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

Bug or Feature?

(1/2) > >>

daniloz:
Hello all!

I have a question about CC. I'm not sure if this is a bug or feature, but if I have two projects in the workspace, I get suggestion from BOTH projects, regardless of the active project. After a quick look at nativeparser.cpp (and a little help from ollydbg), I found the following:

nativeparser.cpp line 606.


--- Code: ---// NOTE: it actually forces reparsing of workspace
void NativeParser::ForceReparseActiveProject()
{
    m_Parser.Clear();
    UpdateClassBrowser();

    ProjectsArray* projects = Manager::Get()->GetProjectManager()->GetProjects();
    for (size_t i = 0; i < projects->GetCount(); ++i)
    {
        AddParser(projects->Item(i), false);
    }
}
--- End code ---

Note: the comment:
/ /NOTE: it actually forces reparsing of workspace

Should it just reparse the active project? As in:


--- Code: ---void NativeParser::ForceReparseActiveProject()
{
    m_Parser.Clear();
    UpdateClassBrowser();

    AddParser(Manager::Get()->GetProjectManager()->GetActiveProject(), false);
}
--- End code ---


Thx,
daniloz

MortenMacFly:

--- Quote from: daniloz on May 04, 2010, 08:59:09 am ---Note: the comment:
/ /NOTE: it actually forces reparsing of workspace
Should it just reparse the active project?

--- End quote ---
No. Consider a (very common) setup of a workspace that consists of 1.. n projects where 1..(n-1) are libraries used by the main (n'th) application. In the main application you surely want to have CC for the libraries. That's why we initially implemented it the way it is now. On request of users, btw.!
One possibility I see is to make it configurable. Patches in that direction are welcome.

daniloz:

--- Quote from: MortenMacFly on May 04, 2010, 09:31:38 am ---
--- Quote from: daniloz on May 04, 2010, 08:59:09 am ---Note: the comment:
/ /NOTE: it actually forces reparsing of workspace
Should it just reparse the active project?

--- End quote ---
No. Consider a (very common) setup of a workspace that consists of 1.. n projects where 1..(n-1) are libraries used by the main (n'th) application. In the main application you surely want to have CC for the libraries. That's why we initially implemented it the way it is now. On request of users, btw.!
One possibility I see is to make it configurable. Patches in that direction are welcome.

--- End quote ---
I understand and see the utility of it. However, I was expecting that the setting in the symbols tab -> View: "Active project's symbols | All local symbols (workspace) | ..." should also apply to the CC itself. Meaning that if I set it to "Active project" then I get suggestions for the active project only, but if I set to "workspace" then I have all projects...
What do you think?

ollydbg:
@daniloz
Loaden has a patch to let the parser generate one TokensTree per project. I will asked him to publish to the CB forum soon. :D

Loaden:

--- Quote from: ollydbg on May 04, 2010, 03:00:02 pm ---@daniloz
Loaden has a patch to let the parser generate one TokensTree per project. I will asked him to publish to the CB forum soon. :D


--- End quote ---
That patch is not yet perfect, I will continue to focus on this issue, and try to find a better solution.

Navigation

[0] Message Index

[#] Next page

Go to full version