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

Method findInsertionPoint

plugins/clang/codegen/sourcemanipulation.cpp:242–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242int SourceCodeInsertion::findInsertionPoint() const
243{
244 int line = end().line();
245
246 const auto localDeclarations = m_context->localDeclarations();
247 for (auto* decl : localDeclarations) {
248 if (m_context->type() == DUContext::Class) {
249 continue;
250 }
251
252 if (!dynamic_cast<AbstractFunctionDeclaration*>(decl)) {
253 continue;
254 }
255
256 line = decl->range().end.line + 1;
257 if (decl->internalContext()) {
258 line = decl->internalContext()->range().end.line + 1;
259 }
260 }
261
262 clangDebug() << line << m_context->scopeIdentifier(true) << m_context->rangeInCurrentRevision()
263 << m_context->url().toUrl() << m_context->parentContext();
264 clangDebug() << "count of declarations:" << m_context->topContext()->localDeclarations().size();
265
266 return line;
267}

Callers

nothing calls this directly

Calls 13

localDeclarationsMethod · 0.80
scopeIdentifierMethod · 0.80
endFunction · 0.50
lineMethod · 0.45
typeMethod · 0.45
rangeMethod · 0.45
internalContextMethod · 0.45
toUrlMethod · 0.45
urlMethod · 0.45
parentContextMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected