Aptana Studio
  1. Aptana Studio
  2. APSTUD-4356

PHP: Unable to format string with interleaved comments

    Details

    • Story Points:
      13

      Description

      Attached PHP file has the code that fails plus the error code

      Code:

      <?php
      
      $sql = //
      'SELECT    r.id ' . //
      'FROM      record AS r '. //
      'WHERE     status = \'closed\' '. //
      'AND flags & 1 = 0';
      echo $sql;
      
      ?>
      

        Activity

        Hide
        Shalom Gibly added a comment -

        Fixed.

        (The issue was that the formatter failed computer the dot operator range when a comment appeared after it.)

        Show
        Shalom Gibly added a comment - Fixed. (The issue was that the formatter failed computer the dot operator range when a comment appeared after it.)
        Hide
        Ingo Muschenetz added a comment -

        I get the same error about unable to format in Titanium Studio, build: 2.0.0.201203202130

        Show
        Ingo Muschenetz added a comment - I get the same error about unable to format in Titanium Studio, build: 2.0.0.201203202130
        Hide
        Shalom Gibly added a comment -

        It's actually a different error now. looks like it's coming from the HTML formatter, and is a result of a faulty node merge (PHP and HTML).
        Will try to fix this asap.

        Show
        Shalom Gibly added a comment - It's actually a different error now. looks like it's coming from the HTML formatter, and is a result of a faulty node merge (PHP and HTML). Will try to fix this asap.
        Hide
        Shalom Gibly added a comment -

        Fixed.
        This was an off-by-one issue with the HTML formatter (we run both HTML and PHP formatters for PHP files).
        The problem was reproducible only when the PHP closing tag was the last character in the document. Adding a space at the end of the file caused it to format with no problems, so I figured it's an off-by-one issue and fixed it.

        Show
        Shalom Gibly added a comment - Fixed. This was an off-by-one issue with the HTML formatter (we run both HTML and PHP formatters for PHP files). The problem was reproducible only when the PHP closing tag was the last character in the document. Adding a space at the end of the file caused it to format with no problems, so I figured it's an off-by-one issue and fixed it.
        Hide
        Clayton Headley (Inactive) added a comment -

        Verified fixed in Windows 7, Mac OS 10.7.3, and Ubuntu 11.10 using Titanium Studio build: 2.1.0.201204121528. Closing ticket.

        Show
        Clayton Headley (Inactive) added a comment - Verified fixed in Windows 7, Mac OS 10.7.3, and Ubuntu 11.10 using Titanium Studio build: 2.1.0.201204121528. Closing ticket.

          People

          • Assignee:
            Shalom Gibly
            Reporter:
            Johannes Arntz
          • Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: