summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor
diff options
context:
space:
mode:
authorXavier BESSON <developer@xavi-b.fr>2022-04-02 12:15:26 +0200
committerXavier BESSON <developer@xavi-b.fr>2022-04-07 11:42:37 +0000
commit87e52ad18929110a756bd018793003ad717d3704 (patch)
treeb82e6d4473761c2691095a4a7834fe3c0a550742 /src/plugins/qmljseditor
parent4762d54401658e28be7fa04491d5ed6a5491e129 (diff)
downloadqt-creator-87e52ad18929110a756bd018793003ad717d3704.tar.gz
Line length for QML/JS editing automatic formatting
Adding parameters to functions in the QML/JS formatter Adding widget and setting to the QML/JS editing settings Fixes: QTCREATORBUG-23411 Change-Id: Ib9d3ac3b22443e81cd636fbc276c6544dab1511b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r--src/plugins/qmljseditor/qmljseditorplugin.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp
index fea27341a2..5d4533230b 100644
--- a/src/plugins/qmljseditor/qmljseditorplugin.cpp
+++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp
@@ -38,6 +38,8 @@
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/qmljsreformatter.h>
#include <qmljstools/qmljstoolsconstants.h>
+#include <qmljstools/qmljstoolssettings.h>
+#include <qmljstools/qmljscodestylepreferences.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
@@ -274,7 +276,8 @@ void QmlJSEditorPluginPrivate::reformatFile()
TextEditor::TabSettings tabSettings = m_currentDocument->tabSettings();
const QString &newText = QmlJS::reformat(document,
tabSettings.m_indentSize,
- tabSettings.m_tabSize);
+ tabSettings.m_tabSize,
+ QmlJSTools::QmlJSToolsSettings::globalCodeStyle()->currentCodeStyleSettings().lineLength);
// QTextDocument::setPlainText cannot be used, as it would reset undo/redo history
const auto setNewText = [this, &newText]() {