| 175 | } |
| 176 | |
| 177 | DocumentChangeSet::ChangeResult BasicRefactoring::applyChangesToDeclarations(const QString& oldName, |
| 178 | const QString& newName, |
| 179 | DocumentChangeSet& changes, |
| 180 | const QList<IndexedDeclaration>& declarations) |
| 181 | { |
| 182 | for (auto& decl : declarations) { |
| 183 | Declaration* declaration = decl.data(); |
| 184 | if (!declaration) |
| 185 | continue; |
| 186 | if (declaration->range().isEmpty()) |
| 187 | qCDebug(LANGUAGE) << "found empty declaration"; |
| 188 | |
| 189 | TopDUContext* top = declaration->topContext(); |
| 190 | DocumentChangeSet::ChangeResult result = |
| 191 | changes.addChange(DocumentChange(top->url(), declaration->rangeInCurrentRevision(), oldName, newName)); |
| 192 | if (!result) |
| 193 | return result; |
| 194 | } |
| 195 | |
| 196 | return DocumentChangeSet::ChangeResult::successfulResult(); |
| 197 | } |
| 198 | |
| 199 | KDevelop::IndexedDeclaration BasicRefactoring::declarationUnderCursor(bool allowUse) |
| 200 | { |
nothing calls this directly
no test coverage detected