Helper that determines the context to use for highlighting at a specific position
| 85 | |
| 86 | // Helper that determines the context to use for highlighting at a specific position |
| 87 | DUContext* contextForHighlightingAt(const KTextEditor::Cursor& position, TopDUContext* topContext) |
| 88 | { |
| 89 | DUContext* ctx = topContext->findContextAt(topContext->transformToLocalRevision(position)); |
| 90 | while (ctx && ctx->parentContext() |
| 91 | && (ctx->type() == DUContext::Template || ctx->type() == DUContext::Helper |
| 92 | || ctx->localScopeIdentifier().isEmpty())) { |
| 93 | ctx = ctx->parentContext(); |
| 94 | } |
| 95 | return ctx; |
| 96 | } |
| 97 | |
| 98 | ///Duchain must be locked |
| 99 | DUContext* contextAt(const QUrl& url, KTextEditor::Cursor cursor) |
no test coverage detected