Recent

Author Topic: codetools error  (Read 3754 times)

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
codetools error
« on: December 10, 2018, 09:33:15 am »
Hello Lazarus team,

Some of my projects giving codetools error about end of source but also compiler is compiling.
After restart of Lazarus it is working normally but if I use to look my function's detail by CTRL+SHIFT+SPACE it is jumping to one of my function.

What can be problem?

Additional info:

If I tidy of my code by CTRL+D it is working normally again.


Lazarus 2.1.0 r59769M FPC 3.3.1 x86_64-win64-win32/win64
« Last Edit: December 10, 2018, 09:38:57 am by tr_escape »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: codetools error
« Reply #1 on: December 10, 2018, 09:52:26 am »
If I tidy of my code by CTRL+D it is working normally again.
That is strange. Usually Codetools can handle whitespace and other formatting correctly.
Can you reproduce it systematically? Please upload a minimal demo unit or project.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: codetools error
« Reply #2 on: December 10, 2018, 10:33:00 am »
Hello Lazarus team,

Some of my projects giving codetools error about end of source but also compiler is compiling.
After restart of Lazarus it is working normally but if I use to look my function's detail by CTRL+SHIFT+SPACE it is jumping to one of my function.

What can be problem?

Additional info:

If I tidy of my code by CTRL+D it is working normally again.


Lazarus 2.1.0 r59769M FPC 3.3.1 x86_64-win64-win32/win64

You need to rebuild FPC code cache in Lazarus. Go and click on Tools->Rescan FPC Source Directory  menu item.

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: codetools error
« Reply #3 on: December 10, 2018, 11:21:41 am »
If I tidy of my code by CTRL+D it is working normally again.
That is strange. Usually Codetools can handle whitespace and other formatting correctly.
Can you reproduce it systematically? Please upload a minimal demo unit or project.

Actually I copied same functions from my original project as empty and autocreated by IDE.
I added a button on the form and I wrote only :

var
  a,b,c:

When I press the CRTL+SHIFT+Space it gave me :

unit1.pas(42,4) Error: End of source not found.

message.

I also tried to scan fpc sources but not worked.

Note: This edition downloaded by fpcupdeluxe. I have got another edition of lazarus "Lazarus 2.0.0RC2 r59373 FPC 3.0.4 i386-win32-win32/win64" it is working correctly.

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     procedure Button1Click(Sender: TObject);
  17.   private
  18.  
  19.   public
  20.  
  21.     procedure SaveIniPwd(section,ident,valstr:String);
  22.     function LoadIniPwd(section,ident,defstr:String):String;
  23.     function CheckIniUsr(section:String):Boolean;
  24.  
  25.     function checkUser(var usr: Integer; var pwd: String): Integer;
  26.  
  27.   end;
  28.  
  29. var
  30.   Form1: TForm1;
  31.  
  32. implementation
  33.  
  34. {$R *.lfm}
  35.  
  36. { TForm1 }
  37.  
  38. procedure TForm1.Button1Click(Sender: TObject);
  39. begin
  40.   //
  41.  
  42. end;
  43.  
  44. procedure TForm1.SaveIniPwd(section, ident, valstr: String);
  45. var
  46.   a,b,c:
  47. begin
  48.   //
  49.  
  50. end;
  51.  
  52. function TForm1.LoadIniPwd(section, ident, defstr: String): String;
  53. begin
  54.   //
  55. end;
  56.  
  57. function TForm1.CheckIniUsr(section: String): Boolean;
  58. begin
  59.   //
  60. end;
  61.  
  62. function TForm1.checkUser(var usr: Integer; var pwd: String): Integer;
  63. begin
  64.   //
  65. end;
  66.  
  67.  
  68.  
  69. end.
  70.  



JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: codetools error
« Reply #4 on: December 11, 2018, 01:47:46 am »
I cannot reproduce. I only get
 
Code: [Select]
unit1.pas(47,1) Error: identifier expected, but begin foundwhich is correct.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: codetools error
« Reply #5 on: December 11, 2018, 06:23:23 am »
I cannot reproduce. I only get
 
Code: [Select]
unit1.pas(47,1) Error: identifier expected, but begin foundwhich is correct.

It is strange I added same project in the attach as project1.zip.

So I can produce same conditons order by:

1-
I removed that Integer defination from the code as:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.SaveIniPwd(section, ident, valstr: String);
  2. var
  3.   a,b,c : Integer;
  4. begin
  5.  
  6.  

2-

Code: Pascal  [Select][+][-]
  1. procedure TForm1.SaveIniPwd(section, ident, valstr: String);
  2. var
  3.   a,b,c :
  4. begin
  5.  

3-

I pressed the CTRL+SPACE only and it is happening.


but if there is no any space between a,b,c and colon ( : )  it is working normally.

Like as:
Code: Pascal  [Select][+][-]
  1. ..
  2. var
  3.   a,b,c:Integer;
  4. ...





 

TinyPortal © 2005-2018