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>
Mailing lists / lazarus / 2011-08
Code completation results in ugly indention
9 messages · 5 people · –
- AAlexander Klenin 3
- FFlorian Klämpfl 3
- FFlorian Klaempfl 1
- FFlávio Etrusco 1
- GGraeme Geldenhuys 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
2011/8/19 Florian Klaempfl :
Show quoted text 5 lines
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 Klenin wrote 11 lines
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.
Florian Kl?mpfl wrote 15 lines
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?
Of course not, but code generated by code completion should be indentend correctly, no?…
Florian Kl?mpfl wroteWell, 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 -
Ah, I did not look close enough -- this is all auto-generated code... Indeed, you have a…
Alexander Klenin wrote 21 lines
It is formatted according to the standard rules of the compiler :) And no, the formatting rules of the compiler sources won't change :)
Florian Kl?mpfl wrote 5 lines
I knew what you answer will be, but there's always a small hope ;-)
2011/8/19 Florian Klaempfl : It seems that this file uses totally unique indentation…
Alexander Klenin wrote 13 lines
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
Fl?vio Etrusco wrote 17 lines
What do you mean with pivot? The "starting" indention? This one is detected correctly.
