From bec4f02495b97b17e0b0f8cb67d0909634c16228 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Fri, 15 Apr 2011 16:19:23 +0200 Subject: 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). --- src/plugins/cpptools/cpptoolsplugin.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp') diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 44f2da4639..8bff1f858f 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -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 @@ -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; } -- cgit v1.2.1