Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-10

Request feature?

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

silvioprog

Hello,

Currently, Lazarus IDE set gray color in all units that will not be compiled (see picture in attached), but, it just works with DEFINEs.

Seems nice apply gray color in all units that will not be compiled even if it is not declared in a DEFINE block.

This feature is present in some popular IDEs like Android Studio, Eclipse etc.

Thank you! =)

Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141002/01eb7b8c/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: noncomp.png Type: image/png Size: 46743 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141002/01eb7b8c/attachment-0001.png>

Reply by email

Mattias Gaertner
to silvioprog
Show quoted text 7 lines
Hello, Currently, Lazarus IDE set gray color in all units that will not be compiled (see picture in attached), but, it just works with DEFINEs. Seems nice apply gray color in all units that will not be compiled even if it is not declared in a DEFINE block.

Do you mean, the IDE should show whole units gray, when they do not belong to the project?

This feature is present in some popular IDEs like Android Studio, Eclipse etc.

Mattias

Reply by email

silvioprog
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
On Thu, 2 Oct 2014 17:53:06 -0300 silvioprog wrote: > Hello, > > Currently, Lazarus IDE set gray color in all units that will not be > compiled (see picture in attached), but, it just works with DEFINEs. > > Seems nice apply gray color in all units that will not be compiled even if > it is not declared in a DEFINE block. Do you mean, the IDE should show whole units gray, when they do not belong to the project?

[...]

Oops, no no, sorry hehe... to the unused units. E.g:

program Project1;
{$mode objfpc}{$H+}
uses
  sysutils, // normal
  contnrs, // gray
  fgl; // gray
begin
  WriteLn(IntToStr(10));end.

SysUtils - used - normal; contnrs/fgl - unused - so, gray.

See attached picture, it shows this feature in Android Studio. =)

Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141002/aec4b99c/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: adgrey.png Type: image/png Size: 63762 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141002/aec4b99c/attachment-0001.png>

Reply by email

Mattias Gaertner
to silvioprog
Show quoted text 16 lines
[...] Oops, no no, sorry hehe... to the unused units. E.g: program Project1; {$mode objfpc}{$H+} uses sysutils, // normal contnrs, // gray fgl; // gray begin WriteLn(IntToStr(10));end. SysUtils - used - normal; contnrs/fgl - unused - so, gray. See attached picture, it shows this feature in Android Studio. =)

I see.
When you compile in Lazarus, the units are underlined. There is also a hint icon, which you can click to remove the unit.

Mattias

Reply by email

silvioprog
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Thu, 2 Oct 2014 18:36:38 -0300 silvioprog wrote: >[...] > Oops, no no, sorry hehe... to the unused units. E.g: > > program Project1; > {$mode objfpc}{$H+} > uses > sysutils, // normal > contnrs, // gray > fgl; // gray > begin > WriteLn(IntToStr(10));end. > > > SysUtils - used - normal; contnrs/fgl - unused - so, gray. > > See attached picture, it shows this feature in Android Studio. =) I see. When you compile in Lazarus, the units are underlined. There is also a hint icon, which you can click to remove the unit. Mattias

Awesome!

I'm using Lazarus 1.2.4. Is this feature available in Lazarus from trunk?

Silvio Cl?cio My public projects - github.com/silvioprog -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141002/e810ba1a/attachment.html>

Reply by email

Mattias Gaertner
to silvioprog
Show quoted text 5 lines
[...] > When you compile in Lazarus, the units are underlined. > There is also a hint icon, which you can click to remove the unit. Awesome!

:)

I'm using Lazarus 1.2.4. Is this feature available in Lazarus from trunk?

Yes.
Of course the hints generated by the compiler are shown in 1.2.4 already - in the Messages window.

Mattias

Reply by email

Martin Frb
to silvioprog: On Thu, Oct 2, 2014 at 6:48 PM, Mattias Gaertner Awesome! I'm using Lazarus 1.2.4. Is…
silvioprog wrote 34 lines
On Thu, Oct 2, 2014 at 6:48 PM, Mattias Gaertner < <mailto:>> wrote: On Thu, 2 Oct 2014 18:36:38 -0300 silvioprog < <mailto:>> wrote: >[...] > Oops, no no, sorry hehe... to the unused units. E.g: > > program Project1; > {$mode objfpc}{$H+} > uses > sysutils, // normal > contnrs, // gray > fgl; // gray > begin > WriteLn(IntToStr(10));end. > > > SysUtils - used - normal; contnrs/fgl - unused - so, gray. > > See attached picture, it shows this feature in Android Studio. =) I see. When you compile in Lazarus, the units are underlined. There is also a hint icon, which you can click to remove the unit. Mattias Awesome! I'm using Lazarus 1.2.4. Is this feature available in Lazarus from trunk?

There is also an entry in "Refactoring" (pop up, or Menu: Source)

"Unused Units" (Though (iirc) it in only 99% accurate) -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141002/6a497e9c/attachment.html>

Reply by email

Juha Manninen
to Martin Frb
Martin Frb wrote
There is also an entry in "Refactoring" (pop up, or Menu: Source) "Unused Units" (Though (iirc) it in only 99% accurate)

It is not accurate when a unit has an initialization section. Then the unit is most likely needed by the project but it is reported as "unused".
I guess it is difficult to analyse the real "used" status then.

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Show quoted text 7 lines
On Fri, Oct 3, 2014 at 1:24 AM, Martin Frb wrote: > There is also an entry in "Refactoring" (pop up, or Menu: Source) > "Unused Units" (Though (iirc) it in only 99% accurate) It is not accurate when a unit has an initialization section. Then the unit is most likely needed by the project but it is reported as "unused".

The units with initialization/finalization sections are shown with a battery like icon, while those without are shown with a book icon.

Feel free to improve it with a checkbox "hide units with initialization/finalization sections".

I guess it is difficult to analyse the real "used" status then.

What Martin means with 99% is the following:
If two units provides an identifier with the same name, the tool does not check which identifier is used and treat both units as used.

Mattias

Reply by email