Recent

Author Topic: Code Tools :Can't find end of file.  (Read 543 times)

jamie

  • Hero Member
  • *****
  • Posts: 1893
Code Tools :Can't find end of file.
« on: May 05, 2019, 11:26:26 pm »
Using 2.02.

 I just received a notice indicating it can't find the end of the file and points to a line for me to fix but there is
nothing wrong with it ..

 This happen after I decided to use the OI event tab to quickly get to the method body.

 No amount of what ever was fixing it.

 But there were no errors in the code cause I could compile and run the project..

 I fix it, I had to close the project and reopen it again.

 I am sure it will happen again...

 Anyone finding this issue?

lucamar

  • Hero Member
  • *****
  • Posts: 1982
Re: Code Tools :Can't find end of file.
« Reply #1 on: May 05, 2019, 11:32:31 pm »
Try a careful tracing of all the begin...end; pairs: one of them is unpaired, hiding the final end.

It happens a lot to me when converting multi-statement ifs to single-statement ones: I forget to delete either the begin or the end and BOOM! code-tools get lost  ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

jamie

  • Hero Member
  • *****
  • Posts: 1893
Re: Code Tools :Can't find end of file.
« Reply #2 on: May 05, 2019, 11:42:20 pm »
But I did say I compiled and ran just fine.

There was nothing wrong with the source code..

I closed the project, reopened it and it was fine afterwards.

All I did was go in to OI for a TmenuItem and check marked the AutoCheck, then I used the event tab
to quickly get to the OnClick event which was already working before and that is when it happen.

 There is something wrong with 2.0.2 . this never happen with earlier versions.


lucamar

  • Hero Member
  • *****
  • Posts: 1982
Re: Code Tools :Can't find end of file.
« Reply #3 on: May 05, 2019, 11:46:49 pm »
But I did say I compiled and ran just fine.

Oh, sorry. Don't know how I managed to miss that :-[
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5567
    • wiki

jamie

  • Hero Member
  • *****
  • Posts: 1893
Re: Code Tools :Can't find end of file.
« Reply #5 on: May 05, 2019, 11:56:24 pm »
I have also noticed now and then that Code tools autocomplete will just stop working.

Normally this happens If I have an actual error in the source and it starts to work again after I correct it.

But I did noticed that If you run Jedi code formater when code tools does this it starts working again.

I'll try running code formatter the next time this happens again to see if it corrects it without restarting the project..

 I didn't shut laz down, just reloaded the project this time for this situation but I also didn't run code formatter ether this
time..

 We'll see the next time.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5567
    • wiki
Re: Code Tools :Can't find end of file.
« Reply #6 on: May 06, 2019, 12:42:28 am »
You need to get codetool to rescan the unit. I am not an expert, but probably something like...

Edit at the start of the unit (unitname, or first unit in uses) and leave it changed (incorrect), then invoke "go to declaration" on the word you just edited. After that undo the change, and do "go to declaration" again.

Miguel.BR

  • Newbie
  • Posts: 1
Re: Code Tools :Can't find end of file.
« Reply #7 on: May 25, 2019, 09:44:28 am »
I solved this problem by full cleaning and recompiling Lazarus with Optimized IDE. For me the problem occurred after installing packages with repeated units with OPM. :)
« Last Edit: May 25, 2019, 09:54:22 am by Miguel.BR »

jamie

  • Hero Member
  • *****
  • Posts: 1893
Re: Code Tools :Can't find end of file.
« Reply #8 on: May 25, 2019, 09:52:37 pm »
I haven't seen this problem lately...Hmm..

All I have done recently was fix the "Tbitmap.LoadFromRawImage" and had a Windows Update to 1809 I think it was..

I did not recompile the IDE, it is as it was from the release of 2.0.2