Use implementing class name in inherited XML comments from interface

47 views Asked by At

Please consider the following:

Public Interface IDatabase
[...]
    ''' <summary>
    ''' Executes the specified SQL command against the current
    ''' <see cref="IDatabase"/> connection and returns 
    ''' a <see cref="DataTable"/> containing the result set returned
    ''' by the SQL command.
    ''' </summary>
    ''' <param name="SQLStatement">The SQL command to execute</param>
    ''' <returns><see cref="DataTable"/> containing the result set returned by the SQL command</returns>
    Overloads Function ExecuteStatement(ByVal SQLStatement As String) As DataTable
[...]
End Interface

I know that XML comments on the implementing classes can/will be inherited from the interface:

Public Class SQLiteDB
    Implements IDatabase
    Implements IDisposable

[...]
    ' This method will inherit the XML comments from the
    ' IDatabase interface defined above
    Public Overloads Function ExecuteStatement(ByVal SQLStatement As String) As DataTable Implements IDatabase.ExecuteStatement
        Return ExecuteStatement(SQLStatement, "QueryResults")
    End Function
[...]
End Class

Based on a variety of posts like this SO answer, I know that I can explicitly use the <inheritdoc /> tag to "force" the inheritance, but that's not really necessary in the current environment. The XML comments already seem to show up just fine in IntelliSense for the implementing classes. What I'm wondering is, is it possible to have IntelliSense "auto-magically" replace the interface reference in the interface's XML comments to the implementing class name?

I realize it isn't a high-priority thing - and perhaps it's just plain dumb - but what I'd like to see in the IntelliSense on the implementing ExecuteStatement() method, for example, would be:

IntelliSense example mock-up

I've seen people using 3rd-party tools like GhostDoc and inheritdoc.io to automate documentation tasks, but I'm currently manually generating my documentation.

Is this something that's even possible? Is there a tag I'm overlooking that I can use instead of <see cref=""/> that IntelliSense can use to make this level of specificity available?

0

There are 0 answers