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:
@@ -54,7 +54,8 @@ TextEditor::IAssistProvider::RunType ClangCompletionAssistProvider::runType() co
|
||||
return Asynchronous;
|
||||
}
|
||||
|
||||
TextEditor::IAssistProcessor *ClangCompletionAssistProvider::createProcessor() const
|
||||
TextEditor::IAssistProcessor *ClangCompletionAssistProvider::createProcessor(
|
||||
const TextEditor::AssistInterface *) const
|
||||
{
|
||||
return new ClangCompletionAssistProcessor;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
IAssistProvider::RunType runType() const override;
|
||||
|
||||
TextEditor::IAssistProcessor *createProcessor() const override;
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override;
|
||||
TextEditor::AssistInterface *createAssistInterface(
|
||||
const Utils::FilePath &filePath,
|
||||
const TextEditor::TextEditorWidget *textEditorWidget,
|
||||
|
||||
@@ -525,7 +525,7 @@ public:
|
||||
|
||||
private:
|
||||
RunType runType() const override { return Asynchronous; }
|
||||
TextEditor::IAssistProcessor *createProcessor() const override;
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override;
|
||||
|
||||
ClangdClient::Private * const m_data;
|
||||
};
|
||||
@@ -723,7 +723,7 @@ public:
|
||||
|
||||
private:
|
||||
RunType runType() const override { return Synchronous; }
|
||||
TextEditor::IAssistProcessor *createProcessor() const override
|
||||
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override
|
||||
{
|
||||
return new DoxygenAssistProcessor(m_position, m_completionOperator, m_proposalHandler);
|
||||
}
|
||||
@@ -2690,7 +2690,8 @@ ClangdClient::VirtualFunctionAssistProcessor::createEntry(const QString &name,
|
||||
return item;
|
||||
}
|
||||
|
||||
TextEditor::IAssistProcessor *ClangdClient::VirtualFunctionAssistProvider::createProcessor() const
|
||||
TextEditor::IAssistProcessor *ClangdClient::VirtualFunctionAssistProvider::createProcessor(
|
||||
const TextEditor::AssistInterface *) const
|
||||
{
|
||||
return m_data->followSymbolData->virtualFuncAssistProcessor
|
||||
= new VirtualFunctionAssistProcessor(m_data);
|
||||
|
||||
@@ -119,7 +119,7 @@ TextEditor::ProposalModelPtr completionResults(TextEditor::BaseTextEditor *textE
|
||||
QTC_ASSERT(assistProvider->runType() == IAssistProvider::Asynchronous,
|
||||
return TextEditor::ProposalModelPtr());
|
||||
|
||||
QScopedPointer<IAssistProcessor> processor(assistProvider->createProcessor());
|
||||
QScopedPointer<IAssistProcessor> processor(assistProvider->createProcessor(assistInterface));
|
||||
QTC_ASSERT(processor, return TextEditor::ProposalModelPtr());
|
||||
|
||||
WaitForAsyncCompletions waitForCompletions;
|
||||
|
||||
Reference in New Issue
Block a user