I’d like to suggest a small comment enhancement in the IDE

I’d like to suggest a small comment enhancement in the IDE

if I start a comment with //– or //== or //__ – the Editor should embellish as below.  Perhaps the same for /// comments too?

30 thoughts on “I’d like to suggest a small comment enhancement in the IDE

  1. Use AutoHotkey. I have one command that writes a separator line:


    I just added double hyphen and double equal:



    Easy as pi.

  2. If you could adjust the background color of comment lines, that could serve the same purpose 🙂

    Oh, and those TTimeSpan.Create comments remind me of this: https://pbs.twimg.com/media/BwdzWrBIcAA4M3d.jpg

    TTimeSpan has plenty of alternate “constructors”, but nobody ever seems to use them, probably because they’re not easily discoverable as they start with “From”. A “CreateFromMinutes” f.i. could have been more discoverable (ie. listed by ctrl+space alongside the other constructors)

  3. I remember ,a long time ago , an expert that did just that and more.

    You could have added all kind of TEXT to the editor , as comments , begin end and more.

    Any one remember ? it was up to D6 i think. May be eve D4  

  4. Regions help me organize my code (which is the purpose here as I understand). I don’t need stupid  80 char —– comments or right aligned comments or similar as some people seem to like.

  5. I use regions to collapse documentation, or to collapse code – but they are cumbersome to write for one-liners.

    I don’t want run on sentences to the right either – but a few words would be good.  Adjusted to the right, they would be much quicker to browse than when interspersed with the regular code.

  6. Lars Fosdal I am not sure what you want to do with the suggested enhancement?

    If you want a line between methods, CnPack has an enhancement that draws a line between methods within the IDE

  7. Lars Fosdal : I’m assuming you want to get to something like what Lazarus IDE does (since 2006) – horizontal lines that divide your code (classes, methods, nested methods etc). Lazarus IDE does this for you, and you can configure the level of detail you want, various colours per level etc. And it does it automatically, without you needing to pollute the code with useless comments.  http://wiki.freepascal.org/New_IDE_features_since#divider_lines_in_editor

  8. Graeme Geldenhuys I do NOT want this for dividing code. Regions work excellently for that.  I want it to have visual reminders of key locations in the code – so that I can quickly find them when I need them. I have no interest in Lazarus as it is unusable for the projects that I work on.

  9. Lars Fosdal Then why not simply use the TODO comments – which (if I remember from my D7 days) appears automatically in the TODO dialog. You can assign categories etc too them too. They are easy to find, supports multiple locations in various units, summarised in one convenient dialog, and is persistent between loading projects or restarting the IDE.

    You seem to want to reinvent the wheel, but forgot about functionality that exists already in the ide.

  10. The todos we already use for things that need to be done.  These labels are not things to be done – but code locations to be aware of – sort of like an important hint or bookmark – but embedded in the code.  That said – I wouldn’t mind if the TODO also was better highlighted in the code.

    I want a better wheel.