| 93 | } |
| 94 | |
| 95 | void CodeCompletion::checkDocument(Document* textDocument) |
| 96 | { |
| 97 | unregisterDocument(textDocument); |
| 98 | |
| 99 | const auto langs = ICore::self()->languageController()->languagesForUrl(textDocument->url()); |
| 100 | |
| 101 | bool found = false; |
| 102 | for (const auto lang : langs) { |
| 103 | if (m_language == lang->name()) { |
| 104 | found = true; |
| 105 | break; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | if (!found && !m_language.isEmpty()) |
| 110 | return; |
| 111 | |
| 112 | const auto views = textDocument->views(); |
| 113 | for (KTextEditor::View* view : views) { |
| 114 | viewCreated(textDocument, view); |
| 115 | } |
| 116 | |
| 117 | connect(textDocument, &Document::viewCreated, this, &CodeCompletion::viewCreated); |
| 118 | } |
| 119 | |
| 120 | #include "moc_codecompletion.cpp" |
nothing calls this directly
no test coverage detected