Recent

Author Topic: Unreliable IDE behaviors  (Read 503 times)

backprop

  • Jr. Member
  • **
  • Posts: 93
Unreliable IDE behaviors
« on: September 08, 2024, 02:31:11 am »
1. Create new application
2. Put one TButton on the form
3. Press F2 and change the name of it to btnStart and text to Start

Error will popup. After that, every click on the button to create a code will result with error that creating method is not possible.

Trying further to delete button will result with endless AVs.

Reopen project and try to do anything with - nothing is possible, just various errors popup

Lazarus 3.2, FPC 3.2.2 installed from DEB files. KDE neon
« Last Edit: September 08, 2024, 02:45:12 am by backprop »

Aruna

  • Sr. Member
  • ****
  • Posts: 462
Re: Unreliable IDE behaviors
« Reply #1 on: September 08, 2024, 03:44:51 am »
1. Create new application
2. Put one TButton on the form
3. Press F2 and change the name of it to btnStart and text to Start

Error will popup. After that, every click on the button to create a code will result with error that creating method is not possible.

Trying further to delete button will result with endless AVs.

Reopen project and try to do anything with - nothing is possible, just various errors popup

Lazarus 3.2, FPC 3.2.2 installed from DEB files. KDE neon
Hi @backprop if you can't interact with the button, try recreating it:

Remove the Button:
Open the form in the designer and try to remove the problematic button. If you get an AV (Access Violation), you might need to manually remove the button from the .pas and .lfm files.

Add a New Button:
After removing the problematic button, add a new TButton to the form. Make sure to use the Object Inspector to set properties correctly.

Try to Clean and Rebuild the Project. Sometimes, residual files can cause issues.
Clean Project: Use Project -> Clean Up to remove any intermediate files.
Rebuild Project: Rebuild the project using Project -> Build All.

If the problem persists and is specific to the current project:
Create a New Project: Start a new project and see if you can replicate the problem. This helps to determine if the issue is with the project or the Lazarus installation.
Copy Code: If the new project works fine, copy over your existing code from the problematic project to the new project piece by piece to identify where the issue lies.

please have a look here
« Last Edit: September 08, 2024, 06:56:22 am by Aruna »
Debian GNU/Linux 11 (bullseye)
https://pascal.chat/

backprop

  • Jr. Member
  • **
  • Posts: 93
Re: Unreliable IDE behaviors
« Reply #2 on: September 08, 2024, 10:16:20 am »
Using object inspector creates all necessary code correctly, but not with F2. It need to be fixed.


wp

  • Hero Member
  • *****
  • Posts: 12368
Re: Unreliable IDE behaviors
« Reply #3 on: September 08, 2024, 11:01:43 am »
1. Create new application
2. Put one TButton on the form
3. Press F2 and change the name of it to btnStart and text to Start

Error will popup.  After that, every click on the button to create a code will result with error that creating method is not possible.
Cannot confirm this. I am on Windows, though, but I cannot imagine that there is a difference between Windows and Linux here.

I see the error that a method cannot be created usually when I was coding something, but did not complete and left the code syntactically incorrect, and added another component or renamed a component. Please check your code. After step 2 in your instructions do not do anything else, just press F2.

dbannon

  • Hero Member
  • *****
  • Posts: 3098
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Unreliable IDE behaviors
« Reply #4 on: September 08, 2024, 11:08:08 am »
 backprop, it might just be worthwhile testing to see if you have this problem with another distro.

I used to have Neon on my list of (VM) distros to test my app with but I found so many non-reproducible (on another distro) problems I stopped testing with it. Debian Trixie has a KDE version available if you must have the newest but does appear to be more stable in my limited experience.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

WooBean

  • Sr. Member
  • ****
  • Posts: 271
Re: Unreliable IDE behaviors
« Reply #5 on: September 08, 2024, 11:33:38 am »
Not jumping too deeply into details - Lazarus code has some "// TODO: "(s) and operations on .lfm files during renaming identifiers are signaled in this way.

It can be done quite quickly as (seems to me)  there are only two kinds of identifiers involved in manipulation inside .lfm files - ctnVarDefinition and ctnProcedureHead.

If an identifier's node decription is ctnVarDefinition so the renamed identifier can be an object name (like "Button1").

If an identifier's node decription is ctnProcedureHead so the renamed identifier can be an event signature name (like "Button1Click").

Manipulation inside .lfm file won't be much complicated as it is only replacing some substrings of .lfm file content (old identifier name) with a new identifier name string.

Some prefixes and sufixes must be checked also.

Edited - now I think that all type definition must be taken into account.
 


           
« Last Edit: September 08, 2024, 11:59:05 am by WooBean »
Platforms: Win7/64, Linux Mint Ulyssa/64

dseligo

  • Hero Member
  • *****
  • Posts: 1374
Re: Unreliable IDE behaviors
« Reply #6 on: September 08, 2024, 12:25:46 pm »
Using object inspector creates all necessary code correctly, but not with F2. It need to be fixed.

Not jumping too deeply into details - Lazarus code has some "// TODO: "(s) and operations on .lfm files during renaming identifiers are signaled in this way.

Yes, there was similar discussion recently.
They are already open bug reports on this issue, I posted them here: https://forum.lazarus.freepascal.org/index.php/topic,68386.msg528497.html#msg528497

backprop

  • Jr. Member
  • **
  • Posts: 93
Re: Unreliable IDE behaviors
« Reply #7 on: September 08, 2024, 01:30:57 pm »
Further, I had a problem to  copy and paste group of components to other panel.

It just mixing up all methods between etc. But I need to make test case which always fail. It seems it lost track of all in some point with all these renumbering ...

I have used Neon for a long long time. It was one of the most reliable distro with Ryzen, but recently I have noticed some moderate problems with, particularly when they upgraded Plasma...

To be honest, I do not know what to use anymore.
« Last Edit: September 08, 2024, 01:36:23 pm by backprop »

 

TinyPortal © 2005-2018