Comment Inheritance

T

Tris.Phillips

Hi All,

This may be a silly question, but:
Is it possible for a child class to inherit a base classes <summary>
tag info for an overridden method?

Cheers,

T
 
C

Clive Dixon

No. I also asked this question some time ago! It is very frustrating to have
to duplicate comments for derived classes, and also subsequently keep them
in synch. I would like to see comment inheritance in a future version of C#.
 
T

Tris.Phillips

Thanks Clive,
I was questioning my sanity when I couldn't work it out. It seems like
such an obvious thing to need!
T
 
C

Christoph Nahr

This may be a silly question, but:
Is it possible for a child class to inherit a base classes <summary>
tag info for an overridden method?

C# and Visual Studio don't allow that at all. However, the upcoming
NDoc 2.0 will allow comment inheritance.

But that's going to be an NDoc-only feature so you're not going to see
the inherited comment in IntelliSense -- which is why I'm not planning
to use that feature.
 
C

Clive Dixon

I did put in a request for this feature with the NDoc guys - glad to hear
it's actually happening. Would be nice to see this ability in the C#
compiler too...
 
B

Bjorn Abelli

C# and Visual Studio don't allow that at all. However, the upcoming
NDoc 2.0 will allow comment inheritance.

But that's going to be an NDoc-only feature so you're not going to see
the inherited comment in IntelliSense -- which is why I'm not planning
to use that feature.

You can use GhostDoc, which "fills in" the summary from the overridden
method.

http://www.roland-weigelt.de/ghostdoc/

It's pretty useful for filling in other summaries as well.

// Bjorn A
 
F

Frans Bouma [C# MVP]

Hi All,

This may be a silly question, but:
Is it possible for a child class to inherit a base classes <summary>
tag info for an overridden method?

Yes, use Ghostdoc.
http://www.roland-weigelt.de/ghostdoc/

:)

Frans

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
C

Christoph Nahr

It doesn't support VS Express

The other way round... VS Express doesn't support plug-ins.
Any plug-ins. Microsoft very much wants you to buy Standard or higher
if you wish to use plug-ins...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top