| 109 | }; |
| 110 | |
| 111 | QString textForDocument(const QUrl& url, const KTextEditor::Cursor& position) |
| 112 | { |
| 113 | bool close = false; |
| 114 | |
| 115 | auto* doc = ICore::self()->documentController()->documentForUrl(url); |
| 116 | if (!doc) { |
| 117 | doc = ICore::self()->documentController()->openDocument(url); |
| 118 | close = true; |
| 119 | } |
| 120 | |
| 121 | auto text = doc->textDocument()->text({{0, 0}, position}); |
| 122 | |
| 123 | if (close) { |
| 124 | doc->close(IDocument::Discard); |
| 125 | } |
| 126 | |
| 127 | return text; |
| 128 | } |
| 129 | |
| 130 | QExplicitlySharedDataPointer<ClangCodeCompletionContext> createContext(const ReferencedTopDUContext& top, |
| 131 | const ParseSessionData::Ptr& sessionData, |
no test coverage detected