Recent

Author Topic: "Demo" project size for possible bug(s)  (Read 3943 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 16196
  • Censorship about opinions does not belong here.
Re: "Demo" project size for possible bug(s)
« Reply #15 on: May 19, 2024, 10:33:40 am »
I think it is both {$include} and not handling all keywords. KOL hardly uses, but sporadiccaly, uses static.
The problem with KOL is that only two or three people know the code inside out, one of which is no longer strongly involved and it is even in my opinion has become a behamoth. It is good to test the issue, though. Even the Delphi people have it as a parser test  :o O:-) :) :)
Atm it is withholding the new release a bit. (apart from my laziness)
« Last Edit: May 19, 2024, 10:44:22 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: "Demo" project size for possible bug(s)
« Reply #16 on: May 19, 2024, 11:11:17 am »
Ok, lots to read up


1) your problem is not what I meant to describe.
Your problem is codetool mistakes the static.

You can reproduce your issue with this code
Code: Pascal  [Select][+][-]
  1. program Project1;
  2. var
  3.   a: (a1,a2);
  4.   static: integer;
  5.  
  6. procedure foo;
  7. begin
  8.   b:=1; // try to create declaration for b // ctrl-shift-c
  9. end;
  10.  
  11. begin
  12.   foo;
  13. end.
  14.  


To workaround, change your declaration of static to "&static" (note, that disables the hint, on that word, but on other occurrences of static the hint should still work)

2) My described issue.
Sometimes you have code that codetool initially is ok with. And then at some time it reports an error, even so the code has not changed. And my workaround for that does not need to compile, but to invoke codetools on the intentional error.

3) the blank editor.

Any chance you used (from the "file" menu): "Close all" before restarting the IDE?

"Close all" only closes the editors. Your project is still open. And the project session will then save with all editors closed. So you need to open unit by unit again.

I just looked, and that menu entry has been removed now (in 3.99).
There is "Close project" in the project menu.

440bx

  • Hero Member
  • *****
  • Posts: 4744
Re: "Demo" project size for possible bug(s)
« Reply #17 on: May 19, 2024, 11:29:39 am »
1) your problem is not what I meant to describe.
Your problem is codetool mistakes the static.
Correct.  For some reason codetools doesn't like "static" when preceded by an enumeration.

You can reproduce your issue with this code
Code: Pascal  [Select][+][-]
  1. program Project1;
  2. var
  3.   a: (a1,a2);
  4.   static: integer;
  5.  
  6. procedure foo;
  7. begin
  8.   b:=1; // try to create declaration for b // ctrl-shift-c
  9. end;
  10.  
  11. begin
  12.   foo;
  13. end.
  14.  
Yes, I see that.  I used that previous project because of its similarity with the larger project just in case there was something else that made a difference.  Your test code is definitely a better showcase of the problem.

To workaround, change your declaration of static to "&static" (note, that disables the hint, on that word, but on other occurrences of static the hint should still work)
I figured that part.  I find it extremely interesting that prefixing "static" with "&" solves the problem for codetools because in that context it shouldn't make any difference (static is not a keyword in that context, therefore the presence of an "&" there should not make any difference.) but, it's a nice and simple workaround. 


3) the blank editor.

Any chance you used (from the "file" menu): "Close all" before restarting the IDE?
No but, it is possible I may have used "Close All Other Pages".  I'm not sure I did but,  I use that option somewhat often therefore I may have used it.  I'm not sure one way or the other.  What I'm sure of is that I did not perform any action that would justify getting a blank editor window, IOW, I am sure I did not close all editing windows (that could not go unnoticed.)  Fortunately, this is not a real problem since it is not present in v3.99, therefore, for practical purposes, it's already fixed.


(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

440bx

  • Hero Member
  • *****
  • Posts: 4744
Re: "Demo" project size for possible bug(s)
« Reply #18 on: May 19, 2024, 02:26:40 pm »
This is probably a dumb question but, just to be on the safe side...

Should this be reported as a bug ?  if yes, I'll gladly create the bug report and suggestion(s) for the title/bug description are definitely welcome.

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: "Demo" project size for possible bug(s)
« Reply #19 on: May 19, 2024, 03:03:01 pm »
Yes, it should, please.

440bx

  • Hero Member
  • *****
  • Posts: 4744
Re: "Demo" project size for possible bug(s)
« Reply #20 on: May 19, 2024, 04:06:42 pm »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018