diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index 0678d79b383..7bb446ab9f2 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -226,7 +226,7 @@ void QmlJSEditorPluginPrivate::reformatFile() QmlJS::Document::MutablePtr latestDocument; const Utils::FilePath fileName = m_currentDocument->filePath(); - latestDocument = snapshot.documentFromSource(QString::fromUtf8(m_currentDocument->contents()), + latestDocument = snapshot.documentFromSource(m_currentDocument->plainText(), fileName, QmlJS::ModelManagerInterface::guessLanguageOfFile(fileName)); latestDocument->parseQml();