forked from qt-creator/qt-creator
LanguageClient: optimize cloning documents
Cloning the document that is needed to track the changes for the language server is 3 times slower than just getting the whole original document content and create a new QTextDocument with that content. Presumably some additional information gets cloned that is not needed for just the content tracking. Change-Id: I4a7002b2ac97563f01dc3a67351b9363e9cc7b3f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -618,7 +618,7 @@ void Client::openDocument(TextEditor::TextDocument *document)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d->m_openedDocument[document].document = document->document()->clone(this);
|
d->m_openedDocument[document].document = new QTextDocument(document->document()->toPlainText());
|
||||||
d->m_openedDocument[document].contentsChangedConnection
|
d->m_openedDocument[document].contentsChangedConnection
|
||||||
= connect(document,
|
= connect(document,
|
||||||
&TextDocument::contentsChangedWithPosition,
|
&TextDocument::contentsChangedWithPosition,
|
||||||
|
Reference in New Issue
Block a user