TextEditor: get CompletionAssistProvider from editor.

And not from the global object pool. This way, the editors that have
different highlighters for various language dialects, or editors that
support multiple languages in a single editor, can decide themselves on
what CompletionAssistProvider to provide.

Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-08-30 12:55:06 +02:00
parent 33fd157b34
commit 7516ef4969
22 changed files with 116 additions and 26 deletions

View File

@@ -29,6 +29,7 @@
#include "cmakeeditor.h"
#include "cmakefilecompletionassist.h"
#include "cmakehighlighter.h"
#include "cmakeeditorfactory.h"
#include "cmakeprojectconstants.h"
@@ -38,6 +39,7 @@
#include <coreplugin/infobar.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <texteditor/texteditoractionhandler.h>
@@ -77,6 +79,11 @@ Core::Id CMakeEditor::id() const
return Core::Id(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
}
TextEditor::CompletionAssistProvider *CMakeEditor::completionAssistProvider()
{
return ExtensionSystem::PluginManager::getObject<CMakeFileCompletionAssistProvider>();
}
void CMakeEditor::markAsChanged()
{
if (!document()->isModified())