Backport XML documentation for WebProxy and IWebProxyScript#124396
Backport XML documentation for WebProxy and IWebProxyScript#124396
Conversation
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
src/libraries/System.Net.WebProxy/src/System/Net/IWebProxyScript.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.WebProxy/src/System/Net/IWebProxyScript.cs
Outdated
Show resolved
Hide resolved
…descriptions, update IWebProxyScript remarks Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Done in commit 0287cd0. Removed |
There was a problem hiding this comment.
Pull request overview
This PR backports XML documentation from dotnet-api-docs for System.Net.WebProxy and System.Net.IWebProxyScript to their source implementations, following the pattern established in PR #124227. The documentation adds comprehensive API descriptions including type-level remarks, constructor documentation, property and method documentation with proper XML conventions.
Changes:
- Removed
UseCompilerGeneratedDocXmlFileproperty from the project file to enable compiler-generated XML documentation - Added comprehensive XML documentation for WebProxy class covering 11 constructors, 6 properties, and 3 methods including WPAD support details
- Added XML documentation for IWebProxyScript interface covering all interface members with WPAD/PAC implementation details
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/libraries/System.Net.WebProxy/src/System.Net.WebProxy.csproj | Removed UseCompilerGeneratedDocXmlFile property to enable compiler-generated documentation |
| src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs | Added comprehensive XML documentation for class, constructors, properties, and methods (239 lines total) |
| src/libraries/System.Net.WebProxy/src/System/Net/IWebProxyScript.cs | Added XML documentation for interface and all methods with WPAD/PAC details |
src/libraries/System.Net.WebProxy/src/System/Net/IWebProxyScript.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
The parameter descriptions "Internal only." and return value description "An internal-only value returned." are not helpful for API documentation. If these are truly internal-only, the type-level documentation should clarify the intended usage. Otherwise, provide meaningful descriptions of what these parameters and return values represent.
| /// <param name="scriptLocation">Internal only.</param> | |
| /// <param name="script">Internal only.</param> | |
| /// <param name="helperType">Internal only.</param> | |
| /// <returns>A <see cref="bool"/> indicating whether the script was successfully loaded.</returns> | |
| bool Load(Uri scriptLocation, string script, Type helperType); | |
| /// <summary> | |
| /// Runs a script. | |
| /// </summary> | |
| /// <param name="url">Internal only.</param> | |
| /// <param name="host">Internal only.</param> | |
| /// <returns> | |
| /// A <see cref="string"/>. | |
| /// An internal-only value returned. | |
| /// <param name="scriptLocation"> | |
| /// The URI that identifies the script to use for automatic proxy detection. | |
| /// </param> | |
| /// <param name="script"> | |
| /// The script content to load and prepare for execution. | |
| /// </param> | |
| /// <param name="helperType"> | |
| /// The type that provides helper methods or services available to the script at runtime. | |
| /// </param> | |
| /// <returns>A <see cref="bool"/> indicating whether the script was successfully loaded.</returns> | |
| bool Load(Uri scriptLocation, string script, Type helperType); | |
| /// <summary> | |
| /// Runs a script. | |
| /// </summary> | |
| /// <param name="url"> | |
| /// The full destination URL for which proxy information is requested. | |
| /// </param> | |
| /// <param name="host"> | |
| /// The host name associated with the destination URL. | |
| /// </param> | |
| /// <returns> | |
| /// A <see cref="string"/> that describes how to connect to the destination, such as a proxy configuration | |
| /// directive (for example, <c>"DIRECT"</c> or <c>"PROXY host:port"</c>). |
There was a problem hiding this comment.
The GlobalProxySelection.Select property referenced here is obsolete (see line 31 issue). Consider updating this reference to use a non-obsolete API or removing this paragraph if it's no longer relevant.
There was a problem hiding this comment.
| /// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings. | |
| /// In .NET Framework, the <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings. | |
| /// In modern .NET, this method is obsolete. |
There was a problem hiding this comment.
Fixed in commit 5b2e4c9. Removed the entire paragraph referencing obsolete GlobalProxySelection.Select.
src/libraries/System.Net.WebProxy/src/System/Net/IWebProxyScript.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
| /// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings. | |
| /// In .NET Framework, the <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings. | |
| /// In modern .NET, this method is obsolete. |
…lete API references, improve parameter descriptions Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot please invoke the code-review skill and post the analysis/results as a comment on this PR |
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Head branch was pushed to by a user without write access
🤖 Copilot Code Review — PR #124396Holistic AssessmentMotivation: ✅ The PR is well-justified. It backports official XML documentation from dotnet-api-docs to enable compiler-generated documentation for System.Net.WebProxy and System.Net.IWebProxyScript. This is part of the ongoing effort to move documentation into source code for better maintainability and consistency. Approach: ✅ The approach is correct. The PR removes the opt-out flag ( Summary: ✅ LGTM. The PR successfully backports XML documentation for 11 constructors, 6 properties, and 3 methods across 2 types. All public APIs are now documented with proper XML conventions. The documentation has been refined through multiple review cycles to remove incorrect exception tags, obsolete API references, and placeholder text. The code compiles successfully with no warnings or errors. One minor duplicate exception tag was found and removed in commit 3be15ea. Detailed Findings✅ Documentation Completeness — All public APIs documentedAll public members in WebProxy.cs and IWebProxyScript.cs now have comprehensive XML documentation including:
This satisfies the requirement to enable compiler-generated documentation. ✅ XML Documentation Conventions — Proper syntax usedThe documentation follows C# XML doc conventions correctly:
✅ Platform-Specific Adaptations — .NET Framework content appropriately handledThe documentation correctly addresses platform differences:
✅ Exception Documentation Accuracy — Corrected after reviewThe PR correctly documents exceptions:
✅ Parameter Description Improvements — Replaced placeholder textIWebProxyScript parameter descriptions were improved from "Internal only" placeholders to meaningful documentation:
✅ Build Verification — No errors or warningsThe code compiles successfully across all target frameworks (net11.0, net11.0-browser, net11.0-wasi) with 0 warnings and 0 errors after enabling compiler-generated documentation enforcement. 💡 Minor Issue Fixed — Duplicate exception tag removedFound and removed a duplicate Recommendation✅ Approve and merge. This PR successfully completes the XML documentation backport for System.Net.WebProxy and System.Net.IWebProxyScript. All feedback from human reviewers and automated review has been addressed. The documentation is complete, accurate, and follows established conventions. |
Description
Backports XML documentation from dotnet-api-docs for
System.Net.WebProxyandSystem.Net.IWebProxyScriptto their source implementations, per instructions in #124227.Changes
System.Net.WebProxy.csproj - Updated project configuration:
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>to enable compiler-generated XML documentationWebProxy.cs - Added XML docs for:
WebProxy(SerializationInfo, StreamingContext)constructor andGetObjectDatamethod withPlatformNotSupportedExceptiondocumentationAddress,BypassProxyOnLocal,BypassList,BypassArrayList,Credentials,UseDefaultCredentialsGetProxy,IsBypassed,GetDefaultProxyIWebProxyScript.cs - Added XML docs for:
Close(),Load(),Run()with meaningful parameter descriptions and WPAD/PAC implementation details in remarksAll documentation uses proper C# XML conventions with
<see langword="null"/>for keywords,<see cref="T:TypeName"/>for external type references, and concise parameter descriptions. Documentation has been refined through review to:Source:
Impact: 225 lines of documentation added across 3 files
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.