forked from qt-creator/qt-creator
Editor: pass AssistInterface to createProcessor
The interface can be used for checking the context of a codeassist request to determine the correct processor that has to be created. Change-Id: I47ddb05c46399566e27bae21711f11a3a4132c3f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -515,7 +515,7 @@ bool QmlJSCompletionAssistProvider::isContinuationChar(const QChar &c) const
|
||||
return isIdentifierChar(c, false);
|
||||
}
|
||||
|
||||
IAssistProcessor *QmlJSCompletionAssistProvider::createProcessor() const
|
||||
IAssistProcessor *QmlJSCompletionAssistProvider::createProcessor(const AssistInterface *) const
|
||||
{
|
||||
return new QmlJSCompletionAssistProcessor;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class QMLJSEDITOR_EXPORT QmlJSCompletionAssistProvider : public TextEditor::Comp
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TextEditor::IAssistProcessor *createProcessor() const override;
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override;
|
||||
|
||||
int activationCharSequenceLength() const override;
|
||||
bool isActivationCharSequence(const QString &sequence) const override;
|
||||
|
||||
@@ -880,7 +880,7 @@ void QmlJSEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
AssistInterface *interface = createAssistInterface(QuickFix, ExplicitlyInvoked);
|
||||
if (interface) {
|
||||
QScopedPointer<IAssistProcessor> processor(
|
||||
Internal::QmlJSEditorPlugin::quickFixAssistProvider()->createProcessor());
|
||||
Internal::QmlJSEditorPlugin::quickFixAssistProvider()->createProcessor(interface));
|
||||
QScopedPointer<IAssistProposal> proposal(processor->perform(interface));
|
||||
if (!proposal.isNull()) {
|
||||
GenericProposalModelPtr model = proposal->model().staticCast<GenericProposalModel>();
|
||||
|
||||
@@ -86,7 +86,7 @@ IAssistProvider::RunType QmlJSQuickFixAssistProvider::runType() const
|
||||
return Synchronous;
|
||||
}
|
||||
|
||||
IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor() const
|
||||
IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor(const AssistInterface *) const
|
||||
{
|
||||
return new QmlJSQuickFixAssistProcessor;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
~QmlJSQuickFixAssistProvider() override = default;
|
||||
|
||||
IAssistProvider::RunType runType() const override;
|
||||
TextEditor::IAssistProcessor *createProcessor() const override;
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
||||
Reference in New Issue
Block a user