Menu ▾ ▴

#553 Source lookups outside the Identifiers tab ignore the IDE's browsing path

Closed
closed-fixed
nobody
None
5
3 hours ago
2026-10-16
No

The fix for bug [#552] lets the Identifiers tab of the Uses Clause Manager take a unit's source from the IDE's browsing path when only the unit's .dcu file is on the library path or the project's search path. That rule lives only in the parser thread behind that tab.

The shared lookups Ota.GetAllPossiblePaths, Ota.TryFindPathToFile, Ota.FindPathToFile and Ota.OpenFileFromPath in GX_OtaUtils.pas still search only the library path, the project's search path and the folders of the project, its units, the current file, the project group and the VCL source. For a unit whose source is only on the browsing path, as is common for components installed with only their .dcu files on the library path, the following therefore do not find the source:

  • Uses Clause Manager: "Open Unit" (TfmUsesManager.OpenUnit, Ota.OpenFileFromPath(UnitName + '.pas')).
  • Uses Clause Manager: the file name shown for the selected unit falls back to the .dcu file (Ota.TryFindPathToFile with '.pas', then '.dcu').
  • Project Dependencies: opening a unit by name (GX_ProjDepend.pas, Ota.OpenFileFromPath(UnitName + '.pas')).
  • Grep, searching the units listed in the project's map file (TGrepSearchRunner.GrepMapFile): its comment says it uses Ota.GetAllPossiblePaths because that also finds units that are in the library path only as .dcu files, but it does not search the browsing path either, so their source is not searched.

This list comes from reading the code. It has not been checked in the IDE.

The IDE itself looks for a unit's source on the browsing path when the source is not on the search path. A shared lookup that does the same (source on the search path first, then a source on the browsing path for a unit whose .dcu is on the search path) would fix all of these places at once, and the parser thread of the Identifiers tab could use it as well.

Related

Bugs: #552

Discussion

  • Thomas Mueller

    Thomas Mueller - 3 hours ago

    Fixed in revision [r6035].

    "Open Unit" and the file name of the selected unit in the Uses Clause Manager, the uses list on the editor toolbar and Grep with "Parse map file" now also look for a unit's source on the IDE's browsing path, after all other paths. Tested in Delphi 2007 and 13 with a unit whose .dcu file is on the library path and whose source is only on the browsing path.

    Found while working on this and filed separately:

    • [#567] Project Dependencies: the option "Search Library Path" never has any effect
    • [#568] Uses Clause Manager: access violation when the current module has no editor view
    • [#569] Ota.GetAllPossiblePaths does not return the folders in the order the compiler searches them
    • [#570] Project Dependencies: opening a unit ignores the options "Search Library Path" and "Also search Browsing Path"
    • [#571] Ota.TryFindPathToFile builds the whole list of folders again for every file it looks for
    • [#572] Grep: the map file search has its own copy of the file lookup
    • [#573] Grep: "All files in project group" with "Parse map file" uses the current project's map file for every project
     

    Related

    Bugs: #567
    Bugs: #568
    Bugs: #569
    Bugs: #570
    Bugs: #571
    Bugs: #572
    Bugs: #573
    Commit: [r6035]


    Last edit: Thomas Mueller 3 hours ago
  • Thomas Mueller

    Thomas Mueller - 3 hours ago
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -The fix for bug #552 lets the Identifiers tab of the Uses Clause Manager take a unit's source from the IDE's browsing path when only the unit's .dcu file is on the library path or the project's search path. That rule lives only in the parser thread behind that tab.
    +The fix for bug [#552] lets the Identifiers tab of the Uses Clause Manager take a unit's source from the IDE's browsing path when only the unit's .dcu file is on the library path or the project's search path. That rule lives only in the parser thread behind that tab.
    
     The shared lookups `Ota.GetAllPossiblePaths`, `Ota.TryFindPathToFile`, `Ota.FindPathToFile` and `Ota.OpenFileFromPath` in `GX_OtaUtils.pas` still search only the library path, the project's search path and the folders of the project, its units, the current file, the project group and the VCL source. For a unit whose source is only on the browsing path, as is common for components installed with only their .dcu files on the library path, the following therefore do not find the source:
    
    • Priority: --> 5
     

    Related

    Bugs: #552


Log in to post a comment.