diff --git a/src/libs/qmljs/qmljsindenter.cpp b/src/libs/qmljs/qmljsindenter.cpp
index b6c82f0e717dbfcb7989100f152d53417f82bcc3..e6cdf265392eeb76348039189ef6950d4e55d362 100644
--- a/src/libs/qmljs/qmljsindenter.cpp
+++ b/src/libs/qmljs/qmljsindenter.cpp
@@ -321,6 +321,11 @@ Token QmlJSIndenter::lastToken() const
     return Token();
 }
 
+QStringRef QmlJSIndenter::tokenText(const Token &token) const
+{
+    return yyLinizerState.line.midRef(token.offset, token.length);
+}
+
 /*
     Saves and restores the state of the global linizer. This enables
     backtracking.
diff --git a/src/libs/qmljs/qmljsindenter.h b/src/libs/qmljs/qmljsindenter.h
index 82e7ae561595af2d3d82e14b0872a5d733162f10..37683a91a9cdd33f58e3bdab2078c62c2cd9b9a3 100644
--- a/src/libs/qmljs/qmljsindenter.h
+++ b/src/libs/qmljs/qmljsindenter.h
@@ -85,6 +85,7 @@ private:
     int indentForStandaloneLine();
 
     Token lastToken() const;
+    QStringRef tokenText(const Token &token) const;
 
 private:
     int ppHardwareTabSize;