| 128 | } |
| 129 | |
| 130 | QExplicitlySharedDataPointer<ClangCodeCompletionContext> createContext(const ReferencedTopDUContext& top, |
| 131 | const ParseSessionData::Ptr& sessionData, |
| 132 | const KTextEditor::Cursor position, |
| 133 | const QString& code = {}) |
| 134 | { |
| 135 | const auto url = top->url().toUrl(); |
| 136 | const auto text = code.isEmpty() ? textForDocument(url, position) : code; |
| 137 | return QExplicitlySharedDataPointer<ClangCodeCompletionContext>{ |
| 138 | new ClangCodeCompletionContext(DUContextPointer(top), sessionData, url, position, text)}; |
| 139 | } |
| 140 | |
| 141 | template<typename CustomTestFunction = NoopTestFunction> |
| 142 | void executeCompletionTest(const ReferencedTopDUContext& top, const CompletionItems& expectedCompletionItems, |
no test coverage detected