I'd like to suggest a small comment enhancement in the IDE
Get link
Facebook
X
Pinterest
Email
Other Apps
-
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?
Use AutoHotkey. I have one command that writes a separator line: (*____________________________________________________________________________*) I just added double hyphen and double equal: //-----------------------------------------------------------------------// //=========================================================================// Easy as pi.
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)
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
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.
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.
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.
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
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
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.
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.
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.
That's so C++. :-)
ReplyDeleteThat's so easily readable as you scroll down as well :)
ReplyDeleteThis is good idea
ReplyDeleteUse AutoHotkey. I have one command that writes a separator line:
ReplyDelete(*____________________________________________________________________________*)
I just added double hyphen and double equal:
//-----------------------------------------------------------------------//
//=========================================================================//
Easy as pi.
Dan Statham Except I don't want the extra text - just the visual render.
ReplyDeleteIf you could adjust the background color of comment lines, that could serve the same purpose :)
ReplyDeleteOh, 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)
I remember ,a long time ago , an expert that did just that and more.
ReplyDeleteYou 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
Eric Grange You can change the text and background colors of comments in the IDE color settings, under Editor Options.
ReplyDeleteIt would be very easy to write a plugin that did this...
ReplyDeleteRegions FTW
ReplyDeleteLars Fosdal Next you'll want it to print, too.
ReplyDeleteI haven't printed code since, well, PCL3?
ReplyDeleteStefan Glienke What would regions do here?
ReplyDeleteNeither Regions nor color will shift the text to the right margin.
ReplyDeleteRegions 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.
ReplyDeleteI use regions to collapse documentation, or to collapse code - but they are cumbersome to write for one-liners.
ReplyDeleteI 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.
Javier Hernández It's 2015. Why would I want to use a regular text editor? And FYI Notepad++ understands regions.
ReplyDeleteI miss Delphi... it's too expensive :-(
ReplyDeleteCésar Arévalo Have you tried AppMethod? It's free or a cheap monthly subscription, depending what you use.
ReplyDeleteJavier Hernández What about the free version of AppMethod, vs free VS Community?
ReplyDeleteIt's not the same, I agree - but it is on a level where it can compete.
David Millington I haven't but I will check it! :-) thanks for the info!
ReplyDeleteLars Fosdal I am not sure what you want to do with the suggested enhancement?
ReplyDeleteIf you want a line between methods, CnPack has an enhancement that draws a line between methods within the IDE
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.
ReplyDeleteSmart Mobile Studio supports (* ), //, / */ and {}
ReplyDeleteLars 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
ReplyDeleteVery good idea
ReplyDeleteGraeme 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.
ReplyDeleteLars 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.
ReplyDeleteYou seem to want to reinvent the wheel, but forgot about functionality that exists already in the ide.
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.
ReplyDeleteI want a better wheel.
You want that then write a plugin on your own that takes advantage of the new #10Seattle INTAEditViewNotifier interface.
ReplyDelete