MCPcopy Create free account
hub / github.com/KDE/kdevelop / contextForHighlightingAt

Function contextForHighlightingAt

plugins/contextbrowser/contextbrowser.cpp:87–96  ·  view source on GitHub ↗

Helper that determines the context to use for highlighting at a specific position

Source from the content-addressed store, hash-verified

85
86// Helper that determines the context to use for highlighting at a specific position
87DUContext* 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
99DUContext* contextAt(const QUrl& url, KTextEditor::Cursor cursor)

Callers 2

contextAtFunction · 0.85
updateForViewMethod · 0.85

Calls 6

findContextAtMethod · 0.80
localScopeIdentifierMethod · 0.80
parentContextMethod · 0.45
typeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected