[Lazarus] RFC : "Resolved View"

Michael Van Canneyt michael at freepascal.org
Fri Feb 12 15:25:11 CET 2016



On Fri, 12 Feb 2016, Mattias Gaertner wrote:

> On Fri, 12 Feb 2016 00:54:38 +0100 (CET)
> Michael Van Canneyt <michael at freepascal.org> wrote:
>
>> [...]
>> By this I mean a view of a unit as the compiler will see it:
>> - Correct include files included
>> - IFDefs properly resolved.
>>
>> The IDE groks include files and can already syntax highlight conditional code,
>> so the necessary mechanisms surely are in place.
>
> Yes, in fact the codetools create such a source as first step. It is
> called the "cleaned source". Skipped code is in special comments and
> there is a map to the original sources.
> So it is possible to show it in a read-only synedit. With a bit more
> work the view can support code navigation and code explorer.
> It would be more work to integrate such a view in the source editor.
> Especially editing would be complex.
> What should happen when the include file of the cursor is no longer in
> the unit?
> What about include files used twice in a unit?

Yes, that happens in the RTL as a kind of poor-mans generics.

>
>
>> This view can be read-only for all I care, can optionally have gutter markers
>> for 'special' locations (where includes occur or IFDEFS were observed).
>> Maybe gutter colors/folds to indicate includes, etc.
>> How this view is to be entered is also up for discussion.
>>
>> Just running an idea up the flagpole...
>>
>> If it's pure balderdash, feel free to say so.
>
> A read-only view is a good idea. Supporting editing might not be worth
> the trouble.

Indeed. In view of what can happen, I think read-only is the only viable
option.

>
> Maybe someone can implement a package adding a "unit explorer" - a
> window with pages for units, with code navigation and a light weight
> code explorer. Jumping between source editor and unit explorer could be done with menu items (and/or icons in the tool bar).
>
> Another idea is to show links to the include structure of the unit, for
> example on top of an include file or in the code explorer.

aaaahhhh; So many ideas, so little time....

Luckily we have a SuperMattias on board. Now to get that globe to spin
backwards... ;)

Michael.




More information about the Lazarus mailing list