Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » PDT2: code templates: indentation & comment templates
PDT2: code templates: indentation & comment templates [message #79757] Wed, 10 September 2008 09:35 Go to next message
Vlad Koshelev is currently offline Vlad KoshelevFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

I have a couple of questions:

1. When I insert a code template at non first position (N tabs before
cursor) the first line of template inserts the right way, but the rest
has indentation of N tabs:
Expecting (N = 2):
// cursor at 2 tabs before inserting a template
foreach ($array_variable as $variable) { // N tabs
|; // N + 1 tabs
} // N tabs

Result:
foreach ($array_variable as $variable) { // N tabs
|; // 2 * N + 1 tabs indentation
} // 2 * N tabs indentation


Here are my settings:
Formatter: Tab policy = Tabs
Editor->Typing: Tab key indents the current line = true

2. Is there any way to change default templates for "Generate Element
Comment" feature (right click->Source->Generate Element Comment)?
Changing templates in Preferences->PHP->Code Style->Code
templates->Comments seems to be not working.

I'm using Ganymede and PDT 2.0.0 (N20080907) on Linux.

Thanks!
Re: code templates: indentation & comment templates [message #79792 is a reply to message #79757] Wed, 10 September 2008 15:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.zend.com

Hi,

I think this is existing bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=206803

"Vlad Koshelev" <vlad.kosh@gmail.com> wrote in message
news:ga84ds$bu3$1@build.eclipse.org...
> Hi,
>
> I have a couple of questions:
>
> 1. When I insert a code template at non first position (N tabs before
> cursor) the first line of template inserts the right way, but the rest
> has indentation of N tabs:
> Expecting (N = 2):
> // cursor at 2 tabs before inserting a template
> foreach ($array_variable as $variable) { // N tabs
> |; // N + 1 tabs
> } // N tabs
>
> Result:
> foreach ($array_variable as $variable) { // N tabs
> |; // 2 * N + 1 tabs indentation
> } // 2 * N tabs indentation
>
>
> Here are my settings:
> Formatter: Tab policy = Tabs
> Editor->Typing: Tab key indents the current line = true
>
> 2. Is there any way to change default templates for "Generate Element
> Comment" feature (right click->Source->Generate Element Comment)?
> Changing templates in Preferences->PHP->Code Style->Code
> templates->Comments seems to be not working.
>
> I'm using Ganymede and PDT 2.0.0 (N20080907) on Linux.
>
> Thanks!
Re: code templates: indentation & comment templates [message #79805 is a reply to message #79792] Wed, 10 September 2008 16:15 Go to previous messageGo to next message
Vlad Koshelev is currently offline Vlad KoshelevFriend
Messages: 2
Registered: July 2009
Junior Member
I meant #245148 bug actually which was solved in the latest integration
build.
The second question is still unclear to me. What are the PHP->Code
style->Code templates settings for?

Thanks for your help!

Michael Spector wrote:
> Hi,
>
> I think this is existing bug:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=206803
>
> "Vlad Koshelev" <vlad.kosh@gmail.com> wrote in message
> news:ga84ds$bu3$1@build.eclipse.org...
>> Hi,
>>
>> I have a couple of questions:
>>
>> 1. When I insert a code template at non first position (N tabs before
>> cursor) the first line of template inserts the right way, but the rest
>> has indentation of N tabs:
....
>>
>> 2. Is there any way to change default templates for "Generate Element
>> Comment" feature (right click->Source->Generate Element Comment)?
>> Changing templates in Preferences->PHP->Code Style->Code
>> templates->Comments seems to be not working.
>>
>> I'm using Ganymede and PDT 2.0.0 (N20080907) on Linux.
>>
>> Thanks!
Re: code templates: indentation & comment templates [message #79820 is a reply to message #79805] Wed, 10 September 2008 16:32 Go to previous message
Roy Ganor is currently offline Roy GanorFriend
Messages: 149
Registered: July 2009
Senior Member
Regarding the code templates is a separate mechanism that will provide
templates for comments injection and future actions like code generation

- Roy

Vlad Koshelev wrote:

> I meant #245148 bug actually which was solved in the latest integration
> build.
> The second question is still unclear to me. What are the PHP->Code
> style->Code templates settings for?

> Thanks for your help!
Previous Topic:PDT 2.0.0 N20080823: Auto-Completion for class interfaces doesn't work
Next Topic:Images and CSS not displaying in browser output
Goto Forum:
  


Current Time: Sat Apr 20 02:22:35 GMT 2024

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

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

Back to the top