Commit ed5f8004 authored by hjk's avatar hjk

completion: call directly from base text editor

Reviewed-by: con
parent 008bd2c0
......@@ -178,12 +178,6 @@ void CppPlugin::initializeEditor(CPPEditor *editor)
TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
// semantic auto completion and quick fix
connect(editor,
SIGNAL(requestCompletion(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)),
TextEditor::CompletionSupport::instance(),
SLOT(complete(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)));
// method combo box sorting
connect(this, SIGNAL(outlineSortingChanged(bool)),
editor, SLOT(setSortedOutline(bool)));
......
......@@ -249,12 +249,6 @@ void GLSLEditorPlugin::initializeEditor(GLSLEditor::GLSLTextEditor *editor)
m_actionHandler->setupActions(editor);
TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
// auto completion and quick fix
connect(editor,
SIGNAL(requestCompletion(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)),
TextEditor::CompletionSupport::instance(),
SLOT(autoComplete(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)));
}
......
......@@ -271,12 +271,6 @@ void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::QmlJSTextEditor *editor)
m_actionHandler->setupActions(editor);
TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
// auto completion and quick fix
connect(editor,
SIGNAL(requestCompletion(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)),
TextEditor::CompletionSupport::instance(),
SLOT(complete(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)));
}
void QmlJSEditorPlugin::followSymbolUnderCursor()
......
......@@ -90,12 +90,6 @@ Core::IEditor *ProFileEditorFactory::createEditor(QWidget *parent)
{
ProFileEditor *editor = new ProFileEditor(parent, this, m_actionHandler);
TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
// auto completion
connect(editor,
SIGNAL(requestCompletion(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)),
TextEditor::CompletionSupport::instance(),
SLOT(complete(TextEditor::ITextEditable*,TextEditor::CompletionPolicy,bool)));
return editor->editableInterface();
}
......
......@@ -540,12 +540,12 @@ void BaseTextEditor::selectEncoding()
void BaseTextEditor::triggerCompletions()
{
emit requestCompletion(editableInterface(), TextEditor::SemanticCompletion, true);
CompletionSupport::instance()->complete(editableInterface(), SemanticCompletion, true);
}
void BaseTextEditor::triggerQuickFix()
{
emit requestCompletion(editableInterface(), TextEditor::QuickFixCompletion, true);
CompletionSupport::instance()->complete(editableInterface(), QuickFixCompletion, true);
}
QString BaseTextEditor::msgTextTooLarge(quint64 size)
......@@ -1851,7 +1851,7 @@ void BaseTextEditor::maybeRequestAutoCompletion(const QChar &ch)
}
} else {
d->m_requestAutoCompletionTimer->stop();
emit requestCompletion(editableInterface(), TextEditor::SemanticCompletion, false);
CompletionSupport::instance()->complete(editableInterface(), SemanticCompletion, false);
}
}
......@@ -1862,9 +1862,9 @@ void BaseTextEditor::_q_requestAutoCompletion()
if (CompletionSupport::instance()->isActive())
return;
if (d->m_requestAutoCompletionRevision == document()->revision() &&
d->m_requestAutoCompletionPosition == position())
emit requestCompletion(editableInterface(), TextEditor::SemanticCompletion, false);
if (d->m_requestAutoCompletionRevision == document()->revision()
&& d->m_requestAutoCompletionPosition == position())
CompletionSupport::instance()->complete(editableInterface(), SemanticCompletion, false);
}
void BaseTextEditor::insertCodeSnippet(const QTextCursor &cursor_arg, const QString &snippet)
......
......@@ -484,8 +484,6 @@ signals:
void requestFontZoom(int zoom);
void requestZoomReset();
void requestBlockUpdate(const QTextBlock &);
void requestCompletion(TextEditor::ITextEditable *editor,
TextEditor::CompletionPolicy, bool forced);
private:
void maybeRequestAutoCompletion(const QChar &ch);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment