Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-06

How to disable "auto comment"?

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd
to silvioprog

2012/6/7 silvioprog :

If you don't disable them completely there is a way to make their existence at least a bit more useful: If you remove the empty line between the comment and the class declaration you can add documentation right after the class name (do not remove the class name):

{TSomeThing represents a something and maintains a list of TWhatEver objects. It is responsible for doing foo and bar} TSomeThing = class()
...
end;

Then it will display the contents of the comment in the mouse over hints when you hover the mouse over any occurrence of TSomeThing in your code. Lazarus will not touch the comment anymore or move it away or change it as long as you leave the class name as the first word of the comment.

Apart from that I also don't see any use for these auto generated comments. Especially the ones between the method implementations serve absolutely no useful purpose. For quickly finding the implementations there is either Ctrl+Shift+Up/Down or the code explorer.

Reply by email

silvioprog
to Bernd

2012/6/6 Bernd :

Show quoted text 26 lines
2012/6/7 silvioprog : >> http://imagebin.org/215427 If you don't disable them completely there is a way to make their existence at least a bit more useful: If you remove the empty line between the comment and the class declaration you can add documentation right after the class name (do not remove the class name): {TSomeThing represents a something and maintains a list of TWhatEver objects. It is responsible for doing foo and bar} TSomeThing = class() ? ... end; Then it will display the contents of the comment in the mouse over hints when you hover the mouse over any occurrence of TSomeThing in your code. Lazarus will not touch the comment ?anymore or move it away or change it as long as you leave the class name as the first word of the comment. Apart from that I also don't see any use for these auto generated comments. Especially the ones between the method implementations serve absolutely no useful purpose. For quickly finding the implementations there is either Ctrl+Shift+Up/Down or the code explorer.

Good tip, thx. :)

Another options would be interesting:

[x] Create public variables for forms.
[x] Create <b>public</b> session.
[x] Create <b>private</b> session.

Then, with: "[ ] Create public variables for forms.", "[ ] Create <b>public</b> session." and "[ ] Create <b>private</b> session.", the result is:

unit Unit1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
type
  TForm1 = class(TForm)
  end;
implementation
{$R *.lfm}
end.

A cleaner code. :)

Silvio Cl?cio My public projects - github.com/silvioprog

Reply by email