Skip to content

Formatter fails with unusual number of indentation spaces (1) #958

Open
@Destroy666x

Description

@Destroy666x

Or at least I think that's the issue - not sure if on extension's or VSCode's side.

I stumbled upon this file: https://github.com/WarmUpTill/SceneSwitcher/blob/master/forms/advanced-scene-switcher.ui which uses 1 space indentation.

I added my own code to it (QPushButton widget item):

                  <item>
                   <spacer name="horizontalSpacer_14">
                    <property name="orientation">
                     <enum>Qt::Horizontal</enum>
                    </property>
                    <property name="sizeHint" stdset="0">
                     <size>
                      <width>40</width>
                      <height>20</height>
                     </size>
                    </property>
                   </spacer>
                  </item>
                                    <item>
                                      <widget class="QPushButton" name="toggleElseActions">
                                        <property name="maximumSize">
                                          <size>
                                            <width>22</width>
                                            <height>16777215</height>
                                          </size>
                                        </property>
                                        <property name="flat">
                                          <bool>true</bool>
                                        </property>
                                        <property name="text">
                                          <string>!=</string>
                                        </property>
                                      </widget>
                                    </item>
                 </layout>

As you can see, the formatting is off, it decided to use 2 spaces instead of 1,

My VSCode settings are:

  • editor.detectIndentation set to true
  • editor.indentSize set to tabSize
  • editor.tabSize set to 4
  • editor.formatOnPaste set to true (but it also happens on file save or any other action that triggers formatter)

So no clue where 2 is coming from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions