forked from qt-creator/qt-creator
CodeAssist: Fix leaking asynchronous processors
Currently the ownership of the processor is unknown to the codeassist when running an async operation. Move the ownership of the processor to the assist and delete the processor after the proposal was completed. Change-Id: I6a2e023c47cbc876669dba866bee12b481447cb7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -59,6 +59,7 @@ namespace Core { class IDocument; }
|
||||
namespace ProjectExplorer { class Project; }
|
||||
namespace TextEditor
|
||||
{
|
||||
class IAssistProcessor;
|
||||
class TextDocument;
|
||||
class TextEditorWidget;
|
||||
class TextMark;
|
||||
@@ -141,6 +142,9 @@ public:
|
||||
bool isSupportedFile(const Utils::FilePath &filePath, const QString &mimeType) const;
|
||||
bool isSupportedUri(const LanguageServerProtocol::DocumentUri &uri) const;
|
||||
|
||||
void addAssistProcessor(TextEditor::IAssistProcessor *processor);
|
||||
void removeAssistProcessor(TextEditor::IAssistProcessor *processor);
|
||||
|
||||
void setName(const QString &name) { m_displayName = name; }
|
||||
QString name() const { return m_displayName; }
|
||||
|
||||
@@ -233,6 +237,7 @@ private:
|
||||
HoverHandler m_hoverHandler;
|
||||
QHash<LanguageServerProtocol::DocumentUri, TextEditor::HighlightingResults> m_highlights;
|
||||
const ProjectExplorer::Project *m_project = nullptr;
|
||||
QSet<TextEditor::IAssistProcessor *> m_runningAssistProcessors;
|
||||
};
|
||||
|
||||
} // namespace LanguageClient
|
||||
|
||||
Reference in New Issue
Block a user