cnpack / cnwizards

CnPack IDE Wizards
http://www.cnpack.org
582 stars 141 forks source link

How to open units from library path? #143

Open delmohf opened 3 years ago

delmohf commented 3 years ago

When I set some library paths on RAD Studio:

image

all the units will be listed on "Use Unit":

image

BUT they don't on "Unit List"

image

So... is there a way to open units from path library directly?

shanzhashu commented 3 years ago

Menu Item: “CnPack” -> "Coding Toolset' -> "Open File" Enter the file name or partly, click OK, CnPack will search them in All Path and list the results for opening. (If Only one result, directly open it)

delmohf commented 3 years ago

Great!.... but why not place this functionality on "Unit List" dialog too so that there is a unified interface (and shortcut) to open units? You can then make a distinction between project and external units if you want but IMHO the most important point is to have a common way to open units.

shanzhashu commented 3 years ago

Because our "Unit List" feature is used to replace the original "Unit List" in IDE itself. I consider to also place "Open File" button in "Unit List" Dialog Toolbar.

delmohf commented 3 years ago

Did you mean keeping the same output and behavior as Rad Studio? My apologize if I'm missing something but I don't see what is the issue mixing project units with external units based on what the user type in. For external units you could use the external unit path instead of a project name. The user will be aware of the unit's origin looking to the project column but you can also distinguish between them using a different color if you want highlight such difference.

Anyway, I think it should be nice just press Ctrl+F12 (Unit List shortcut), type in any unit name partially and press enter to open it regardless of it's a project unit or external one.

the-Arioch commented 8 months ago

Because our "Unit List" feature

I guess you could enhance that window by adding a button or menu "Add Existing Unit To The Project" command.

But i agree the general behavior "on FormOpen" should stay as it is.

the-Arioch commented 8 months ago

what is the issue mixing project units with external units based on what the user type in

exactly THAT would be awful

knowing my project and the set of libs it (and not random OTHER unrelated projects) uses i can often key in just 3-4 letters to narrow the search span to the single or at most half-dozen units that i intended to open.

it would kill the purpose if instead of my one or two units i would have to manually sieve through a dozen of unrelated files just because they happenned to lie around on my disk for OTHER projects.

You want a fast search through all libraries on your disk? That is a useful workflow too, just it is a different one. And, there already is a tool for it: the Everything utility and Windows plugins.

PS C:\> winget search everything
Имя                                           ИД                           Версия      Совпадение              Источник
-----------------------------------------------------------------------------------------------------------------------
     ---deleted unrelated results---
Everything                                    voidtools.Everything         1.4.1.1024  ProductCode: everything winget
Everything                                    voidtools.Everything.Cli     1.1.0.26                            winget
EverythingToolbar                             stnkl.EverythingToolbar.Beta 0.8.0.1     Tag: everything         winget
EverythingToolbar                             stnkl.EverythingToolbar      1.3.2       Tag: everything         winget
EverythingPowerToys                           lin-ycv.EverythingPowerToys  0.78.0      Tag: everything         winget
Everything Lite                               voidtools.Everything.Lite    1.4.1.1024                          winget
Everything (Alpha)                            voidtools.Everything.Alpha   1.5.0.1371a                         winget
PS C:\>