Sign in Join

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

Mailing lists / lazarus / 2009-04

Notes on 'remove unused units' codetool

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Alexander Klenin

I tried a new 'remove unused units' refactoring, and in general I like it. A few nits:
1) Tree nodes should not be editable.
2) After removing first unit in the uses clause, the extraneous space is left before the next unit name.
3) A 'select all' button would probably be useful
4) Icons used are strange. I think standard 'unit' icon should be used instead of current one.
'Implementation' icon is good, but 'Interface' icon is totally unrecognizable for me.
5) I think this should be a project-wide feature, not unit-wide. I am not sure how hard it is
to implement, but I see two interface variants:
5a) (Preferably) A common tree of all units in project, with subtrees for each unit.
5b) A combobox to select a unit, with a tree for the unit selected.

Alexander S. Klenin

Reply by email

Mattias Gaertner
to Alexander Klenin
I tried a new 'remove unused units' refactoring, and in general I like it. A few nits: 1) Tree nodes should not be editable.

Fixed.

2) After removing first unit in the uses clause, the extraneous space is left before the next unit name.

Fixed.

3) A 'select all' button would probably be useful

Added.

4) Icons used are strange. I think standard 'unit' icon should be used instead of current one. 'Implementation' icon is good, but 'Interface' icon is totally unrecognizable for me.

Same icons as in the code explorer. Make a proposal.

5) I think this should be a project-wide feature, not unit-wide.

Beware: The algorithm does not check recursively (e.g. the inherited initialization sections) and the .lpr file contains a lot of 'unused' units. For example the thread manager, the memory manager or the 'interfaces' unit of the LCL.
If someone uses this dialog and simply removes all 'unused' he will make his program unrunnable.

I am not sure how hard it is to implement,

I know a good IDE.

but I see two interface variants: 5a) (Preferably) A common tree of all units in project, with subtrees for each unit.

Sounds like the unit dependencies window.

5b) A combobox to select a unit, with a tree for the unit selected.

Mattias

Reply by email

Alexander Klenin
to Mattias Gaertner
Mattias Gaertner wrote
Fixed. Fixed. Added.

Thanks.

> 4) Icons used are strange. I think standard 'unit' icon should be used > instead of current one. Same icons as in the code explorer. Make a proposal.

Hm... I proposed to use 'images/codeexplorer/ce_unit.png' which AFAIU is from code explorer.

Show quoted text 8 lines
> 5) I think this should be a project-wide feature, not unit-wide. Beware: The algorithm does not check recursively (e.g. the inherited initialization sections) and the .lpr file contains a lot of 'unused' units. For example the thread manager, the memory manager or the 'interfaces' unit of the LCL. If someone uses this dialog and simply removes all 'unused' he will make his program unrunnable.

Well, perhaps do not show units used by .lpr as unused then?

> I am not sure how hard it is to implement, I know a good IDE.

I do not understand. What IDE?

> ? 5a) (Preferably) A common tree of all units in project, with > subtrees for each unit. Sounds like the unit dependencies window.

Yes, I think joining both into a single interface is a sensible idea. Anyway, to show I am not just whining:
http://bugs.freepascal.org/view.php?id=13501
;-)

Alexander S. Klenin

Reply by email

Lee Jenkins
to Alexander Klenin
Alexander Klenin wrote 6 lines
On Sun, Apr 12, 2009 at 16:26, Mattias Gaertner wrote: >> I am not sure how hard it is to implement, > I know a good IDE. I do not understand. What IDE?

I think Mattias was referring to the the Lazarus IDE ;)

Warm Regards, Lee

Reply by email