NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Code Formatting

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
csdurbin



Joined: 26 Oct 2008
Posts: 3

PostPosted: Sun Oct 26, 2008 5:27 pm    Post subject: Code Formatting Reply with quote

I am currently using NetBeans 6.5RC1. Is it possible to adjust how PHP code is formatted?

When I use the format command, it formats code like this:
Code:

<?php
function somefunction()
{
    mycode here;
}

?>


I would like for it to format like this:
Code:

<?php
function somefunction()
    {
    mycode here;
    }

?>


Thanks,

C.Durbin
Back to top
compucoder



Joined: 10 Oct 2008
Posts: 33

PostPosted: Mon Oct 27, 2008 1:07 am    Post subject: Reply with quote

I looked for control over formatting myself and have found nothing and I am willing to bet we won't find any yet. I am sure the dev team will provide this at some point. If you go to Tools -> Options -> Editor -> Formatting and then select text/x-java you will see the formatting options available to Java. if you were doing Java you would be able to do exactly what you want. You'll notice there is no PHP option in that drop down which leads me to believe they haven't provided control over the formatting for PHP yet.

The best thing you can do is use their IssueTracker and submit enhancements like this so they know what people want and how they use the product. You can also see the current progress of their efforts on Hudson at http://deadlock.netbeans.org/hudson/job/PHP-build/

Btw, I also looked into JIndent hoping I could trick it to formatting php files and had no luck with it. I wasn't surprised though. Smile
Back to top
csdurbin



Joined: 26 Oct 2008
Posts: 3

PostPosted: Mon Oct 27, 2008 1:01 pm    Post subject: Reply with quote

Thank you for the information. I also spent quite a bit of time going through the options to see if any of them affected PHP formatting. Sadly, none of them did.

I have a couple of external tools that I can use to format code, but would prefer to have the option integrated into the IDE.

I will post something into the IssueTracker ASAP.

C.Durbin
Back to top
Tomasz Slota
Posted via mailing list.





PostPosted: Mon Oct 27, 2008 1:29 pm    Post subject: Code Formatting Reply with quote

Hi there,

It is not possible at the moment but we are already working on more
formatting options for NB 7.0, your use case should be supported by
that release.

Tomasz Slota


On Oct 26, 2008, at 6:27 PM, csdurbin wrote:

Quote:
I am currently using NetBeans 6.5RC1. Is it possible to adjust how
PHP code is formatted?



When I format it formats code like this:


Code:


<?php

function somefunction()

{

mycode here;

}



?>







I would like for it to format like this:


Code:


<?php

function somefunction()

{

mycode here;

}



?>







Thanks,



C.Durbin[/code]









Back to top
Petr Pisl
Posted via mailing list.





PostPosted: Mon Oct 27, 2008 2:48 pm    Post subject: Code Formatting Reply with quote

Yes, I just want to confirm what Tomasz has written. There wasn't enough
time to provide the functionality into NetBeans 6.5.

Regards,
Petr
Quote:
Hi there,

It is not possible at the moment but we are already working on more
formatting options for NB 7.0, your use case should be supported by
that release.

Tomasz Slota


On Oct 26, 2008, at 6:27 PM, csdurbin wrote:

Quote:
I am currently using NetBeans 6.5RC1. Is it possible to adjust how
PHP code is formatted?



When I format it formats code like this:


Code:


<?php

function somefunction()

{

mycode here;

}



?>







I would like for it to format like this:


Code:


<?php

function somefunction()

{

mycode here;

}



?>







Thanks,



C.Durbin[/code]















Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo