View Issue Details

IDProjectCategoryView StatusLast Update
0015770LazarusIDEpublic2013-08-15 19:54
ReporterBurkhard CarstensAssigned ToMartin Friebe 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version1.2.0Fixed in Version1.1 (SVN) 
Summary0015770: Display "inactive" code differently in source editor
DescriptionIt would be nice, if "inactive" code could be highlighted (or better lowlighted) in source editor:

{$DEFINE Use_Foo}

{$IFDEF Use_Foo}
  // Active code, so normal textcolors for this
  foo;
{$ELSE}
  // Inactive code, so grayed background or such for this
  non_foo;
{$ENDIF}
TagsNo tags attached.
Fixed in Revision41608
LazTarget1.2
Widgetset
Attached Files

Activities

Graeme Geldenhuys

2010-02-15 10:57

reporter   ~0034488

That would be very nice. Obviously the IDE would have to parse the Compiler > Other tab for project global defines defined via -dXXXX too.


Alternatively, the {%region} feature could be extended so that the "auto fold" function (eg: {%region 'auto hide me' -fold} ) could be tied into compiler defines as well. I'm not sure what syntax could be used though.

// this will be folded by default - current syntax and behaviour
{%region 'Auto-generated GUI code' -fold}
...
{%endregion}


... maybe something like this...

// this will be folded if 'Use_Foo' has been defined
{%region 'Auto hide if not appropriate' -ifdef=Use_Foo}
...
{%endregion}


I'm not sure which implementation will be less effort though. "low lighting" or {%region}

Burkhard Carstens

2010-02-15 13:43

reporter   ~0034493

Graeme, your "alternative" feature is somehow related but a different thing. It wouldn't help me with my cases. So please create a separate feature request for that instead of turning mine into a different one. Thanks.

Graeme Geldenhuys

2010-02-15 14:05

reporter   ~0034494

No problem. I thought they would be related. Just like you want to semi-hide the inactive code from a IFDEF..ELSE, I thought the {%region} feature could auto-hide that inactive code for you. Maybe I miss understood what you wanted, in that case, ignore my comments.
Actually, it could be related. The highlighter would need an event for asking a custom HighlighterAttribute/range (properties) so that the SourceEditor can change them based on the CodeTools. This event could also be used for the folding (if codefolding is still coupled with the higlighter as it used to be, that is...).

Martin Friebe

2010-03-11 01:09

manager   ~0035219

CodeFolding (or at least part of it) is based in the highlighter, since highlighting and folding require the same info about the text-structure, and this is parsed in the highlighter.

Low-Lighting based on codetools, doesn't require the same structural info (well it does, but it's provided by the more powerfull codetools, taking include files and all that into account).

Low-Lighting would have to go into a wrapper. That way it can be avoided that IDE specific code ends up in the more generic parts of SynEdit. The wrapper would be created in SourceEditor, and applied to the SynEdit.

Burkhard Carstens

2013-08-15 19:54

reporter   ~0069401

Awesome! Thank you very much!

Issue History

Date Modified Username Field Change
2010-02-15 10:16 Burkhard Carstens New Issue
2010-02-15 10:57 Graeme Geldenhuys Note Added: 0034488
2010-02-15 13:43 Burkhard Carstens Note Added: 0034493
2010-02-15 14:05 Graeme Geldenhuys Note Added: 0034494
2010-03-10 13:23 Martin Friebe LazTarget => post 1.2
2010-03-10 13:23 Martin Friebe Status new => confirmed
2010-03-10 23:47 Flávio Etrusco (notifications not working) Note Added: 0035214
2010-03-11 01:09 Martin Friebe Note Added: 0035219
2013-05-16 11:59 Martin Friebe Assigned To => Martin Friebe
2013-05-16 11:59 Martin Friebe Status confirmed => assigned
2013-06-09 01:06 Martin Friebe Fixed in Revision => 41608
2013-06-09 01:06 Martin Friebe LazTarget post 1.2 => 1.2
2013-06-09 01:06 Martin Friebe Status assigned => resolved
2013-06-09 01:06 Martin Friebe Fixed in Version => 1.1 (SVN)
2013-06-09 01:06 Martin Friebe Resolution open => fixed
2013-06-09 01:06 Martin Friebe Target Version => 1.2.0
2013-08-15 19:54 Burkhard Carstens Note Added: 0069401
2013-08-15 19:54 Burkhard Carstens Status resolved => closed