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

ClangComplete plugin

<< < (2/11) > >>

Lalaland:
odmoore: It does seem to lag a bit with a large number of includes. This
--- Code: ---#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/array.hpp>
#include <boost/signal.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <boost/aligned_storage.hpp>
#include <boost/enable_shared_from_this.hpp>

--- End code ---

for example adds about a 2 second delay.

However, by enabling some flags that supposedly create some sort of cache, it only has the long delay the first time code completion is requested.

All the rest of the requests complete almost instantaneously.

Thank you for pointing out codelite's implementation.

ollydbg:

--- Quote from: Lalaland on November 11, 2011, 05:27:41 am ---However, by enabling some flags that supposedly create some sort of cache, it only has the long delay the first time code completion is requested.
All the rest of the requests complete almost instantaneously.

--- End quote ---
Once I have seen in the clang's API document, there is an function parameter which can let clang to automatically create a pch file in memory. Then the user don't need to specify which file are PCH file, clang can create and maintain the cached PCH.

The other thing is that we need to grab all the "compiler search paths" and "user definitions" from the current target in c::b project.
BTW: QTcreator now has a branch to use clang too.

Lalaland:
I have already started looking into grabbing all of the search paths.
This code is what I am using to do it.

--- Code: ---            ProjectBuildTarget *target = Manager::Get()->GetProjectManager()->GetActiveProject()->GetBuildTarget(0);
            wxString test = target->GetCompilerID();
            Compiler * comp = CompilerFactory::GetCompiler(test);

            wxArrayString next = comp->GetCompilerSearchDirs(target);

            wxString pray = GetStringFromArray(next, _(" "));

            Manager::Get()->GetLogManager()->Log(pray);

--- End code ---

However, I have not looked into user definitions and other command line settings yet.
I just wish the documentation on the Compiler::GenerateCommandLine function was better.

EDIT: I got the GenerateCommandLine function working(just copied the code found in the compiler plugin)

rickg22:

--- Quote from: Lalaland on November 11, 2011, 05:27:41 am ---odmoore: It does seem to lag a bit with a large number of includes. This
--- Code: ---#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/array.hpp>
#include <boost/signal.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <boost/aligned_storage.hpp>
#include <boost/enable_shared_from_this.hpp>

--- End code ---


--- End quote ---

Okay, I'm getting a bit paranoid with boost. Last time I tried to install boost, my distro screwed up the dependencies.

MortenMacFly:

--- Quote from: Lalaland on November 10, 2011, 03:51:45 pm ---I am announcing that I am starting work on an alternate code completion plugin that uses libclang to parse the code.

--- End quote ---
It looks very promising. One note: Please keep in mind that the plugin should derive from cbCodeCompletionPlugin, not cbPlugin to work properly in the end.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version