Skip to content

Port doc comment changes from docs repo#7152

Merged
Forgind merged 3 commits intodotnet:mainfrom
ghogen:main
Jan 5, 2022
Merged

Port doc comment changes from docs repo#7152
Forgind merged 3 commits intodotnet:mainfrom
ghogen:main

Conversation

@ghogen
Copy link
Contributor

@ghogen ghogen commented Dec 14, 2021

Fixes #7151

Context

Doc comments are changed from time to time in the dotnet-api-docs repo. These changes need to be ported back to the MSBuild source, now that the MSBuild source is being used as the source-of-truth for MSBuild reference docs.

Changes Made

Comment-only changes in a number of source files.

Testing

Notes

The changes that were required can also be found here: dotnet/dotnet-api-docs#7484 - this docs PR was necessary to prevent the dotnet-api-docs changes from being overwritten when the comments were re-read from MSBuild sources for the 17.0 version of MSBuild.

@ghogen ghogen changed the title port comment changes Port doc comment changes from docs repo Dec 14, 2021
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
@danmoseley
Copy link
Member

@ghogen just curious, do you do this manually or with a tool like https://github.com/carlossanlop/DocsPortingTool ?

@ghogen
Copy link
Contributor Author

ghogen commented Dec 16, 2021

@danmoseley I did this manually, but yes the DocsPortingTool is designed to handle this kind of thing. It looked like a bit too much overhead for such a small number of changes.

@danmoseley
Copy link
Member

@ghogen that's cool, just checking we weren't missing an opportunity to share tech.

Copy link
Contributor

@Nirmal4G Nirmal4G left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note inside remarks have markdown because of auto conversion but we don't need to copy them exactly as markdown. Just plain text is fine. Same as before.

Also, Type crefs are simplified. Some might not have usings defined in the file. Check and add necessary usings if needed!

/// resource), not necessarily the assembly version.
/// If you want the assembly version, use Constants.AssemblyVersion.
/// This is not the <see cref="ToolsetsVersion">ToolsetCollectionVersion</see>.
/// This is not the <see cref="P:Microsoft.Build.BuildEngine.ToolsetCollection.ToolsVersions*">ToolsetCollection.ToolsVersions</see>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This is not the <see cref="P:Microsoft.Build.BuildEngine.ToolsetCollection.ToolsVersions*">ToolsetCollection.ToolsVersions</see>.
/// This is not the <see cref="ToolsetCollection.ToolsVersions"/>.


/// <summary>
/// Initializes a new instance of BuildEventArgsReader using a BinaryReader instance
/// Initializes a new instance of <see cref="T:Microsoft.Build.Logging.BuildEventArgsReader"/> using a <see cref="T:System.IO.BinaryReader"/> instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Initializes a new instance of <see cref="T:Microsoft.Build.Logging.BuildEventArgsReader"/> using a <see cref="T:System.IO.BinaryReader"/> instance.
/// Initializes a new instance of <see cref="BuildEventArgsReader"/> using a <see cref="BinaryReader"/> instance.

/// Initializes a new instance of <see cref="T:Microsoft.Build.Logging.BuildEventArgsReader"/> using a <see cref="T:System.IO.BinaryReader"/> instance.
/// </summary>
/// <param name="binaryReader">The BinaryReader to read BuildEventArgs from</param>
/// <param name="binaryReader">The <see cref="T:System.IO.BinaryReader"/> to read <see cref="T:Microsoft.Build.Framework.BuildEventArgs"/> from.</param>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <param name="binaryReader">The <see cref="T:System.IO.BinaryReader"/> to read <see cref="T:Microsoft.Build.Framework.BuildEventArgs"/> from.</param>
/// <param name="binaryReader">The <see cref="BinaryReader"/> to read <see cref="BuildEventArgs"/> from.</param>


/// <summary>
/// Reads the next log record from the binary reader. If there are no more records, returns null.
/// Reads the next log record from the <see cref="T:System.IO.BinaryReader"/>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Reads the next log record from the <see cref="T:System.IO.BinaryReader"/>.
/// Reads the next log record from the <see cref="BinaryReader"/>.

/// Reads the next log record from the <see cref="T:System.IO.BinaryReader"/>.
/// </summary>
/// <returns>
/// The next <see cref="T:Microsoft.Build.Framework.BuildEventArgs" />. If there are no more records, returns <see langword="null" />.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The next <see cref="T:Microsoft.Build.Framework.BuildEventArgs" />. If there are no more records, returns <see langword="null" />.
/// The next <see cref="BuildEventArgs"/>. If there are no more records, returns <see langword="null"/>.

