LanguageClient: track all created diagnostic marks

Removing a block results in taking marks of that line out of the
document, but does not delete those marks. So we cannot rely on
iterating over marks of a document to delete all marks for a specific
file. Instead save all marks from text mark creator for a file path and
iterate this list to delete diagnostic marks.

Fixes: QTCREATORBUG-26585
Change-Id: Idc41fce5de4ade68f4a29c23ba02844701b44d3c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-02-22 10:29:10 +01:00
parent ee4757a8e8
commit 3cf6d15096
3 changed files with 19 additions and 20 deletions

View File

@@ -617,7 +617,7 @@ void Client::activateDocument(TextEditor::TextDocument *document)
void Client::deactivateDocument(TextEditor::TextDocument *document)
{
m_diagnosticManager.hideDiagnostics(document);
m_diagnosticManager.hideDiagnostics(document->filePath());
resetAssistProviders(document);
document->setFormatter(nullptr);
m_tokenSupport.clearHighlight(document);