forked from qt-creator/qt-creator
Editor: move ownership of assist interface to processor
This way the base class can manage the lifetime of the interface object and it doesn't need to be done in each implementation of perform. Change-Id: Ie1ce742e31b688a337533ee6c57d376146e25ace 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:
@@ -63,7 +63,7 @@ class LANGUAGECLIENT_EXPORT LanguageClientQuickFixAssistProcessor
|
||||
public:
|
||||
explicit LanguageClientQuickFixAssistProcessor(Client *client) : m_client(client) {}
|
||||
bool running() override { return m_currentRequest.has_value(); }
|
||||
TextEditor::IAssistProposal *perform(TextEditor::AssistInterface *interface) override;
|
||||
TextEditor::IAssistProposal *perform() override;
|
||||
void cancel() override;
|
||||
|
||||
protected:
|
||||
@@ -76,7 +76,6 @@ private:
|
||||
virtual TextEditor::GenericProposal *handleCodeActionResult(
|
||||
const LanguageServerProtocol::CodeActionResult &result);
|
||||
|
||||
QSharedPointer<const TextEditor::AssistInterface> m_assistInterface;
|
||||
Client *m_client = nullptr; // not owned
|
||||
std::optional<LanguageServerProtocol::MessageId> m_currentRequest;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user