-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type description is not pulled in for OutputType target if type is in a separate DLL #12
Comments
Yes, that functionality was always a bit half-hearted, and I've never really been happy with it. Here are my main issues:
So allowing a type to be documented is only ever a fallback option if more context-specific documentation cannot be found. I'm actually more inclined to remove this capability rather than extending the capability of the code to be able to resolve comments from more than just the cmdlet assembly. I think it might be better to support something like the following as part of the cmdlet XML docs, though I'm not sure how best to make a distinction between multiple paragraphs associated with the same type or multiple output types. I'm not even sure that difference even matters in the output of the <para type="output">Output type description</para> |
I had noticed your point (2) as well, and your suggestion for the new So how about the best of both? Add support for the |
I've had a look at the code a bit, and could probably extend it to enable the XML Doc comments to be resolved for any assembly. There's some awkwardness baked into the Options class, whereby the XML Doc can be obtained from an arbitrary path, but that's not useful and can be stripped out. That is to say, supporting your original suggestion should be fairly straightforward, and making it a fallback option to a |
Well I gave it a try, but got a bit snarled up with the error/issue reporting. I think it's quite important to get the reporting right, as it's there to give guidance about inadequate documentation. I'll probably need to tidy it up a bit. Hmm... |
Along with this, do you know of a way to call get-help MyData or some other cmdlet that would grab the members of the type and use xml comments to show details of the member? Example: Imports Microsoft.TeamFoundation.VersionControl.Client
Imports Microsoft.TeamFoundation.WorkItemTracking.Client
''' <summary>
''' <para type="description">An info object that describes a grouping of changes by serverpath and includes any workitems that are related to the changesets.</para>
''' </summary>
Public Class FileChangeInfo
''' <summary>
''' <para type="description">List of changes made to the file in ServerPath.</para>
''' </summary>
Property Changes As IEnumerable(Of Change)
''' <summary>
''' <para type="description">Last time the file was checked in.</para>
''' </summary>
Property LastCheckin As Date
''' <summary>
''' <para type="description">The server path of the file that has changes.</para>
''' </summary>
Property ServerPath As String
''' <summary>
''' <para type="description">List of work items linked to the changesets.</para>
''' </summary>
Property WorkItems As IEnumerable(Of WorkItem)
End Class Get-Help TFS_Release_Notes.FileChangeInfo |
I'm afraid not. This tool is for documenting binary PowerShell cmdlets. This issue is specifically about the help content for cmdlets being able to include text defined for types external to the binary PowerShell module. You're asking for a way to get help text for arbitrary .NET types, other than cmdlet sub-types. That's not something that's ever likely to be supported by PowerShell itself, and not the focus of |
Right. It is an output type for a cmdlet. See https://github.com/vbjay/TFS-Release-Notes/blob/master/TFS%20Release%20Notes/Cmdlets/WorkItems/GetWorkItemFiles.vb#L32 |
I'm inclined to think that there are really good cases for pulling in help documentation for a type that's not defined in the same assembly as the main binary PowerShell module. For example, shared domain objects used bby more than just the PowerShell binary module might live in their own assembly. In that instance, it would be reasonable for Unfortunately, the last time I attempted this, I rather got caught up in architectural issues in the code. It's architecture wasn't ever really thought out. It simply grew from some fairly hacky script-like code. I think I might spend some time cleaning it all up a bit. |
Ah, okay. So is it the case that you'd simply like to have the property and field descriptions rolled up into the description for the type? Something a bit like this?
Also, can you please confirm that the |
One specifies the output type of a cmdlet by decorating the cmdlet class with the
OutputType
attribute, having a single argument that is the type that the cmdlet returns. If that type is in the same project (DLL) then the Outputs section of the help content will report it.Example: Given this source...
If
MyData
is in the same DLL asGet-Foo
, then you get this help content:But if
MyData
is in a separate DLL, the description paragraph does not render.The text was updated successfully, but these errors were encountered: