forked from qt-creator/qt-creator
New code assist API
This is a re-work of our completion engine. Primary goals are: - Allow the computation to run in a separate thread so the GUI is not locked. - Support a model-based approach. QStrings are still needed (filtering, etc), but internal structures are free to use more efficient representations. - Unifiy all kinds of *assist* into a more reusable and extensible framework. - Remove unnecessary dependencies on the text editor so we have more generic and easily "plugable" components (still things to be resolved).
This commit is contained in:
@@ -34,13 +34,13 @@
|
||||
#include "completionsettingspage.h"
|
||||
#include "cppfilesettingspage.h"
|
||||
#include "cppclassesfilter.h"
|
||||
#include "cppcodecompletion.h"
|
||||
#include "cppfunctionsfilter.h"
|
||||
#include "cppcurrentdocumentfilter.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
#include "cpplocatorfilter.h"
|
||||
#include "symbolsfindfilter.h"
|
||||
#include "cppcompletionassist.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
@@ -113,9 +113,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
m_modelManager, SLOT(updateSourceFiles(QStringList)));
|
||||
addAutoReleasedObject(m_modelManager);
|
||||
|
||||
CppCodeCompletion *completion = new CppCodeCompletion(m_modelManager);
|
||||
addAutoReleasedObject(completion);
|
||||
|
||||
addAutoReleasedObject(new CppCompletionAssistProvider);
|
||||
addAutoReleasedObject(new CppLocatorFilter(m_modelManager));
|
||||
addAutoReleasedObject(new CppClassesFilter(m_modelManager));
|
||||
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager));
|
||||
@@ -141,12 +139,6 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
mcpptools->addAction(command);
|
||||
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
|
||||
|
||||
// Set completion settings and keep them up to date
|
||||
TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance();
|
||||
completion->setCompletionSettings(textEditorSettings->completionSettings());
|
||||
connect(textEditorSettings, SIGNAL(completionSettingsChanged(TextEditor::CompletionSettings)),
|
||||
completion, SLOT(setCompletionSettings(TextEditor::CompletionSettings)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user