| 240 | } |
| 241 | |
| 242 | int 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 | } |
nothing calls this directly
no test coverage detected