Lazarus

Programming => General => Topic started by: jamie on May 05, 2019, 11:26:26 pm

Title: Code Tools :Can't find end of file.
Post by: jamie 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?
Title: Re: Code Tools :Can't find end of file.
Post by: lucamar 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  ;)
Title: Re: Code Tools :Can't find end of file.
Post by: jamie 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.

Title: Re: Code Tools :Can't find end of file.
Post by: lucamar 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 :-[
Title: Re: Code Tools :Can't find end of file.
Post by: Martin_fr on May 05, 2019, 11:50:37 pm
https://bugs.freepascal.org/view.php?id=35289
Title: Re: Code Tools :Can't find end of file.
Post by: jamie 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.
Title: Re: Code Tools :Can't find end of file.
Post by: Martin_fr 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.
Title: Re: Code Tools :Can't find end of file.
Post by: Mig.BR 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. :)
Title: Re: Code Tools :Can't find end of file.
Post by: jamie 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
TinyPortal © 2005-2018