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?

Comments

  1. That's so easily readable as you scroll down as well :)

    ReplyDelete
  2. Use AutoHotkey. I have one command that writes a separator line:
    (*____________________________________________________________________________*)
    I just added double hyphen and double equal:
    //-----------------------------------------------------------------------//
    //=========================================================================//
    Easy as pi.

    ReplyDelete
  3. Dan Statham Except I don't want the extra text - just the visual render.

    ReplyDelete
  4. 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)

    ReplyDelete
  5. 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

    ReplyDelete
  6. Eric Grange You can change the text and background colors of comments in the IDE color settings, under Editor Options.

    ReplyDelete
  7. It would be very easy to write a plugin that did this...

    ReplyDelete
  8. Lars Fosdal Next you'll want it to print, too.

    ReplyDelete
  9. I haven't printed code since, well, PCL3?

    ReplyDelete
  10. Stefan Glienke What would regions do here?

    ReplyDelete
  11. Neither Regions nor color will shift the text to the right margin.

    ReplyDelete
  12. 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.

    ReplyDelete
  13. 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.

    ReplyDelete
  14. Javier Hernández It's 2015. Why would I want to use a regular text editor? And FYI Notepad++ understands regions.

    ReplyDelete
  15. I miss Delphi... it's too expensive :-(

    ReplyDelete
  16. César Arévalo Have you tried AppMethod?  It's free or a cheap monthly subscription, depending what you use.

    ReplyDelete
  17. Javier Hernández What about the free version of AppMethod, vs free VS Community?
    It's not the same, I agree - but it is on a level where it can compete.

    ReplyDelete
  18. David Millington I haven't but I will check it! :-) thanks for the info!

    ReplyDelete
  19. 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

    ReplyDelete
  20. Nicholas Ring I just want it to work like I described, so that I can get a clue adjusted to the right margin, wherever I want it.

    ReplyDelete
  21. Smart Mobile Studio supports (* ), //, / */ and {}

    ReplyDelete
  22. 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

    ReplyDelete
  23. 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.

    ReplyDelete
  24. 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.

    ReplyDelete
  25. 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.

    ReplyDelete
  26. You want that then write a plugin on your own that takes advantage of the new #10Seattle INTAEditViewNotifier interface.

    ReplyDelete

Post a Comment