Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

Code completation results in ugly indention

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Florian Klaempfl

I just tried another time the code completation in lazarus for a class, however it resulted again in a pretty bad indention, see attachment. I played with various options and things but nothing helped (procedure/constructor should be at column 4 as it is typically in the compiler sources, begin/end at column 6). What is wrong/how can I tweak it? -------------- next part --------------
A non-text attachment was scrubbed...
Name: Clipboard02.png
Type: image/png
Size: 11138 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110818/c0b17e60/attachment.png>

Reply by email

Alexander Klenin
to Florian Klaempfl

2011/8/19 Florian Klaempfl :

Show quoted text 5 lines
I just tried another time the code completation in lazarus for a class, however it resulted again in a pretty bad indention, see attachment. I played with various options and things but nothing helped (procedure/constructor should be at column 4 as it is typically in the compiler sources, begin/end at column 6). What is wrong/how can I tweak it?

It seems that this file uses totally unique indentation rules, incomatible with the rest of the world ;-)
I'd suggest to turn off auto-indent -- it is not very useful anyway. Note that auto-indent is NOT the same as code completion, which is much more important and should work for you.

Alexander S. Klenin

Reply by email

Florian Klämpfl
to Alexander Klenin
Alexander Klenin wrote 11 lines
2011/8/19 Florian Klaempfl : > I just tried another time the code completation in lazarus for a class, > however it resulted again in a pretty bad indention, see attachment. I > played with various options and things but nothing helped > (procedure/constructor should be at column 4 as it is typically in the > compiler sources, begin/end at column 6). What is wrong/how can I tweak it? It seems that this file uses totally unique indentation rules, incomatible with the rest of the world ;-) I'd suggest to turn off auto-indent -- it is not very useful anyway. Note that auto-indent is NOT the same as code completion,

Of course not, but code generated by code completion should be indentend correctly, no?

which is much more important and should work for you.

Well, it works, but as the example shows, it is indented really ugly and practically unusable because it requires a lot of hand work to get the indentation right.

Reply by email

Alexander Klenin
to Florian Klämpfl
Florian Kl?mpfl wrote 15 lines
Am 19.08.2011 17:04, schrieb Alexander Klenin: > It seems that this file uses totally unique indentation rules, > incomatible with the rest of the world ;-) > I'd suggest to turn off auto-indent -- it is not very useful anyway. > Note that auto-indent is NOT the same as code completion, Of course not, but code generated by code completion should be indentend correctly, no? > which is much more important and should work for you. > Well, it works, but as the example shows, it is indented really ugly and practically unusable because it requires a lot of hand work to get the indentation right.

Ah, I did not look close enough -- this is all auto-generated code... Indeed, you have a problem ;-)
Did you consider re-formatting the unit to a more standard rules?

Alexander S. Klenin

Reply by email

Graeme Geldenhuys
to Florian Klämpfl: Of course not, but code generated by code completion should be indentend correctly, no?…
Florian Kl?mpfl wrote
Well, it works, but as the example shows, it is indented really ugly and practically unusable because it requires a lot of hand work to get the indentation right.

I have one project name for you: "jedi code formatter"

The original one on SourceForge, not the broken one in Lazarus.

Setup your formatting rules once, and apply and needed. Been using it for years. You can even setup JCF has an Lazarus external tool option with a keyboard shortcut to trigger it. I haven't done manual code formatting in years.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Florian Klämpfl
to Alexander Klenin: Ah, I did not look close enough -- this is all auto-generated code... Indeed, you have a…
Alexander Klenin wrote 21 lines
On Sat, Aug 20, 2011 at 02:07, Florian Kl?mpfl wrote: > Am 19.08.2011 17:04, schrieb Alexander Klenin: >> It seems that this file uses totally unique indentation rules, >> incomatible with the rest of the world ;-) >> I'd suggest to turn off auto-indent -- it is not very useful anyway. >> Note that auto-indent is NOT the same as code completion, > > Of course not, but code generated by code completion should be indentend > correctly, no? > >> which is much more important and should work for you. >> > > Well, it works, but as the example shows, it is indented really ugly and > practically unusable because it requires a lot of hand work to get the > indentation right. Ah, I did not look close enough -- this is all auto-generated code... Indeed, you have a problem ;-) Did you consider re-formatting the unit to a more standard rules?

It is formatted according to the standard rules of the compiler :) And no, the formatting rules of the compiler sources won't change :)

Reply by email

Alexander Klenin
to Florian Klämpfl
Florian Kl?mpfl wrote 5 lines
> Did you consider re-formatting the unit to a more standard rules? > It is formatted according to the standard rules of the compiler :) And no, the formatting rules of the compiler sources won't change :)

I knew what you answer will be, but there's always a small hope ;-)

Alexander S. Klenin

Reply by email

Flávio Etrusco
to Alexander Klenin: 2011/8/19 Florian Klaempfl : It seems that this file uses totally unique indentation…
Alexander Klenin wrote 13 lines
2011/8/19 Florian Klaempfl : > I just tried another time the code completation in lazarus for a class, > however it resulted again in a pretty bad indention, see attachment. I > played with various options and things but nothing helped > (procedure/constructor should be at column 4 as it is typically in the > compiler sources, begin/end at column 6). What is wrong/how can I tweak it? It seems that this file uses totally unique indentation rules, incomatible with the rest of the world ;-) I'd suggest to turn off auto-indent -- it is not very useful anyway. Note that auto-indent is NOT the same as code completion, which is much more important and should work for you.

Yeah, auto-indent breaks in much simpler cases already :-( Florian, what do you think should be the ruler/pivot in that case? The class comment? The last code/class before? Whole file evaluation?

Best regards,
Fl?vio

Reply by email

Florian Klämpfl
to Flávio Etrusco
Fl?vio Etrusco wrote 17 lines
On Fri, Aug 19, 2011 at 12:04 PM, Alexander Klenin wrote: > 2011/8/19 Florian Klaempfl : >> I just tried another time the code completation in lazarus for a class, >> however it resulted again in a pretty bad indention, see attachment. I >> played with various options and things but nothing helped >> (procedure/constructor should be at column 4 as it is typically in the >> compiler sources, begin/end at column 6). What is wrong/how can I tweak it? > > It seems that this file uses totally unique indentation rules, > incomatible with the rest of the world ;-) > I'd suggest to turn off auto-indent -- it is not very useful anyway. > Note that auto-indent is NOT the same as code completion, > which is much more important and should work for you. > Yeah, auto-indent breaks in much simpler cases already :-( Florian, what do you think should be the ruler/pivot in that case?

What do you mean with pivot? The "starting" indention? This one is detected correctly.

Reply by email