Lazarus

Using the Lazarus IDE => Editor => Topic started by: CCRDude on October 06, 2017, 11:19:35 pm

Title: Latest trunk and issues with unit filenames with dots in them?
Post by: CCRDude on October 06, 2017, 11:19:35 pm
I'm updating my Lazarus from the trunk once or twice a week.

The main projects I work with have dots in their filenames, like "ProjectName.UI.Forms.Main.pas".

About two weeks ago (I might try to pick the exact release if necessary later), the IDE changed it's behaviour. In many files, when I press Ctrl+Shift+Up and +Down to navigate, or try to auto-complete a variable, it jumps to the "unit" line at the top and complains that it would expect "end." instead of the word following the first dot.

This is not always happening, otherwise I would have created a simple test file (tried a few times, but could not reproduce in test projects so far, but in all working projects). Adding another blank line after the final "end." of the unit often helps, unless there's an initialization part with $IFDEF inside, for example, and similar strange patterns.

Has, in the trunk, anything changed regarding future support of namespaces for example, that would now disallow dots in unitnames?
Title: Re: Latest trunk and issues with unit filenames with dots in them?
Post by: JuhaManninen on October 07, 2017, 12:36:23 am
Mattias made such changes at least in r55944, r55946, r55948 and 55951.
You could test which one broke the parsing of your code.
The bug should be reproducible before it can be fixed. I hope you find steps to do it.
Title: Re: Latest trunk and issues with unit filenames with dots in them?
Post by: CCRDude on October 07, 2017, 08:09:21 pm
Thanks a lot for identifying interesting commits! I find the problem even in 55944. Here are exact details:

Message: "Project5.UI.Frame.VPN.pas(1,18) Error: expected end., but Frame found"
Marked code line: "unit Project5.UI.Frame.VPN;"

I stripped down the unit to a minimum. It's also attached in a zip file in case it's a byte-specific thing (e.g. the last line break seems to play a role).

Code: Pascal  [Select][+][-]
  1. unit Project5.UI.Frame.VPN;
  2.  
  3. interface
  4.  
  5. type
  6.    TFrameProject5VPN = class(TProject5Frame)
  7.    public
  8.       class function ShowsWheel: boolean; override;
  9.    end;
  10.  
  11. implementation
  12.  
  13. class function TFrameProject5VPN.ShowsWheel: boolean;
  14. begin
  15.    Result := True;
  16. end;
  17.  
  18. initialization
  19.    AddProject5FrameClass(TFrameProject5VPN);
  20. end.

Here are my steps to reproduce the issue:


I can write a Mantis ticket as well, but maybe someone can confirm this isn't something odd on my system only?
Title: Re: Latest trunk and issues with unit filenames with dots in them?
Post by: JuhaManninen on October 08, 2017, 12:51:45 am
I tested with your project. I cannot reproduce the problem. Jumping in the code and parsing works well here.
Try building Lazarus clean. It usually solves problems.
If not, then you could try to bisect the guilty revision:
 http://wiki.freepascal.org/How_do_I_create_a_bug_report#Regression_caused_by_a_certain_revision

Could OS have an effect? I am testing on Linux.
Title: Re: Latest trunk and issues with unit filenames with dots in them?
Post by: CCRDude on October 10, 2017, 12:04:08 pm
Just using "Clean all" when building Lazarus didn't help, I tried that along with checking for any svn conflicts.
But I made another attempt at fpcupdeluxe into a fresh folder yesterday, and it seems to no longer appear in that completely fresh installation.
Sorry for reporting without having tried that first :) And thanks for pointing me into the right direction!
TinyPortal © 2005-2018