NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code completion style


Joined: 13 Jan 2009
Posts: 11
Location: Central West NSW, Australia
Reply with quote
I like the code completion where I can start an array and have the"['']" done automagickally, but who can I specify what I would like as the templet, eg;

Code:
$_SESSION['something']

is the automatically done, but I would like
Code:
$_SESSION[ 'something' ]

ie have a space between the brackets and the opening rabbit ears, I know I could use polystyle to refactor the code but if I can just do it a coding time that would be nice.

Thanks,
Larry
View user's profileFind all posts by jenolanSend private message
Guru master

Joined: 05 Jul 2004
Posts: 660
Location: Belgium
Reply with quote
I have asked for the same regarding function calls and so on. I think the only satisfying solution in this case would be something like Eclipse has, where you can define your code style in great detail. Not that something like that is easily implemented.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 10 Aug 2004
Posts: 21
Location: Windsor, CT
Reply with quote
Maybe NuSphere could add a special code template entry. I've always been annoyed with how the IDE auto-closes braces. I've used eclipse and agree the code styling feature is nice but it is a real 'PITA' to set up and maintain.

On the other hand there is polystyle that ships with PhpEd. I have used that with some success on ancient and legacy code to helps reformat code into a more readable style and offers a lot of control of the styling.

_________________
regards
david
View user's profileFind all posts by dcabramesSend private messageVisit poster's website


Joined: 10 Aug 2004
Posts: 21
Location: Windsor, CT
Reply with quote
You know sometimes I can be a real brainless twit.

You could accomplish what you want by creating a code template. and assigning it a short-cut key. I tried this and it works for braces:

In the code template I created a template for closed braces, called it "{}" with a short cut of Shift+Ctrl+{ and in the template did this:
Code:
{
    |
}


Now when I press Shift+Ctrl+{ I get the formated closed braces I want.

You could create a simular template called "'" (single quote) use a short cut of Ctrl+' and in the template format how you want the closed single quotes to be formatted.

Hope this helps

_________________
regards
david
View user's profileFind all posts by dcabramesSend private messageVisit poster's website
Code completion style
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
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic