Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-29001

JS is doing funny this when formating.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • Qt Creator 11.0.0
    • Qt Creator 9.0.1, Qt Creator 10.0.0
    • Quick / QML Support
    • None
    • All
    • 78cf56314 (master)

    Description

      I don't know if this bug has been already solved or not (sorry if that the case).

      I found the formating of QML really useful, and I use it pretty often even on JS files since it also supposed to work.
      But the formating seem to broke when there are ".import ..." lines in the file.
      This

       

      .pragma library
      
      .import QtQml as QTQML
      .import QtQuick as QTQUICK 

       

      will become this (i don't know if this actually the normal behaviour)

       

      .pragma library
      .import QtQml as QTQML .import QtQuick as QTQUICK 

       

       To prevent that, I add comments at the end.

       

      .pragma library
      
      .import QtQml as QTQML // -
      .import QtQuick as QTQUICK // - 

       

      But every time i format it become worst
      After 1 formating:

       

      .pragma library
      // -
      .import QtQml as QTQML // -// -
      .import QtQuick as QTQUICK // - 

      After 3 formating:

       

       

      .pragma library
      // -
      // -// -
      // -// -// -
      .import QtQml as QTQML // -// -// -// -
      .import QtQuick as QTQUICK // - 

       

       

      It's continue indefinitely and increase exponentially with the number of import/comment

      After 5 formating

      .pragma library
      //  -
      //  -//  -
      //  -//  -//  -//  -
      //  -//  -//  -//  -//  -//  -//  -
      //  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -
      .import Components.Const 1.0 as Const //  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -//  -
      .import QtQml as QTQML //  -//  -//  -//  -//  -//  -
      .import QtQuick as QTQUICK //  -

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            semih.yavuz Semih Yavuz
            dalverny Sébastien Dalverny
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes