logic: lazy load code annotations

* code annotations are loaded after showing the code file
* added traces
* refactored highlighter
* fixed error tooltip style in codeview

fortune cookie message = It's not the time that counts, but what you do with it.
This commit is contained in:
Eberhard Graether
2018-03-24 13:19:49 +01:00
parent 0d79639c96
commit aed783f5ca
24 changed files with 405 additions and 361 deletions
+16 -1
View File
@@ -294,6 +294,21 @@ void QtCodeArea::updateLineNumberAreaWidthForDigits(int digits)
updateLineNumberAreaWidth();
}
void QtCodeArea::updateSourceLocations(std::shared_ptr<SourceLocationFile> locationFile)
{
if (locationFile->getSourceLocationCount() > getSourceLocationFile()->getSourceLocationCount())
{
if (m_hoveredAnnotations.size())
{
setHoveredAnnotations({});
}
createAnnotations(locationFile);
annotateText();
}
}
void QtCodeArea::updateContent()
{
annotateText();
@@ -582,7 +597,7 @@ void QtCodeArea::mouseMoveEvent(QMouseEvent* event)
if (m_navigator->hasErrors() && annotations.size() == 1 && annotations[0]->tokenIds.size())
{
std::wstring errorMessage = m_navigator->getErrorMessageForId(*annotations[0]->tokenIds.begin());
QToolTip::showText(event->globalPos(), QString::fromStdWString(errorMessage));
QToolTip::showText(event->globalPos(), QString::fromStdWString(errorMessage), this);
}
}
}