File indexing completed on 2024-03-24 16:04:07

0001 /*
0002     SPDX-FileCopyrightText: 2014 Miquel Sabaté <mikisabate@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 
0008 #ifndef REFACTORING_H
0009 #define REFACTORING_H
0010 
0011 
0012 #include <interfaces/context.h>
0013 #include <language/codegen/basicrefactoring.h>
0014 
0015 
0016 namespace Php
0017 {
0018 
0019 class Refactoring : public KDevelop::BasicRefactoring
0020 {
0021 public:
0022     explicit Refactoring(QObject *parent = nullptr);
0023 
0024     KDevelop::DocumentChangeSet::ChangeResult applyChangesToDeclarations(
0025         const QString& oldName,
0026         const QString& newName,
0027         KDevelop::DocumentChangeSet& changes,
0028         const QList<KDevelop::IndexedDeclaration>& declarations) override;
0029 
0030     KDevelop::DocumentChangeSet::ChangeResult applyChanges(
0031         const QString& oldName,
0032         const QString& newName,
0033         KDevelop::DocumentChangeSet& changes,
0034         KDevelop::DUContext* context,
0035         int usedDeclarationIndex) override;
0036 
0037 private:
0038     bool shouldRemoveDollar(const KDevelop::RangeInRevision &range, QString name);
0039     bool shouldRemoveDollar(const KTextEditor::Range &range, QString name);
0040 };
0041 
0042 } // End of namespace Php
0043 
0044 
0045 #endif /* REFACTORING_H */