forked from qt-creator/qt-creator
QuickFix: Move helpers from QuickFixData to RefactoringFile.
Makes them easy to use everywhere. Also when calling QuickFixData::textOf and friends, it wasn't really clear which file they would run on.
This commit is contained in:
@@ -40,12 +40,40 @@ class ModelManagerInterface;
|
||||
|
||||
namespace QmlJSEditor {
|
||||
|
||||
class QmlJSRefactoringChanges;
|
||||
|
||||
class QmlJSRefactoringFile: public TextEditor::RefactoringFile
|
||||
{
|
||||
public:
|
||||
QmlJSRefactoringFile();
|
||||
QmlJSRefactoringFile(const QString &fileName, QmlJSRefactoringChanges *refactoringChanges);
|
||||
QmlJSRefactoringFile(TextEditor::BaseTextEditor *editor, QmlJS::Document::Ptr document);
|
||||
|
||||
QmlJS::Document::Ptr qmljsDocument() const;
|
||||
|
||||
/*!
|
||||
\returns the offset in the document for the start position of the given
|
||||
source location.
|
||||
*/
|
||||
unsigned startOf(const QmlJS::AST::SourceLocation &loc) const;
|
||||
|
||||
private:
|
||||
QmlJSRefactoringChanges *refactoringChanges() const;
|
||||
|
||||
mutable QmlJS::Document::Ptr m_qmljsDocument;
|
||||
};
|
||||
|
||||
|
||||
class QmlJSRefactoringChanges: public TextEditor::RefactoringChanges
|
||||
{
|
||||
public:
|
||||
QmlJSRefactoringChanges(QmlJS::ModelManagerInterface *modelManager,
|
||||
const QmlJS::Snapshot &snapshot);
|
||||
|
||||
const QmlJS::Snapshot &snapshot() const;
|
||||
|
||||
QmlJSRefactoringFile file(const QString &fileName);
|
||||
|
||||
private:
|
||||
virtual void indentSelection(const QTextCursor &selection) const;
|
||||
virtual void fileChanged(const QString &fileName);
|
||||
|
||||
Reference in New Issue
Block a user