This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
when using chevrons to mark a text area, it should not be indented by the source-format option, because it breaks the code and stops the the colour highlighting from working as well. e.g. consider this unformatted code <body> <?php echo <<<EOT <h1> some header </h1> EOT; when correctly formated should be <body> <?php echo <<<EOT <h1> some header </h1> EOT; so that the text boudary markers stay at the left hand side. at the moment the auto format gives the following: <body> <?php echo <<<EOT <h1> some header </h1> EOT; the indent means the compiler cannot recognise the text boundary markers.
The heredoc and nowdoc (PHP 5.3) shouldn't be formatted by php code. The biggest problem as is mentioned that the end of heredoc or nowdoc doesn't have to be recognized and all file then is thread as a string. Example of nowdoc: <?php $str = <<<'EOD' Example of string spanning multiple lines using nowdoc syntax. EOD; /* More complex example, with variables. */ class foo { public $foo; public $bar; function foo() { $this->foo = 'Foo'; $this->bar = array('Bar1', 'Bar2', 'Bar3'); } } $foo = new foo(); $name = 'MyName'; echo <<<'EOT' My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should not print a capital 'A': \x41 EOT; ?>
fixed & unit tested: http://hg.netbeans.org/web-main/rev/4c1e01e54386
verified Product Version: NetBeans IDE Dev (Build 091119-840bbe3ddcb3) Java: 1.5.0_17-ea; Java HotSpot(TM) 64-Bit Server VM 1.5.0_17-ea-b01
When selecting text containing a complete HEREDOC block and pressing TAB or Shift + TAB, the HEREDOC block (the content) shouldn't be indented because it will break the code. When selecting only the HEREDOC content (without the start and end tags), it's ok to indent the content. Tested in v8.1