forked from qt-creator/qt-creator
LanguageClient: improve the performance of creating text marks
If we already know the document for a text mark we can save the lookup in the documentModel. This improves the performance for the text mark creation on windows by around 10%. Change-Id: Iecf9cb2e9114ed026f5e354e75d279b54c0ce51d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -263,16 +263,16 @@ Task createTask(const ClangDiagnostic &diagnostic)
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
||||
ClangdTextMark::ClangdTextMark(TextEditor::TextDocument *doc,
|
||||
const Diagnostic &diagnostic,
|
||||
bool isProjectFile,
|
||||
ClangdClient *client)
|
||||
: TextEditor::TextMark(filePath,
|
||||
: TextEditor::TextMark(doc,
|
||||
int(diagnostic.range().start().line() + 1),
|
||||
{client->name(), client->id()})
|
||||
, m_lspDiagnostic(diagnostic)
|
||||
, m_diagnostic(
|
||||
convertDiagnostic(ClangdDiagnostic(diagnostic), filePath, client->hostPathMapper()))
|
||||
convertDiagnostic(ClangdDiagnostic(diagnostic), doc->filePath(), client->hostPathMapper()))
|
||||
, m_client(client)
|
||||
{
|
||||
setSettingsPage(CppEditor::Constants::CPP_CLANGD_SETTINGS_ID);
|
||||
|
||||
Reference in New Issue
Block a user