[Lazarus] RFC : "Resolved View"

Michael Van Canneyt michael at freepascal.org
Fri Feb 12 13:45:14 CET 2016



On Fri, 12 Feb 2016, Martin Frb wrote:

> On 11/02/2016 23:54, Michael Van Canneyt wrote:
>> 
>> 
>> By this I mean a view of a unit as the compiler will see it:
>> - Correct include files included
>
> This has been long on the list. But still no in the doing.
>
> Ignoring:
> - any high/low-light or other markup to indicate the fact that the text comes 
> from a different file
> - probably also ignoring line numbering
>
> this should actually be relatively easy.

Aha, so there is hope :)

>
> There are already "views" wrapped around the textbuffer. All that it needs is 
> to wrap another view around it, that combines 2 real textbuffers.
>
> This could even be editable. Except it needs to prevent joining lines accross 
> file bound.

And ask what to do if you delete all lines from an include: remove the
include directive or the file.

>
> There is work on the IDE side (outside SynEdit) to ensure it knows the file 
> is open. Could be resolved by pretending it is open in its own editor (which 
> is simply hidden)

So, this part is in fact pretty realistic ?

Well, if it is on the todo list, I don't need to file a feature request ;)

>
>> - IFDefs properly resolved. 
> lowlight exists.
>
> Actual hiding is more work, because it needs to shift x positions in some 
> line. Probably needs big changes. Though readonly may be doable.

Hmh. I would think that preprocessing the text would be an easier approach
here, no ?

I think for the second feature, read-only (as pointed out by Giuliano Colla) is 
the only viable option, because there are too many border cases. 
In that case preprocessing is an option.

Still, I suspect that Anthony Walter's original problem would be largely
solved by handling the includes (so simply 'Inclusive view' :) )

Michael.




More information about the Lazarus mailing list