[Lazarus] Bug on CodeTools to find unit using in `../path/unit.pas`

Marcos Douglas B. Santos md at delfire.net
Sat Dec 8 17:15:20 CET 2018


Hi,
I'm playing around with units to include them in a "different" way in a
test program. I realized that there are some issues only on Lazarus IDE
code-completion — no error to compile.

Inside the folder of the project, I've added a new unit in `msg` folder:
`msg/msg.pas`.

If I use this unit on lpr using `in`, like this:
===begin===
program1;
uses
  {...},
  `msg in 'msg/msg.pas'`;
===end===

...I have no issues to compile.
Pay attention that I haven't put `msg` folder on Search Path.

Inside on `msg` unit I have a code for testing:
function MakeString: string;

If uses that unit in any units on that program and try to code-complete
"MakeS*" (Ctrl+SPACE) I got "Error: unit not found: msg" from CodeTools.

Lazarus 1.9.0 r58537 FPC 3.1.1 i386-win32-win32/win64

You can argue that I just need to include the path on Search Path but,
please, don't. I want to use something like "dynamic paths".

Continuing the test, if I use that unit as `msg in 'msg/msg.pas' on the
other units, I got no error from CodeTools:
===begin===
unit Unit1;
// a unit that has a Form, for example
uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
  msg in 'msg/msg.pas';
===end===

Which tells us that CodeTools knows how to read the "in 'path/unit'", but
only if it was declared on the same unit that is using it.

So, I can use the path on all units but as the compiler knows how to
compile if I just put one declaration on the lpr, using the same
indentifier `msg` in all program, I believe the IDE should know how to read
this too.

Am I right?

Best regards,
Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181208/19e394d5/attachment.html>


More information about the Lazarus mailing list