Recent

Author Topic: [Solved] When "Code Folding" will be fully functional ?  (Read 2676 times)

jipété

  • Full Member
  • ***
  • Posts: 182
[Solved] When "Code Folding" will be fully functional ?
« on: August 16, 2023, 11:25:09 pm »
Hi !

Look :
I have a program with 812 lines of code, all folded (see img1), so I save the full project and I close it.
When I re-open the project, from line 0 to 71x everything is folded (img2), but starting at line 719 and 'till the EOF, nothing is folded (img3, the sequel to img2) !
And yet I checked all code folding options (img4).

With a unit of 2500 lines, it's a nightmare to re-fold manually everytime I re-open a unit like that.

I have lived with this inconvenience for 10 years or more...

Any idea when this sad behavior will be fixed ?
Thanks,

A last word : of course, a little project (only 1 procedure) doesn't have problem.
--
jp
System Debian Bullseye 11.7 64 bits / FPC 3.2.2 / Laz 2.2.6
« Last Edit: August 18, 2023, 09:44:07 am by jipété »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10665
  • Debugger - SynEdit - and more
    • wiki
Re: When "Code Folding" will be fully functional ?
« Reply #1 on: August 17, 2023, 12:23:38 am »
First of all, please test with3.0RC. I do remember having done some fixes at some time ago. I don't know if they were merged to 2.2.6.

Otherwise, the issue is really, that I need to be able to reproduce it. Otherwise I can't fix it. As you say, for some projects it works just fine.


jipété

  • Full Member
  • ***
  • Posts: 182
Re: When "Code Folding" will be fully functional ?
« Reply #2 on: August 17, 2023, 12:20:10 pm »
Hello,

thanks for the reply.

Spent the morning trying to install the Debian package and in the end it was impossible due to an incompatibility between the new .zst files and the old system (dpkg -i filename.deb) which was working fine for years.
Now, it's misery:
Code: Pascal  [Select][+][-]
  1. $ dpkg -i lazarus-project_3.0.0-0_amd64.deb
  2. error: archive « lazarus-project_3.0.0-0_amd64.deb » is using an unknown compression scheme for member  « control.tar.zst ». Abandonment.

Error all the more stupid as I installed the missing zstd tools, and they work fine in command line, so the problem is related to Debian, or to the one at Lazarus who changed a winning team by a rather unknown trick...

Dunno what to do.

So, try by yourself with a 1000-lines unit : fold all functions and procedures (like my img1), save the project, close the ide, re-open the project and look : all functions and proc still folded ? That's fine. Some no folded ? That's wrong.

Best regards,
--
jp

TRon

  • Hero Member
  • *****
  • Posts: 3778
Re: When "Code Folding" will be fully functional ?
« Reply #3 on: August 17, 2023, 12:30:55 pm »
Dunno what to do.
Weird, according to the report it is fixed (so your actions should have fixed your issue). Are you using plain debian or a descendant/variation ?

You could always build lazarus from source

edit: also found this gist (not tried myself)

fwiw: the build server was updated recently so most probably the os/package maker uses the compression scheme by default now.
« Last Edit: August 17, 2023, 12:45:37 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

jipété

  • Full Member
  • ***
  • Posts: 182
Re: When "Code Folding" will be fully functional ?
« Reply #4 on: August 17, 2023, 02:08:45 pm »
Well, where is my cap labeled "sys admin" ?   :D

fwiw: the build server was updated recently so most probably the os/package maker uses the compression scheme by default now.
Downloaded a new .deb, decompression problem still alive.

You could always build lazarus from source
Huh huh, some hours of work, due to broken dependancies and so on...

Weird, according to the report it is fixed (so your actions should have fixed your issue).
I don't understand what you mean. My "actions" are only one, "folding code", which doesn't stay folded after "Save project" and re-open project.

Are you using plain debian or a descendant/variation ?
Plain Debian Bullseye.

edit: also found this gist (not tried myself)
Interesting...
So I followed that way, everything went fine, but no way to start Lazarus3.0.
Starting again in console shows :
Code: Pascal  [Select][+][-]
  1. /usr/share/lazarus/3.0.0/startlazarus: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/share/lazarus/3.0.0/startlazarus)
and my glibc is 2.31 without nothing in Synaptic to allow upgrading.

End of run.

TRon

  • Hero Member
  • *****
  • Posts: 3778
Re: When "Code Folding" will be fully functional ?
« Reply #5 on: August 17, 2023, 02:32:37 pm »
Downloaded a new .deb, decompression problem still alive.
What I meant to say is that the buildserver from the FPC team that is used to build the .deb files has been updated recently. Meaning the issue you ran into is persistent and will (most probably) not be changed.

Quote
Huh huh, some hours of work, due to broken dependancies and so on...
Strange. Most dependencies are necessary to be able to build something with Lazarus to begin with. Basically you only need make, the sources can alternatively downloaded from sourceforge (so no need for git) or by doing a zip/tar/gz download from gitlab/github.

However, I am assuming you have a working FPC (v3.2.2) commandline compiler

