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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user