Recent

Author Topic: [SOLVED] Suddenly IDE does not show hints  (Read 2249 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1436
[SOLVED] Suddenly IDE does not show hints
« on: August 15, 2024, 06:29:08 am »
For example, whey I type

         memo1.

then methods/properties that I can use should be shown, but not. currently

             template    ....
             template    ....

are displayed. Is this related with anything of options/project options?
« Last Edit: August 16, 2024, 07:44:43 am by egsuh »

Eugene Loza

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: Suddenly IDE does not show hints
« Reply #1 on: August 15, 2024, 09:16:04 am »
In my experience this happens when the code fails to compile (due to some error in the code or due to some FPC internal error). Try Run -> Clean up and Build. If that doesn't help try restarting Lazarus (also worked for me a couple of times).
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

WooBean

  • Sr. Member
  • ****
  • Posts: 268
Re: Suddenly IDE does not show hints
« Reply #2 on: August 15, 2024, 09:21:05 am »
I thought you were  joking, but it is a real trunk issue.

Try Project/New Project ...

Select project type "Application".

Write "Form1." and you will see:


Platforms: Win7/64, Linux Mint Ulyssa/64

Eugene Loza

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: Suddenly IDE does not show hints
« Reply #3 on: August 15, 2024, 09:25:51 am »
Write "Form1." and you will see:
And in messages it says: unit1.pas(25,1) Error: expected end., but Form1 found. This happens because the code fails to compile and therefore no meaningful autocompletion can be provided for this case. Fix the code (e.g. put call to Form1 in some procedure) and it'll work fine.
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

WooBean

  • Sr. Member
  • ****
  • Posts: 268
Re: Suddenly IDE does not show hints
« Reply #4 on: August 15, 2024, 09:31:43 am »
Am I not allowed to write "Form1."?

No joking, please.
Platforms: Win7/64, Linux Mint Ulyssa/64

dseligo

  • Hero Member
  • *****
  • Posts: 1345
Re: Suddenly IDE does not show hints
« Reply #5 on: August 15, 2024, 09:43:05 am »
Am I not allowed to write "Form1."?

No joking, please.

You are allowed, but in your example isn't compileable code (just as Eugene Loza suggested).
Try to write your example like this and see the difference:
Code: Pascal  [Select][+][-]
  1. procedure Test;
  2. begin
  3.   Form1.
  4. end;

n7800

  • Full Member
  • ***
  • Posts: 134
Re: Suddenly IDE does not show hints
« Reply #6 on: August 15, 2024, 12:12:27 pm »
The implementation section, like the interface section, is global. You can only create subsections with global type/const/var in it, as well as list procedures/methods.

That is, instead of this:

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. implementation
  6.  
  7. // anycode - ERROR
  8.  
  9. end.
  10.  

you just wanted to write this:

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. implementation
  6.  
  7.   procedure test;
  8.   begin
  9.     // any code - OK
  10.   end;
  11.  
  12. end.
  13.  

to call test procedure from somewhere. But if you want to write code in the unit itself, there is also an initialization section:

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. implementation
  6.  
  7. initialization
  8.   // any code - OK
  9. end.
  10.  

In general, do not confuse it with a "program" that does not have these sections. But it also specifies the code after the "global" begin (similar to initialization):

Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3.   procedure test;
  4.   begin
  5.     // any code - OK
  6.   end;
  7.  
  8. begin
  9.   // any code - OK
  10. end.
  11.  

But the author of the topic did not specify the full code of his program, so we can only guess that he has the same problem.

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Re: Suddenly IDE does not show hints
« Reply #7 on: August 16, 2024, 07:44:27 am »
My program compiled and ran without any errors.
I was talking about the "HINT" box which pops up when I type in ".".
Now it simply works... but I don't know why it didn't work. Thank you for your advices.

Eugene Loza

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: Suddenly IDE does not show hints
« Reply #8 on: August 16, 2024, 11:17:16 am »
but I don't know why it didn't work.
It seems to happen when there was some compilation error "in the past", but sometimes (rarely but happens)  CodeTools thinks that this error is still present and stays in "erroneous state". As I've mentioned above - trying to compile (especially "clean up and build" option which can also get rid of a lot of "internal errors") or restarting Lazarus often helps.
Hmmm... now that you mention it, I need to try to pay more attention to when exactly this bug happens and maybe find reproduction steps to make a bugreport.
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Zvoni

  • Hero Member
  • *****
  • Posts: 2635
Re: [SOLVED] Suddenly IDE does not show hints
« Reply #9 on: August 16, 2024, 11:33:07 am »
Most common reason (at least for me): I missed a closing ";" somewhere.

Otherwise, everything Eugene, dseligo and n7800 said
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018