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.
Mailing lists / lazarus / 2009-04
Notes on 'remove unused units' codetool
4 messages · 3 people · –
- AAlexander Klenin 2
- LLee Jenkins 1
- MMattias Gaertner 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
Mattias Gaertner wroteFixed. 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
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 Klenin wrote 6 lines
I think Mattias was referring to the the Lazarus IDE ;)
