Sign in Join

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

Mailing lists / fpc-devel / 2010-08

fpdoc has incomplete type definitions in the documentation output

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

When generating HTML class documentation, the Class definition displayed is not the same as the actual class definition in the code. The definition in the HTML docs show:

type
  TfpgBaseButton = class(TfpgWidget)

when in fact the real code in the .pas unit is:

type
  TfpgBaseButton = class(TfpgWidget, ICommandHolder)

I mentioned in a 'feature request' that it would be nice if the class documentation can list the implemented interfaces (something like JavaDoc does). That would be nice, but even if we can start by including the "real" class definition in the documentation output, that would be good too.

I found more such problems (not relating to Interfaces too). For example, I have a record that is marked as 'deprecated' in the pas unit. But the HTML type definition of that record doesn't show the 'deprecated' keyword. eg: HTML output.

type
TRGBTriple = record
  Red: Word;
  Green: Word;
  Blue: Word;
  Alpha: Word;
end;

but the real code in the .pas unit is as follows:

  TRGBTriple = record
    Red: word;
    Green: word;
    Blue: word;
    Alpha: word;
  end deprecated;

Note the HTML output is missing the 'deprecated' keyword. Same as the missing implemented Interface in my button example. Another example is a property with the 'platform' modifier. The definition shown in the fpdoc class documentation doesn't include the 'platform' modifier in the code example.

Is all this by design, or simply an oversight/bug in the fpdoc program?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 50 lines
Hi, When generating HTML class documentation, the Class definition displayed is not the same as the actual class definition in the code. The definition in the HTML docs show: type TfpgBaseButton = class(TfpgWidget) when in fact the real code in the .pas unit is: type TfpgBaseButton = class(TfpgWidget, ICommandHolder) I mentioned in a 'feature request' that it would be nice if the class documentation can list the implemented interfaces (something like JavaDoc does). That would be nice, but even if we can start by including the "real" class definition in the documentation output, that would be good too. I found more such problems (not relating to Interfaces too). For example, I have a record that is marked as 'deprecated' in the pas unit. But the HTML type definition of that record doesn't show the 'deprecated' keyword. eg: HTML output. type TRGBTriple = record Red: Word; Green: Word; Blue: Word; Alpha: Word; end; but the real code in the .pas unit is as follows: TRGBTriple = record Red: word; Green: word; Blue: word; Alpha: word; end deprecated; Note the HTML output is missing the 'deprecated' keyword. Same as the missing implemented Interface in my button example. Another example is a property with the 'platform' modifier. The definition shown in the fpdoc class documentation doesn't include the 'platform' modifier in the code example. Is all this by design, or simply an oversight/bug in the fpdoc program?

These are oversights/bugs.

Especially HTML is problematic, as it 'reconstructs' the whole definition from the TPasElement to be able to highlight instead of using GetDeclaration. The linear writers use simply the TPasElement.GetDeclaration call.

Please enter bug reports for any problems that you find.

Michael.

Reply by email

Marco van de Voort
to Michael Van Canneyt

In our previous episode, Michael Van Canneyt said:

> Is all this by design, or simply an oversight/bug in the fpdoc program? These are oversights/bugs.

The interface bit is a bit larger. That is completely missing, also from fcl-passrc

Show quoted text 5 lines
Especially HTML is problematic, as it 'reconstructs' the whole definition from the TPasElement to be able to highlight instead of using GetDeclaration. The linear writers use simply the TPasElement.GetDeclaration call. Please enter bug reports for any problems that you find.

Please with little packages that demonstrate the problem.

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys: When generating HTML class documentation, the Class definition displayed is not the same…

Hi,

Attached is a patch for review, implementing the missing hint modifiers for Records and Properties for fcl-passrc.

The one problem I have is with the inconsistent syntax of hint modifiers. Sometimes a hint modifier my not have a preceding semi-colon (record types) and sometimes it must have a preceding semi-colon (properties of a class). So I handled it as best as I could - using a extra boolean parameter.

eg: GetDeclaration now returns the following code listings...

  TRGBTriple = record
    Red: word;
    Green: word;
    Blue: word;
    Alpha: word;
  end deprecated;

...or...

  property RootWindow: TfpgWinHandle; platform;

See attached patch for review. If it's ok, then the call to ProcessHint() needs to be added to the remainder TPasElement descendant classes for wherever hint modifiers can be applied. [I'm not sure where everywhere in the pascal syntax that is though]

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Marco van de Voort
to Graeme Geldenhuys

In our previous episode, Graeme Geldenhuys said:

Show quoted text 10 lines
So I handled it as best as I could - using a extra boolean parameter. eg: GetDeclaration now returns the following code listings... TRGBTriple = record Red: word; Green: word; Blue: word; Alpha: word; end deprecated;

The patch looked fine in principle, so committed it.

Please use mantis next time.

Reply by email

Graeme Geldenhuys
to Marco van de Voort

Op 2010-08-11 12:50, Marco van de Voort het geskryf:

The patch looked fine in principle, so committed it.

Thanks.

Please use mantis next time.

The reason I posted it here was in case in needed to be discussed - before it was acceptable as a working patch. Not sure if Mantis was the correct place for that.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email