CMakeToolManager: Add static readFirstParagraphs()

Reuse it in CMakeEditor and CMakeFileCompletionAssistProvider.

Amends d04585b519

Change-Id: I8dbd59c815e017404ff215ca1ff68740d6653e91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Jarek Kobus
2023-09-27 13:01:18 +02:00
committed by Cristian Adam
parent cbc6809b28
commit 4e90ca1b59
4 changed files with 19 additions and 19 deletions

View File

@@ -9,7 +9,6 @@
#include "cmakefilecompletionassist.h"
#include "cmakeindenter.h"
#include "cmakekitaspect.h"
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
#include "3rdparty/cmake/cmListFileCache.h"
@@ -347,8 +346,6 @@ const CMakeKeywords &CMakeHoverHandler::keywords() const
return m_keywords;
}
QString readFirstParagraphs(const QString &element, const FilePath &helpFile);
void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget,
int pos,
ReportPriority report)
@@ -377,7 +374,7 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget
}
m_helpToolTip.clear();
if (!helpFile.isEmpty())
m_helpToolTip = readFirstParagraphs(word, helpFile);
m_helpToolTip = CMakeToolManager::readFirstParagraphs(helpFile);
setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None);
}