forked from qt-creator/qt-creator
texteditor: directly call completion instead using ITextEditor interface
Reviewed-By: con
This commit is contained in:
@@ -538,16 +538,6 @@ void BaseTextEditorWidget::selectEncoding()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseTextEditorWidget::triggerCompletions()
|
|
||||||
{
|
|
||||||
CompletionSupport::instance()->complete(editor(), SemanticCompletion, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseTextEditorWidget::triggerQuickFix()
|
|
||||||
{
|
|
||||||
CompletionSupport::instance()->complete(editor(), QuickFixCompletion, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseTextEditorWidget::msgTextTooLarge(quint64 size)
|
QString BaseTextEditorWidget::msgTextTooLarge(quint64 size)
|
||||||
{
|
{
|
||||||
return tr("The text is too large to be displayed (%1 MB).").
|
return tr("The text is too large to be displayed (%1 MB).").
|
||||||
|
|||||||
@@ -155,9 +155,6 @@ public:
|
|||||||
BaseTextEditor *editor() const;
|
BaseTextEditor *editor() const;
|
||||||
ITextMarkable *markableInterface() const;
|
ITextMarkable *markableInterface() const;
|
||||||
|
|
||||||
virtual void triggerCompletions();
|
|
||||||
virtual void triggerQuickFix();
|
|
||||||
|
|
||||||
QChar characterAt(int pos) const;
|
QChar characterAt(int pos) const;
|
||||||
|
|
||||||
void print(QPrinter *);
|
void print(QPrinter *);
|
||||||
@@ -584,9 +581,6 @@ public:
|
|||||||
QString textAt(int pos, int length) const;
|
QString textAt(int pos, int length) const;
|
||||||
inline QChar characterAt(int pos) const { return e->characterAt(pos); }
|
inline QChar characterAt(int pos) const { return e->characterAt(pos); }
|
||||||
|
|
||||||
inline void triggerCompletions() { e->triggerCompletions(); } // slot?
|
|
||||||
inline void triggerQuickFix() { e->triggerQuickFix(); } // slot?
|
|
||||||
|
|
||||||
inline ITextMarkable *markableInterface() { return e->markableInterface(); }
|
inline ITextMarkable *markableInterface() { return e->markableInterface(); }
|
||||||
|
|
||||||
void setContextHelpId(const QString &id) { m_contextHelpId = id; }
|
void setContextHelpId(const QString &id) { m_contextHelpId = id; }
|
||||||
|
|||||||
@@ -125,9 +125,6 @@ public:
|
|||||||
/*! Selects text between current cursor position and \a toPos. */
|
/*! Selects text between current cursor position and \a toPos. */
|
||||||
virtual void select(int toPos) = 0;
|
virtual void select(int toPos) = 0;
|
||||||
|
|
||||||
virtual void triggerCompletions() = 0;
|
|
||||||
virtual void triggerQuickFix() = 0;
|
|
||||||
|
|
||||||
virtual ITextMarkable *markableInterface() = 0;
|
virtual ITextMarkable *markableInterface() = 0;
|
||||||
|
|
||||||
virtual void setContextHelpId(const QString &) = 0;
|
virtual void setContextHelpId(const QString &) = 0;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "texteditorplugin.h"
|
#include "texteditorplugin.h"
|
||||||
|
|
||||||
|
#include "completionsupport.h"
|
||||||
#include "findinfiles.h"
|
#include "findinfiles.h"
|
||||||
#include "findincurrentfile.h"
|
#include "findincurrentfile.h"
|
||||||
#include "fontsettings.h"
|
#include "fontsettings.h"
|
||||||
@@ -217,7 +218,7 @@ void TextEditorPlugin::invokeCompletion()
|
|||||||
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
|
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
|
||||||
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
|
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
|
||||||
if (editor)
|
if (editor)
|
||||||
editor->triggerCompletions();
|
CompletionSupport::instance()->complete(editor, SemanticCompletion, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorPlugin::invokeQuickFix()
|
void TextEditorPlugin::invokeQuickFix()
|
||||||
@@ -225,7 +226,7 @@ void TextEditorPlugin::invokeQuickFix()
|
|||||||
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
|
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
|
||||||
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
|
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
|
||||||
if (editor)
|
if (editor)
|
||||||
editor->triggerQuickFix();
|
CompletionSupport::instance()->complete(editor, QuickFixCompletion, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorPlugin::updateSearchResultsFont(const FontSettings &settings)
|
void TextEditorPlugin::updateSearchResultsFont(const FontSettings &settings)
|
||||||
|
|||||||
Reference in New Issue
Block a user