MCPcopy Create free account
hub / github.com/KDE/kdevelop / applyChangesToDeclarations

Method applyChangesToDeclarations

kdevplatform/language/codegen/basicrefactoring.cpp:177–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177DocumentChangeSet::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
199KDevelop::IndexedDeclaration BasicRefactoring::declarationUnderCursor(bool allowUse)
200{

Callers

nothing calls this directly

Calls 7

addChangeMethod · 0.80
dataMethod · 0.45
isEmptyMethod · 0.45
rangeMethod · 0.45
topContextMethod · 0.45
urlMethod · 0.45

Tested by

no test coverage detected