Quote
I don't understand what you mean. My "actions" are only one, "folding code", which doesn't stay folded after "Save project" and re-open project.
I was referring to your efforts in trying to get the .deb file decompressed by installing zstd tools/updating dppkg  :)

Quote
Plain Debian Bullseye.
In that case that is strange that dppkg was not updated on/for your distro.

Quote
Starting again in console shows :
Code: Pascal  [Select][+][-]
  1. /usr/share/lazarus/3.0.0/startlazarus: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/share/lazarus/3.0.0/startlazarus)
and my glibc is 2.31 without nothing in Synaptic to allow upgrading.
Ah craps. I forgot about that. Yeah that is a known issue and does require you to build from source.

Can you share what dependencies are missing for you ? and is it a problem for you to add them ? That is, assuming you wish to proceed with building Lazarus from source. As said you are more or less required to do so if you would like to stay on bulls-eye (or wait for your distro maintainer(s) to update lazarus).
I do not have to remember anything anymore thanks to total-recall.

jipété

  • Full Member
  • ***
  • Posts: 182
Re: When "Code Folding" will be fully functional ?
« Reply #6 on: August 17, 2023, 02:51:35 pm »
However, I am assuming you have a working FPC (v3.2.2) commandline compiler
Yes yes, as said in 1st post, System Debian Bullseye 11.7 64 bits / FPC 3.2.2 / Laz 2.2.6

Quote
Starting again in console shows :
Code: Pascal  [Select][+][-]
  1. /usr/share/lazarus/3.0.0/startlazarus: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/share/lazarus/3.0.0/startlazarus)
and my glibc is 2.31 without nothing in Synaptic to allow upgrading.
Ah craps. I forgot about that. Yeah that is a known issue and does require you to build from source.

Can you share what dependencies are missing for you ? and is it a problem for you to add them ? That is, assuming you wish to proceed with building Lazarus from source. As said you are more or less required to do so if you would like to stay on bulls-eye (or wait for your distro maintainer(s) to update lazarus).
Well, it's too time consuming... After living with bad folding code from years, I can wait some monthes more.

Thanks to everybody,
--
jp

TRon

  • Hero Member
  • *****
  • Posts: 3778
Re: When "Code Folding" will be fully functional ?
« Reply #7 on: August 17, 2023, 03:00:07 pm »
Well, it's too time consuming...
Takes about 10-15 minutes.

in basics:
Code: [Select]
wget -c -O "current.tar.gz" "https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%203.0RC1/lazarus-3.0RC1-0.tar.gz/"
tar -xvzf "current.tar.gz"
pushd "lazarus"
make bigide FPC="/path/to/fpc"
make install INSTALL_PREFIX="/somewhere/temp_lazarus_install"
make bigide
popd

Quote
After living with bad folding code from years, I can wait some monthes more.
No problem.
I do not have to remember anything anymore thanks to total-recall.

jipété

  • Full Member
  • ***
  • Posts: 182
Re: When "Code Folding" will be fully functional ?
« Reply #8 on: August 17, 2023, 07:05:19 pm »
Hi !

coz' I'm curious, I've tried your 8 lines, like that (wget line omitted here) :
Code: Pascal  [Select][+][-]
  1. $ pushd "lazarus"
  2. ~/Desktop/4laz3.0/lazarus ~/Desktop/4laz3.0
  3.  
  4. $ make bigide FPC=/usr/lib/fpc/3.2.2
  5. make: /usr/lib/fpc/3.2.2: Permission non accordée
  6. Makefile:250: *** The Makefile doesn't support target -, please run fpcmake first. Arrêt.

Permission of folder is 755, so I try
Code: Pascal  [Select][+][-]
  1. $ fpcmake
  2. Processing Makefile.fpc
  3. Error: Target "linux", package "regexpr" not found

and I don't understand why :
Code: Pascal  [Select][+][-]
  1. $ locate regexpr -->
  2. /usr/lib/fpc/3.2.2/fpmkinst/x86_64-linux/regexpr.fpm
  3. /usr/lib/fpc/3.2.2/units/x86_64-linux/regexpr
  4. /usr/share/doc/fpc-3.2.2/regexpr
  5. /usr/share/fpcsrc/3.2.2/packages/regexpr
(40 similar lines omitted)

When I write "it's time consuming", I know what I write...  %)

EDIT :
If I try with double quotes :
Code: Pascal  [Select][+][-]
  1. $ make bigide FPC="/usr/lib/fpc/3.2.2"
  2. make: *** Aucune règle pour fabriquer la cible « bigide ». Arrêt.

After reading the README.md file found in the laz3.0, I try
Code: Pascal  [Select][+][-]
  1. $ make clean bigide
  2. make: *** Aucune règle pour fabriquer la cible « clean ». Arrêt.
Translation : No rules for crafting the "clean" target. Stop.
No luck...

"Time consuming", I've said,  :-\
« Last Edit: August 17, 2023, 07:33:21 pm by jipété »

TRon

  • Hero Member
  • *****
  • Posts: 3778
