forked from qt-creator/qt-creator
Editor: unify assist processor handling
Define the run type of the processor by its implementation instead of a enum value of the provider. The execution of a processor inside the assist now follows a unified procedure. Change-Id: Ibe9fab324c6072e77702c2663946d7a9f562a085 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -525,7 +525,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::createHintProposal(
|
||||
return new FunctionHintProposal(m_startPosition, model);
|
||||
}
|
||||
|
||||
IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *assistInterface)
|
||||
IAssistProposal *QmlJSCompletionAssistProcessor::performAsync(AssistInterface *assistInterface)
|
||||
{
|
||||
m_interface.reset(static_cast<const QmlJSCompletionAssistInterface *>(assistInterface));
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
#include "qmljseditor_global.h"
|
||||
|
||||
#include <qmljstools/qmljssemanticinfo.h>
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
#include <texteditor/codeassist/assistproposalitem.h>
|
||||
#include <texteditor/codeassist/genericproposalmodel.h>
|
||||
#include <texteditor/codeassist/asyncprocessor.h>
|
||||
#include <texteditor/codeassist/completionassistprovider.h>
|
||||
#include <texteditor/codeassist/genericproposalmodel.h>
|
||||
#include <texteditor/codeassist/iassistprocessor.h>
|
||||
#include <texteditor/snippets/snippetassistcollector.h>
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
|
||||
|
||||
#include <QStringList>
|
||||
#include <QScopedPointer>
|
||||
@@ -51,13 +51,13 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class QmlJSCompletionAssistProcessor : public TextEditor::IAssistProcessor
|
||||
class QmlJSCompletionAssistProcessor : public TextEditor::AsyncProcessor
|
||||
{
|
||||
public:
|
||||
QmlJSCompletionAssistProcessor();
|
||||
~QmlJSCompletionAssistProcessor() override;
|
||||
|
||||
TextEditor::IAssistProposal *perform(const TextEditor::AssistInterface *interface) override;
|
||||
TextEditor::IAssistProposal *performAsync(TextEditor::AssistInterface *interface) override;
|
||||
|
||||
private:
|
||||
TextEditor::IAssistProposal *createContentProposal() const;
|
||||
|
||||
@@ -48,7 +48,7 @@ QmlJSRefactoringFilePtr QmlJSQuickFixAssistInterface::currentFile() const
|
||||
// ---------------------------
|
||||
class QmlJSQuickFixAssistProcessor : public IAssistProcessor
|
||||
{
|
||||
IAssistProposal *perform(const AssistInterface *interface) override
|
||||
IAssistProposal *perform(AssistInterface *interface) override
|
||||
{
|
||||
return GenericProposal::createProposal(interface, findQmlJSQuickFixes(interface));
|
||||
}
|
||||
@@ -58,11 +58,6 @@ class QmlJSQuickFixAssistProcessor : public IAssistProcessor
|
||||
// QmlJSQuickFixAssistProvider
|
||||
// ---------------------------
|
||||
|
||||
IAssistProvider::RunType QmlJSQuickFixAssistProvider::runType() const
|
||||
{
|
||||
return Synchronous;
|
||||
}
|
||||
|
||||
IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor(const AssistInterface *) const
|
||||
{
|
||||
return new QmlJSQuickFixAssistProcessor;
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
QmlJSQuickFixAssistProvider() = default;
|
||||
~QmlJSQuickFixAssistProvider() override = default;
|
||||
|
||||
IAssistProvider::RunType runType() const override;
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user