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:
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "texteditorplugin.h"
|
||||
|
||||
#include "completionsupport.h"
|
||||
#include "findinfiles.h"
|
||||
#include "findincurrentfile.h"
|
||||
#include "fontsettings.h"
|
||||
@@ -46,6 +45,7 @@
|
||||
#include "manager.h"
|
||||
#include "outlinefactory.h"
|
||||
#include "snippets/plaintextsnippetprovider.h"
|
||||
#include "codeassist/assistenums.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -215,17 +215,15 @@ void TextEditorPlugin::initializeEditor(PlainTextEditorWidget *editor)
|
||||
void TextEditorPlugin::invokeCompletion()
|
||||
{
|
||||
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
|
||||
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
|
||||
if (editor)
|
||||
CompletionSupport::instance()->complete(editor, SemanticCompletion, true);
|
||||
if (BaseTextEditorWidget *w = qobject_cast<BaseTextEditorWidget *>(iface->widget()))
|
||||
w->invokeAssist(Completion);
|
||||
}
|
||||
|
||||
void TextEditorPlugin::invokeQuickFix()
|
||||
{
|
||||
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
|
||||
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
|
||||
if (editor)
|
||||
CompletionSupport::instance()->complete(editor, QuickFixCompletion, true);
|
||||
if (BaseTextEditorWidget *w = qobject_cast<BaseTextEditorWidget *>(iface->widget()))
|
||||
w->invokeAssist(QuickFix);
|
||||
}
|
||||
|
||||
void TextEditorPlugin::updateSearchResultsFont(const FontSettings &settings)
|
||||
|
||||
Reference in New Issue
Block a user