Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Problems with auto formatting and HEREDOC
Problems with auto formatting and HEREDOC [message #1804601] Fri, 29 March 2019 08:49
Bernd Schuhmacher is currently offline Bernd SchuhmacherFriend
Messages: 1
Registered: March 2019
Junior Member
Hi

I have a problem when auto formatting (CTRL-SHIFT-F) a php file with some strings defined with the HEREDOC syntax.

If the definition of the string is in an area which is already indented the end marker for the HEREDOC- string need to be on the start of a new line. If not there will be a "PHP Parse error" after that line.

Example:
<?php
function foo(){
    echo <<<EOT
Ha, you found foo ...
so we can do some funny things here.
EOT;
}

foo();
?>

This code is working as expected. After doing automatic formatting with CTRL-SHIFT-F the code looks like this:
<?php

function foo()
{
    echo <<<EOT
        Ha, you found foo ...
        so we can do some funny things here.
    EOT;
}

foo();
?>

Besides that it is not parsable anymore the formatting within the string is "destroyed" as the spaces inserted are printed to if I make the code usable again by deleting the spaces before "EOT;".

Is there a way to configure this to work properly or is this a bug with PDT?

Regards
Bernd
Previous Topic:Problems in XDEBUG with path mapper
Next Topic:Install Eclipse without any Features
Goto Forum:
  


Current Time: Sat Nov 11 07:41:59 GMT 2023

Powered by FUDForum. Page generated in 0.01588 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top