Comment on lines +33 to +38
/// <remarks><format type="text/markdown"><![CDATA[
/// ## Remarks
/// > [!NOTE]
/// > You must use the <xref:Microsoft.Build.Framework.SdkResultFactory> to return a result.
/// ]]></format>
/// </remarks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <remarks><format type="text/markdown"><![CDATA[
/// ## Remarks
/// > [!NOTE]
/// > You must use the <xref:Microsoft.Build.Framework.SdkResultFactory> to return a result.
/// ]]></format>
/// </remarks>
/// <remarks>
/// Note: You must use the <see cref="SdkResultFactory"/> to return a result.
/// </remarks>

Comment on lines +42 to +46
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
///
/// File version is informational and not equal to the assembly version.
/// ]]></format>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
///
/// File version is informational and not equal to the assembly version.
/// ]]></format>
/// File version is informational and not equal to the assembly version.

Do we need to include info about how the file version is calculated?

Comment on lines +12 to +16
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
/// > [!NOTE]
/// > Use <xref:Microsoft.Build.Framework.SdkResultFactory> to create instances of this class. Do not inherit from this class.
/// ]]></format>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
/// > [!NOTE]
/// > Use <xref:Microsoft.Build.Framework.SdkResultFactory> to create instances of this class. Do not inherit from this class.
/// ]]></format>
/// Note: Use <see cref="SdkResultFactory"/> to create instances of this class. Do not inherit from this class.

Comment on lines +16 to +20
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
/// Currently uses SHA1. The implementation is subject to change between MSBuild versions.
/// This class is not intended as a cryptographic security measure, only for uniqueness between build executions.
/// ]]></format>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
/// Currently uses SHA1. The implementation is subject to change between MSBuild versions.
/// This class is not intended as a cryptographic security measure, only for uniqueness between build executions.
/// ]]></format>
/// Currently uses SHA1. The implementation is subject to change between MSBuild versions.
/// This class is not intended as a cryptographic security measure, only for uniqueness between build executions.

@elachlan
Copy link
Contributor

elachlan commented Jan 3, 2022

Note inside remarks have markdown because of auto conversion but we don't need to copy them exactly as markdown. Just plain text is fine. Same as before.

Also, Type crefs are simplified. Some might not have usings defined in the file. Check and add necessary usings if needed!

We have a PR for the cref changes at #7194, do we want to merge that first and then rebase this PR?

@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Jan 5, 2022
@Forgind Forgind merged commit 84b30e7 into dotnet:main Jan 5, 2022
@Nirmal4G
Copy link
Contributor

Nirmal4G commented Jan 6, 2022

@elachlan This is merged, so add these suggestions to your cref PR.

@Forgind
Copy link
Contributor

Forgind commented Jan 6, 2022

Do we have somewhere we said we want short crefs? I had no idea, but rainersigwald said no.

@Forgind
Copy link
Contributor

Forgind commented Jan 6, 2022

If we'd originally listed it as info, that may have been a mistake on our part—if so, sorry about that!

@rainersigwald
Copy link
Member

I don't feel strongly about the short/long crefs. I do feel strongly that that style issue shouldn't block this change to reduce pain on our docs partners.

@elachlan
Copy link
Contributor

elachlan commented Jan 7, 2022

@ghogen is the markdown important in this issue? Nirmal's suggestions have been applied in another PR and I wanted to make sure whether or not the markdown was required and needed to be preserved.

@ghogen
Copy link
Contributor Author

ghogen commented Jan 7, 2022

@elachlan @Nirmal4G
The Markdown is used in the dotnet-api-docs repo, but it's only required if there's special formatting such as for a Note/Caution/Tip construct for example. So I think it's OK to implement those suggestions in the other PR. Note also, we're doing work now to separate the MSBuild API reference from the .NET reference, which will give us more flexibility, because we can control the process better to avoid changes that occur in multiple repos (which is what led to my PR).

@Nirmal4G
Copy link
Contributor

Nirmal4G commented Jan 8, 2022

@ghogen

The Markdown is used in the dotnet-api-docs repo, but it's only required if there's special formatting such as for a Note/Caution/Tip construct…

The XML Doc comments already includes all these in the remarks element but as plain-text with a heading indicating the intent. Wouldn't it be possible for the doc engine to take it and convert to markdown and convert back to plain-text as is? That way, we wouldn't need those CDATA elements in the XML Doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update doc comments from dotnet-api-docs

6 participants