| 12 | #include <KTextEditor/Document> |
| 13 | |
| 14 | void KDevelop::PersistentMovingRangePrivate::connectTracker() |
| 15 | { |
| 16 | Q_ASSERT(m_tracker == nullptr); |
| 17 | Q_ASSERT(m_movingRange == nullptr); |
| 18 | |
| 19 | m_tracker = ICore::self()->languageController()->backgroundParser()->trackerForUrl(m_document); |
| 20 | |
| 21 | if (m_tracker) { |
| 22 | // Create a moving range |
| 23 | auto* const document = m_tracker->document(); |
| 24 | m_movingRange = document->newMovingRange(m_range); |
| 25 | if (m_shouldExpand) |
| 26 | m_movingRange->setInsertBehaviors( |
| 27 | KTextEditor::MovingRange::ExpandLeft | KTextEditor::MovingRange::ExpandRight); |
| 28 | connect(document, &KTextEditor::Document::aboutToDeleteMovingInterfaceContent, this, |
| 29 | &PersistentMovingRangePrivate::aboutToDeleteMovingInterfaceContent); |
| 30 | connect(document, &KTextEditor::Document::aboutToInvalidateMovingInterfaceContent, this, |
| 31 | &PersistentMovingRangePrivate::aboutToInvalidateMovingInterfaceContent); |
| 32 | m_movingRange->setAttribute(m_attribte); |
| 33 | m_movingRange->setZDepth(m_zDepth); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | void KDevelop::PersistentMovingRangePrivate::aboutToInvalidateMovingInterfaceContent() |
| 38 | { |
no test coverage detected