[Lazarus] Find declaration bug?

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Sep 30 19:51:34 CEST 2012


On Sun, 30 Sep 2012 20:32:21 +0300
patspiper <patspiper at gmail.com> wrote:

> On 30/09/12 20:09, Mattias Gaertner wrote:
> > On Sun, 30 Sep 2012 12:16:51 +0300
> > patspiper <patspiper at gmail.com> wrote:
> >
> >> [...]
> >>> This feature allows to explore code for non installed target platforms.
> >>> Maybe this can be made optional.
> >> The feature is handy indeed. One question arises though: If the unit is
> >> different for several other target platforms, which one would be opened?
> >>
> >> I can see the following possibilities:
> >> - Keep it as it is
> >> - Make it an optional setting
> >> - Find Declaration looks for units only in the path while Open File at
> >> Cursor opens the unit even if it is not in the path
> > That means almost all codetools won't work because of "unit not found".
> Maybe I chose the wrong terminology. By path I meant files/folders 
> usable/accessible for a certain target. For example the serial unit is 
> in <folder>/rtl/unix and will not be reachable for win32 targets. Find 
> Declaration will fail with unit not found whereas Open File at Cursor 
> will open it.

Yes, I understood right. Many codetools will cease to work.


> >> - Find Declaration presents a list of targets for which this unit exists
> >> for the user to choose from (if it does not exist for the current target)
> > I guess there is no FPC devel that knows that for all sources.
> It could be a list of paths instead.
> 
> Anyway, IMHO the logical choice is for Find Declaration to fail when 
> looking for serial.pp for win32, and allow Open File at Cursor to open 
> it. In case Open File at Cursor finds several paths leading to the same 
> file, it could present a list of these for the user to choose.

Sometimes it helps to switch from the simple example of one unit to the
more complex example of having a project that uses indirectly many
units.


Mattias




More information about the Lazarus mailing list