View Issue Details

IDProjectCategoryView StatusLast Update
0035289LazarusIDEpublic2019-09-15 09:27
ReporterDejan BorasAssigned ToMattias Gaertner 
PrioritynormalSeverityminorReproducibilityrandom
Status assignedResolutionopen 
Platformx86_64-win64OSWindowsOS Version10
Product Version2.0Product Build 
Target VersionFixed in Version 
Summary0035289: Get "end of source not found" message on identifier completion
DescriptionSometime, when trying to complete an identifier (ctrl+space) a "end of source not found" error message is thrown which seems related to codetools.
Steps To ReproduceNo discernible pattern was observed that leads to being able to reproduce this.
Additional InformationClosing and reopening Lazarus helps resolve the issue.
This occurs also on other platforms (fedora 29) even though the platform I've set is the one I use the most currently.
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetWin32/Win64
Attached Files

Activities

Serge Anvarov

2019-03-29 13:09

reporter   ~0115103

Confirm. (Window 7, x86_64). In version 2.0.0 happens, but it is difficult to reproduce.
Steps to reproduce the bug in version 2.1.0 (rev 60763):
1. Create a new project (application)
2. Double-click the form (to create the FormCreate method)
3. Above FormCreate write any function, for example:
[code]
function Test: string;
begin
  Result := '';
end;
[/code]
4. Go back to the FormCreate method, write "Cap" and press Ctrl + space

If you add "uses" (example "uses Types;") to the beginning of the implementation section, the error disappears. But sometimes it does not help.

Maciej Izak

2019-04-03 22:12

developer   ~0115203

I was able to reproduce with IDE recompiled with "Normal IDE" profile. Almost is impossible to work with larger project ("end of source not found" occurs very often in different and hard to reproduce situations).

Probably important but maybe coincidence: I was also not able to reproduce problem with "Debug IDE" profile.

Maybe is something wrong with AVL tree? This make sense for me why restarting Lazarus is the solution... btw. Probably 0028439 is related.

Mattias Gaertner

2019-04-03 22:23

manager   ~0115204

What makes you think it has to with AVL tree?

When it the next time occurs, please test the following:
Add a space between unit keyword and unitname. Press Shift+Ctrl+Down. Undo the space. Then do again whatever you did.

Maciej Izak

2019-04-03 23:32

developer   ~0115208

Last edited: 2019-04-04 10:02

View 2 revisions

The non generic version of AVL tree was my initial base for implementation of rtl-generics versions of TAVLTree<T>/TAVLTreeMap<TKey,TValue> but deletion of nodes sometimes was proper and sometimes not (at some point tree was broken), so I dropped the initial implementation where my base was/is used in Lazarus AVL tree and I started my own from scratch.

I was trying to reproduce situation for bug report - without success, so I guess maybe my mistake, but may be worth to do some extensive test.

Maciej Izak

2019-04-04 09:12

developer   ~0115221

The delete operation from Lazarus/FPC non-generic AVL tree seems non standard and too much simplified:

https://github.com/newpascal/lazarus/blob/573d7bf2776c0491a143e428ef3fc92ff703a3b1/components/lazutils/laz_avl_tree.pp#L658-L702

vs

https://github.com/maciej-izak/generics.collections/blob/0123474ab51c8db800b14f546fa870ffe608c30d/src/generics.collections.pas#L3197-L3306

especially I mean part for "if (ANode.Left <> nil) and (ANode.Right <> nil) then"

Also the delete operation from AVL tree is not often used in Lazarus but occurs in code tools which seems like good point to check. Anyway I don't have proof that something is wrong :\.

antispam88

2019-04-29 22:37

reporter   ~0115904

Hi,
are there any updates about that issue?
Regarding the message https://forum.lazarus.freepascal.org/index.php/topic,45062.msg318964.html#msg318964 this topic is not that rare.
Best regards,
antispam88

Macfly

2019-06-15 02:20

reporter   ~0116728

This error often occurs to me.

In addition to this other: Ctrl Space jumping to other parts of the code.

They occur when there is no uses in implementation section.

The workaround is to create a empty class just to place a uses in implementation.

unit myunit;

interface

uses
 blabla;

implementation

uses <--- Without this uses then editor get lost
 my_dummy_unit;

Jonas Maebe

2019-06-15 11:20

manager   ~0116732

This may have been caused by 0035632

Bloodbatgot

2019-06-20 23:07

reporter   ~0116810

Seems to be fixed by the fix to 0035632.

Issue History

Date Modified Username Field Change
2019-03-27 13:52 Dejan Boras New Issue
2019-03-27 15:08 Mattias Gaertner Assigned To => Mattias Gaertner
2019-03-27 15:08 Mattias Gaertner Status new => assigned
2019-03-29 13:09 Serge Anvarov Note Added: 0115103
2019-04-03 22:12 Maciej Izak Note Added: 0115203
2019-04-03 22:23 Mattias Gaertner Note Added: 0115204
2019-04-03 23:32 Maciej Izak Note Added: 0115208
2019-04-04 09:12 Maciej Izak Note Added: 0115221
2019-04-04 10:02 Maciej Izak Note Edited: 0115208 View Revisions
2019-04-29 22:37 antispam88 Note Added: 0115904
2019-06-15 02:20 Macfly Note Added: 0116728
2019-06-15 11:20 Jonas Maebe Note Added: 0116732
2019-06-20 23:07 Bloodbatgot Note Added: 0116810