AndreOneti / qml-formatter

Formatter, definition and autocomplete for QML language
MIT License
17 stars 2 forks source link

wrong formatting incase of properties #25

Open AnushaPulichintha opened 1 year ago

AnushaPulichintha commented 1 year ago

Hello, Here is the simple qml item with property

import QtQuick
import QtQuick.Controls
Dialog {
    title: qsTr("About")
    property string tem_title: ""
    Label {
        text: "Lorem ipsum..."
    }
}

After formatting

import QtQuick
import QtQuick.Controls
Dialog {
    title: qsTr("About")
    property string tem_title: "";
        Label {
            text: "Lorem ipsum..."
        }
    }

is there any way to turn off the formatting for this single file ? Thank you !!

klaus-zaeper-horsch commented 1 year ago

I've the same problem. Every property-entry increases the indent:

ScrollView {
    id: scroller
    property color borderColor: "steelblue"
        property int borderWidth: 5

            ListView {
                model: 20
                delegate: ItemDelegate {
                    text: "Item " + index

                    required property int index
                }
            }
        }
walkthetalk commented 1 year ago

same problem!

centercao commented 1 year ago

same problem!

WilhelmHagemeister commented 1 year ago

same problem: but only observed when the property keyword is followed by the alias keyword

hiroi-sora commented 1 year ago

same problem +1

NoelCav commented 1 year ago

This issue was created in the last couple updates. Rolling back to version 1.3.0 solved this issue.

To roll back, download the qml-formatter-1.3.0.vsix file found in the /extensions/ folder. Then use Shift + Alt + P to open the command pallet and find "Extensions: Install by Vsix..." and select the file.

5a9awneh commented 1 year ago

Same thing here, i hope there's a fix soon