Re: When "Code Folding" will be fully functional ?
« Reply #9 on: August 17, 2023, 07:15:20 pm »
Hi !

Code: [Select]
$ make bigide FPC=/usr/lib/fpc/3.2.2
My bad. Apologies. The FPC variable should contain/include the executable name fpc (so probably for you: FPC=/usr/lib/fpc/3.2.2/x86_64-linux/bin/fpc ? or something to that extend. use "which fpc" from a terminal to return/get a full (correct) path and name )

All errors that follow from the erroneous make command FPC option are not relevant.

I should have written:
Code: [Select]
wget -c -O "current.tar.gz" "https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%203.0RC1/lazarus-3.0RC1-0.tar.gz"
tar -xvzf "current.tar.gz"
pushd "lazarus"
make bigide FPC="/path/and/name/to/your/executable/named/fpc"
make install INSTALL_PREFIX="/somewhere/temp_lazarus_install"
popd
Also note that I had "make bigide" twice there before (copy-paste mistake). Only one is required.


As alternative (to the make bigide FPC=... option) you can also use:
Code: [Select]
$ make bigide PP="/path/and/name/to/your/executable/named/ppcx64"
... which is bypassing an issue when "make bigide" with the FPC option is not working. It bypasses the fpc.cfg option to locate your ppc executable (in which case it is most probably configured wrongly)
« Last Edit: August 17, 2023, 07:44:38 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

jipété

  • Full Member
  • ***
  • Posts: 182
Re: When "Code Folding" will be fully functional ?
« Reply #10 on: August 17, 2023, 07:41:48 pm »
Well, entered the 4laz3.0/lazarus folder and ran here the make clean bigide command from the README.md, it works !

I'll continue tomorrow...

TRon

  • Hero Member
  • *****
  • Posts: 3778
Re: When "Code Folding" will be fully functional ?
« Reply #11 on: August 17, 2023, 07:48:46 pm »
Good luck and again apologies.

You was pessimistic and I did not wanted to add to that.

Building lazarus (when you have a good working fpc setup) is actually one of the easiest things to accomplish other then having the patience to see it build.

Before you go ahead and start lazarus, please read carefully https://wiki.freepascal.org/Multiple_Lazarus

Not starting the fresh compiled lazarus with the --pcp option could ruin your already existing (working) lazarus configuration.

I do not have to remember anything anymore thanks to total-recall.

jipété

  • Full Member
  • ***
  • Posts: 182
Re: When "Code Folding" will be fully functional ?
« Reply #12 on: August 17, 2023, 07:52:06 pm »
Not starting the fresh compiled lazarus with the --pcp option could ruin your already existing (working) lazarus configuration.
Not a problem, I test in virtual machines, so if something goes wrong, I simply retrieve the backup of the virtual disk and everything will be as yesterday,   :P  :D

I'll continue nothing tomorrow, the folding mechanism is still bugged...   :'(

so, my title is still usable :

When "Code Folding" will be fully functional ?

TRon

  • Hero Member
  • *****
  • Posts: 3778
Re: When "Code Folding" will be fully functional ?
« Reply #13 on: August 17, 2023, 08:34:26 pm »
Not a problem, I test in virtual machines, so if something goes wrong, I simply retrieve the backup of the virtual disk and everything will be as yesterday,   :P  :D
Ok, good. smart  :)

Quote
I'll continue nothing tomorrow, the folding mechanism is still bugged...   :'(
That is a bummer. Sorry to hear that.

fwiw: it is common to check against latest trunk/release(candidate) as some 'bugs' have a tendency to be solved automagically by addressing other issues.

Quote
so, my title is still usable :
For sure.

It is that I do not pay attention to how I left my folding when exiting a project otherwise I would have noticed. At least I am aware now so can take that into consideration and hopefully be able to reproduce.

In case there is a pattern that triggers it (certain order, use of keywords, amount of folds, amount of functions etc) that you can share then that would be appreciated but after so many years I don't believe you have found some form of pattern that triggers the faulty behaviour.

Thank you for trying !
I do not have to remember anything anymore thanks to total-recall.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10665
  • Debugger - SynEdit - and more
    • wiki
Re: When "Code Folding" will be fully functional ?
« Reply #14 on: August 17, 2023, 11:57:30 pm »
So, try by yourself with a 1000-lines unit : fold all functions and procedures (like my img1), save the project, close the ide, re-open the project and look : all functions and proc still folded ? That's fine. Some no folded ? That's wrong.

Done, works for me.

What I have done:

- Enabled folding for all keywords (any fold vs hide settings left to default)
- Open the project components\synedit\test\SynTest.lpi
- Go the file  components\synedit\synedit.pp  (10000 lines)
- Use Alt-Shift-1 to fold everything
- Since (with the given config) this folds unit, interface, ... too => unfolded unit, unfolded interface and implementation
- Now I can see a long list of folded procedures
- open another project
- open the SynTest.lpi again.
- File SynEdit is all folded, as it should be.


If you do those steps and some lines are not folded at the end => then the issue is likely fixed in 3.0.


 

TinyPortal © 2005-2018