diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-06-04 11:02:01 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-06-04 11:02:33 +0200 |
commit | 2ede9773bbf4d7c56b092b5d67bd729ddae8cf19 (patch) | |
tree | 2205d3548b2d195fc0bc30180e5d0ff7dee6cf82 /src/plugins/qmljseditor/qmljsquickfix.cpp | |
parent | 31748e7377fde6d1599c5c27200d746fc8f82a78 (diff) | |
download | qt-creator-2ede9773bbf4d7c56b092b5d67bd729ddae8cf19.tar.gz |
Introduced token-based operations for QML/JS quick-fixes.
Diffstat (limited to 'src/plugins/qmljseditor/qmljsquickfix.cpp')
-rw-r--r-- | src/plugins/qmljseditor/qmljsquickfix.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/qmljseditor/qmljsquickfix.cpp b/src/plugins/qmljseditor/qmljsquickfix.cpp index a90a76c4ed..cd64160934 100644 --- a/src/plugins/qmljseditor/qmljsquickfix.cpp +++ b/src/plugins/qmljseditor/qmljsquickfix.cpp @@ -33,6 +33,35 @@ using namespace QmlJSEditor::Internal; +QmlJSQuickFixOperation::QmlJSQuickFixOperation(TextEditor::BaseTextEditor *editor) + : TextEditor::QuickFixOperation(editor) +{ +} + +QmlJSQuickFixOperation::~QmlJSQuickFixOperation() +{ +} + +void QmlJSQuickFixOperation::move(const QmlJS::AST::SourceLocation &loc, int to) +{ + move(position(loc.startColumn, loc.startColumn), to); +} + +void QmlJSQuickFixOperation::replace(const QmlJS::AST::SourceLocation &loc, const QString &replacement) +{ + replace(position(loc.startLine, loc.startColumn), replacement); +} + +void QmlJSQuickFixOperation::remove(const QmlJS::AST::SourceLocation &loc) +{ + remove(position(loc.startLine, loc.startColumn)); +} + +void QmlJSQuickFixOperation::copy(const QmlJS::AST::SourceLocation &loc, int to) +{ + copy(position(loc.startLine, loc.startColumn), to); +} + QmlJSQuickFixCollector::QmlJSQuickFixCollector() { } |