Recent

Author Topic: Laz 2.0.11 fixes-weird codecompletion with inc-files  (Read 778 times)

Zvoni

  • Hero Member
  • *****
  • Posts: 2319
Laz 2.0.11 fixes-weird codecompletion with inc-files
« on: October 20, 2020, 04:55:25 pm »
Hi Folks,
not sure if i'm correct here.

Laz2.0.11-Rev 63876M - FPC3.2.1 on Manjaro 64-Bit

Working on a project i noticed something weird:

Add a unit and save it to the project.
Add another unit, delete everything (!) from it and save it as an inc-file ("somecode.inc").
Now, in the first unit, include the inc-file via Directive
{$I somecode.inc}
Save everything
switch back to the inc-file, and start writing a Function/Procedure
Code: [Select]
Procedure Dummy;
Begin
The moment i hit Enter after writing "Begin" i (and everyone else) expects an "end;" to appear.
It doesn't, as long as you're in the last line of code (meaning: No code further down).
But, the "end;" DOES appear, in the "main" file which includes the inc-file, and there it's appended to the end of the Include-Directive!

Can someone confirm?
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

Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: Laz 2.0.11 fixes-weird codecompletion with inc-files
« Reply #1 on: October 20, 2020, 05:00:41 pm »
Tested on Lazarus 2.0.10 Linux GTK2.
I can reproduce the issue.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Laz 2.0.11 fixes-weird codecompletion with inc-files
« Reply #2 on: October 20, 2020, 09:14:34 pm »
There is a bug report about it from 7 years ago by Bart :
 https://bugs.freepascal.org/view.php?id=24950
Somebody should fix it.
It is assigned to Mattias but patches from anybody are welcome.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Zvoni

  • Hero Member
  • *****
  • Posts: 2319
Re: Laz 2.0.11 fixes-weird codecompletion with inc-files
« Reply #3 on: October 20, 2020, 10:00:39 pm »
Ouch! Sorry, didn't see that.
Not really an Issue, just annoying.

I helped myself by inserting a Dummy-Procedure at the end, and just coding above it, and pushing the dummy-procedure downwards.
Code: [Select]
Procedure Dummy;
Begin
End;
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