Super Simple Documentation in Delphi
Super Simple Documentation in Delphi
Save the pastebin document as xmld_XMLDoc_Summary.xml in
XE..XE5 - RAD Studio\code_templates\Delphi
XE6... - Embarcadero\Studio\code_templates\Delphi
... or wherever your standard Delphi directory is.
Create a blank line above a class method or property in the interface declaration, then type xmld and fill in the blanks. If you need more than one line, add a line break and /// at the beginning of next line.
protected
/// Current log line number being
/// processed
property LogLineNo: Integer read FLogLineNo write FLogLineNo;
Now, hover your cursor over the method or property anywhere in your code and read what you just filled in ;)
Yes - you can add a lot more XML doc attributes - but for the bare minimum - this is pretty quick and easy. You can of course change the magic xmld keyword to anything you prefer as well.
http://pastebin.com/BAEUYEST
Save the pastebin document as xmld_XMLDoc_Summary.xml in
XE..XE5 - RAD Studio\code_templates\Delphi
XE6... - Embarcadero\Studio\code_templates\Delphi
... or wherever your standard Delphi directory is.
Create a blank line above a class method or property in the interface declaration, then type xmld
protected
///
/// processed
property LogLineNo: Integer read FLogLineNo write FLogLineNo;
Now, hover your cursor over the method or property anywhere in your code and read what you just filled in ;)
Yes - you can add a lot more XML doc attributes - but for the bare minimum - this is pretty quick and easy. You can of course change the magic xmld keyword to anything you prefer as well.
http://pastebin.com/BAEUYEST
Or just use DocumentationInsight :)
ReplyDeleteStefan Glienke - Indeed, as DI allows for proper full-blown xmldoc. However - it seems that a lite version of DI no longer is installed by default in XE6 and XE7?
ReplyDeleteAFAIK, there is a quite similar template included with Delphi named "summary". Although it seems to have invoke set to "manual".
ReplyDeleteUwe Raabe - I should consult you before I even post! :) I hadn't noticed that one before.
ReplyDeleteOne difference is that mine originally was designed for one-line shorties.
Lars Fosdal One small correction: the Embarcadero\Studio folder is since XE6 and not XE7
ReplyDeleteThanks. Corrected the post.
ReplyDeleteLars Fosdal I didn't mean to diminish your solution - just mention an existing alternative. Regarding the consulting: you are always welcome.
ReplyDeleteUwe Raabe - Nor did I feel that you did - I am just at awe of your level of knowledge :)
ReplyDeleteOh, and Thanks!
Unfortunately, I turn off IDE completion due all the distraction it brings along with writing ifs and fors. A hotkey like Ctrl-Shift-C would be nice. Am I missing how to set the hotkey for this completion.
ReplyDeleteIlya S You can turn off autocomplete in which case no longer expands the template. Instead you would press to expand the template. Not sure if that is an improvement. Depends on your typing style I guess.
ReplyDeleteThanks Lars Fosdal! I'll try it.
ReplyDeleteBtw, does Ctrl-D Ctrl-Chift-D work in XE6-XE7 if DocInsight is not installed? I could test myself, but have it installed. If it doesn't work it sounds like a valid FR, doesn't it?
Ilya S - Ctrl-Shift-D does nothing if DocInsight is not installed.
ReplyDeleteApparently Ctrl-Shift-D doesn't work if DocInsight ia absent. Your suggestion Lars Fosdal to use Tab for completion suits my needs, thanks!
ReplyDeleteBTW - Marco CantĆ¹ - Are you aware that the XML Schema referenced in the template.xml files, no longer exists?
ReplyDeletehttp://schemas.borland.com/Delphi/2005/codetemplates"
version="1.0.0">
I really miss DI Express in XE6 :( But I guess I can get used to these templates, thanks for the tip :)
ReplyDelete