delphiidedelphi-units

Open File at Cursor Does Not Open the File in the IDE


When I mouse over the UnitNames within the Uses clause a window pops up showing the UnitName Namespace. For example when I mouseover the SysUtils unit I see SysUtils Namspace in a popup window. If I right-click on SysUtils and choose Open File at Cursor the source code opens in the IDE.

If I right-click and choose Open File at Cursor on some of the other untis I am presented with an Open File dialog box.

How come all the units don't simply just open into the IDE?


Solution

  • This happens when the source (.pas) file isn't on the current Search or Browsing path.

    You can usually fix it by simply adding the unit to the project (right-click project in Project Manager, choose 'Add', navigate to the file, and double-click. This adds it to the .dpr file and makes it readily available to the IDE.

    You can also add it to the paths using Project->Options->Delphi Compiler->Search Path or Tools->Options->Environment Options->Delphi Options->Library->Browsing Path.