Recent

Author Topic: Exclude Jedi Code Formatter on code section  (Read 1823 times)

Romain

  • New member
  • *
  • Posts: 30
    • Attribute Changer Website
Exclude Jedi Code Formatter on code section
« on: November 03, 2018, 04:24:24 pm »
Hi,

I use the built-in Code Formatter to beautify my source code and would like to exclude a part of my source code from formatting.

Is there any directive I can use in source code to instruct Jedi Code Formatter to not process a part of the source code ?

Like $formatcode=off at the beginning of the block and $formatcode=on at the end of the section ?

I searched in the forums but did not find anything.

Romain

Thaddy

  • Hero Member
  • *****
  • Posts: 7884
Re: Exclude Jedi Code Formatter on code section
« Reply #1 on: November 03, 2018, 04:29:52 pm »
AFAIK: NO it's all or nothing. In my case nothing since it makes too many mistakes on new syntax. Unless it gets maintained it becomes less and less useful with every new release of FPC.
Hamlet 1.4 (nothing wrong with the Danish, btw)

Romain

  • New member
  • *
  • Posts: 30
    • Attribute Changer Website
Re: Exclude Jedi Code Formatter on code section
« Reply #2 on: November 03, 2018, 05:04:45 pm »
Thanks for the confirmation ... I think, I will switch to a 'manual' code formatting  :D

BrunoK

  • Full Member
  • ***
  • Posts: 121
  • Retired programmer
Re: Exclude Jedi Code Formatter on code section
« Reply #3 on: November 05, 2018, 11:52:33 am »
@Romain

What I do when I want to clarify procedure structures is :

1 Create a new unit. (File->New->Unit)
2 Select/copy syntactically coherent full procedure/function block(s) from the source you are working on and you want to JEDI CF (From procedure SomeProc(etc... to the matching end;)
3 Paste selection it in the unit (1) at the correct position, that is in implementation for complete procedure/function(s).
4 Ctrl-D (JCF) on the unit (1).
5 If worked, paste back reformatted code to the working unit.
6 Close and discard unit created in (1)
Lazarus trunk r. 59978/03.01.2019 (+/- patches regarding enabled, TScrollBar, TCursorImage). FPC 3.0.4 32 bits. (+heaptrc with leaked ClassName+Revisited TList) , Windows 10 Pro x64 (v. 1803)