Skip to content
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

Adds XML Comments to FileSystemProxy and SpecialDirectoriesProxy #12141

Merged

Conversation

paul1956
Copy link
Contributor

@paul1956 paul1956 commented Sep 14, 2024

Addresses adding XML comment #11984

Proposed changes

Add XML Comments to FileSystemProxy and SpecialDirectoriesProxy, they are together because FileSystem references SpecialDirectories.

Customer Impact

  • Easier development when IO functions have XML comments

Regression?

  • No

Risk

  • None no code changes
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.42900%. Comparing base (c9a58e9) to head (023a87a).
Report is 6 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12141         +/-   ##
===================================================
- Coverage   75.43315%   75.42900%   -0.00415%     
===================================================
  Files           3103        3103                 
  Lines         634314      634317          +3     
  Branches       46876       46876                 
===================================================
- Hits          478483      478459         -24     
- Misses        152407      152433         +26     
- Partials        3424        3425          +1     
Flag Coverage Δ
Debug 75.42900% <100.00000%> (-0.00415%) ⬇️
integration 17.98242% <0.00000%> (-0.00372%) ⬇️
production 48.80765% <100.00000%> (-0.00896%) ⬇️
test 97.02496% <ø> (ø)
unit 45.83725% <100.00000%> (-0.01000%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

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

Let's add < see cref > when we are referring to specific type or value in the description

Public Sub DeleteDirectory(directory As String, onDirectoryNotEmpty As DeleteDirectoryOption)
FileIO.FileSystem.DeleteDirectory(directory, onDirectoryNotEmpty)
End Sub

''' <summary>
''' Delete the given directory, with options to recursively delete, show progress UI,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
''' Delete the given directory, with options to recursively delete, show progress UI,
''' Deletes the given directory, with options to recursively delete, show progress UI,

@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Sep 17, 2024
@paul1956
Copy link
Contributor Author

Let's add < see cref > when we are referring to specific type or value in the description

@lonitra
Do you add cref to all instances, or only the first, or only in return/vslue? The repo seems to have a mix of all 3 options?

@dotnet-policy-service dotnet-policy-service bot added untriaged The team needs to look at this issue in the next triage and removed 📭 waiting-author-feedback The team requires more information from the author labels Sep 17, 2024
paul1956 and others added 4 commits September 17, 2024 11:24
…rvices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>
…rvices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>
…rvices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>
…rvices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>
@lonitra
Copy link
Member

lonitra commented Sep 17, 2024

Do you add cref to all instances, or only the first, or only in return/vslue? The repo seems to have a mix of all 3 options?

yes unfortunately, we have some inconsistencies here. Ideally all instances cref should be added when a specific value is being referred to in documentation xml -- especially if it is public

@lonitra lonitra removed the untriaged The team needs to look at this issue in the next triage label Sep 17, 2024
@paul1956
Copy link
Contributor Author

@lonitra i have no issue doing that but it will really clutter up the comments. There are very few cases where that is done, usually if it’s in a parameter/return/value it’s not repeated in the summary. VS has a quick fix if they are fully qualified otherwise you need to qualify first and then do CodeFix. I thought about an analyzer for this but it would not be an insignificant effort. Maybe a modification of existing CodeFix to add an Analyzer would be possible.

For things like ComboBox that are used multiple times in a sentence/paragraph would you on do the first instance in the section only or all?

@lonitra
Copy link
Member

lonitra commented Sep 18, 2024

I see, good point. If it will clutter things up making readability difficult then let's just make sure that there is a cref for the first time the value is referenced so that it is easy to navigate to if readers are curious to know more information about the value.

@paul1956
Copy link
Contributor Author

I see, good point. If it will clutter things up making readability difficult then let's just make sure that there is a cref for the first time the value is referenced so that it is easy to navigate to if readers are curious to know more information about the value.

@paul1956 I agree the first use would be best but the majority of existing comments put the cref in the value or return section if there is only 1 cref. Moving it is easy but should be a separate PR. Maybe we should open a Tracking issue?

I can fix this PR to follow these guidelines today.

@lonitra
Copy link
Member

lonitra commented Sep 19, 2024

I agree the first use would be best but the majority of existing comments put the cref in the value or return section if there is only 1 cref.

I'm not sure I follow this, could you share an example of what you are referring to? Is the issue that it is referenced in the summary but cref exists only in value or return section?

Moving it is easy but should be a separate PR.

I agree, a separate PR focusing on this would be easier to review.

lonitra
lonitra previously approved these changes Sep 19, 2024
@lonitra lonitra added the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Sep 19, 2024
@paul1956
Copy link
Contributor Author

paul1956 commented Sep 19, 2024

I agree the first use would be best but the majority of existing comments put the cref in the value or return section if there is only 1 cref.

I'm not sure I follow this, could you share an example of what you are referring to? Is the issue that it is referenced in the summary but cref exists only in value or return section?

@lonitra

    /// <summary>
    ///  Returns the value of the specified <paramref name="propertyID"/> from the
    ///  element in the form of a <see cref="VARIANT"/>. See
    ///  <see href="https://learn.microsoft.com/windows/win32/winauto/uiauto-automation-element-propids">
    ///   which outlines how the <see cref="VARIANT"/> should be defined for each <see cref="UIA_PROPERTY_ID"/>
    ///  </see>
    /// </summary>
    /// <param name="propertyID">Identifier indicating the property to return.</param>
    /// <returns>The requested value if supported or <see cref="VARIANT.Empty"/> if it is not.</returns>

Just 1 of many examples where see cref is repeated multiple times even in one section (twice in summary) and once in returns.

        ''' <summary>
        '''  Gets the description associated with the assembly.
        ''' </summary>
        ''' <value>
        '''  String containing the <see cref="AssemblyDescriptionAttribute"/>
        '''  associated with the assembly.
        ''' </value>

Examples where it is only in value but it could be in summary (I like this one).

    /// <summary>
    ///  Gets the current <see cref="HighDpiMode"/> mode for the process.
    /// </summary>
    /// <value>One of the enumeration values that indicates the high DPI mode.</value>

Example with it is only in summary.

paul1956 and others added 3 commits September 20, 2024 17:52
…rvices/SpecialDirectoriesProxy.vb

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>
…rvices/SpecialDirectoriesProxy.vb

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>
@paul1956
Copy link
Contributor Author

@Tanya-Solyanik this should be ready to review with the updated abbreviated comments. The stuff needing cref has been deleted per your feedback.

@paul1956
Copy link
Contributor Author

@lonitra after you approved Tanya-Solyanik had comments that need fixing. Could I get another review, I fixed all issues.

@lonitra
Copy link
Member

lonitra commented Sep 24, 2024

@paul1956 Thank you for addressing comments!
It looks like we are waiting for some feedback. @KlausLoeffelmann PTAL in regards to #12141 (review)

@paul1956
Copy link
Contributor Author

@Tanya-Solyanik added cref's ready to review. Some of the comments were updated because VB does not expose all the same options the underlaying code does.

@paul1956 paul1956 changed the title Add XML Comments related to FileSystemProxy and SpecialDirectoriesProxy Adds XML Comments to FileSystemProxy and SpecialDirectoriesProxy Sep 28, 2024
@lonitra
Copy link
Member

lonitra commented Oct 2, 2024

Changes LGTM. I took a look at history again and it looks like we are no longer document a specific path and refer to docs now.

@lonitra lonitra added the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Oct 2, 2024
@lonitra lonitra merged commit d10e2c2 into dotnet:main Oct 3, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview1 milestone Oct 3, 2024
@dotnet-policy-service dotnet-policy-service bot removed the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Oct 3, 2024
@paul1956 paul1956 deleted the Add-XLM-Comments-to-VB-File-System-Proxy branch October 3, 2024 05:00
paul1956 added a commit to paul1956/winforms that referenced this pull request Oct 4, 2024
…net#12141)

* Add XML Comments related to FileSystemProxy which includes SpecialDirectoriesProxy

* Fix some types

* Add some language keywords

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* PR feedback

* Update all XML comments

* Fix Typo in FileSystemProxy that caused build to fail.

* Update XML Coments

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>

* Redo all the comments in SpecialDirectoriesProxy

* Add cref per PR feedback and changed type to Namespace

* PR Feedback to add see cref's

---------

Co-authored-by: Loni Tra <lonitra@microsoft.com>
Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>
lonitra added a commit that referenced this pull request Oct 11, 2024
…ifying PR #11863 (#12261)

* No code Chnages just formatting

* Add tests for SignleInstanceHelper from #11863

* Moved to SDK RC2 (#12254)

* Moved to SDK RC2 to get the same build errors in VS and CLI build and be able to fix them.

Before this change the IntPreview version of VS was correctly complaining about a redundant cast(IDE0004) in ToolStrip.cs
    g.DrawLines(SystemPens.ControlText, (ReadOnlySpan<Point>)
        [
            new(verticalBeamStart, _lastInsertionMarkRect.Y), new(verticalBeamStart, _lastInsertionMarkRect.Bottom - 1),
            new(verticalBeamStart + 1, _lastInsertionMarkRect.Y), new(verticalBeamStart + 1, _lastInsertionMarkRect.Bottom - 1)
        ]);

But the CLI build required this cast.

After the upgrade to RC2, IDE0300 - Collection initialization can be simplified - became more robust and required code fixes that use collection expressions applied to the solution.

* Adds XML Comments to FileSystemProxy and SpecialDirectoriesProxy (#12141)

* Add XML Comments related to FileSystemProxy which includes SpecialDirectoriesProxy

* Fix some types

* Add some language keywords

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/FileSystemProxy.vb

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* PR feedback

* Update all XML comments

* Fix Typo in FileSystemProxy that caused build to fail.

* Update XML Coments

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>

* Update src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/SpecialDirectoriesProxy.vb

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>

* Redo all the comments in SpecialDirectoriesProxy

* Add cref per PR feedback and changed type to Namespace

* PR Feedback to add see cref's

---------

Co-authored-by: Loni Tra <lonitra@microsoft.com>
Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>

* [main] Update dependencies from dotnet/runtime (#12266)

[main] Update dependencies from dotnet/runtime

* Fix IDE0002 in LogTests.cs (#12265)

Fix IDE0002 in LogTests.cs

* [main] Update dependencies from dotnet/arcade (#12271)

[main] Update dependencies from dotnet/arcade

* [main] Update dependencies from dotnet/runtime (#12272)

[main] Update dependencies from dotnet/runtime

* Improve code coverage for FileLogTraceListener from simplifying PR #11863  (#12264)

* Improve code coverage for FileLogTraceListener

* Update src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Logging/FileLogTraceListenerTests.cs

Thanks I had no idea about boolData

Co-authored-by: Loni Tra <lonitra@microsoft.com>

---------

Co-authored-by: Loni Tra <lonitra@microsoft.com>

* Switch default feed to use wildcards only (#12268)

* Switch default feed to full wildcard

* Add other wildcards back

* Move local closer to usage

* PR Feedback

* Address PR Feedback

* PR Feedback

* PR Feedback inline private Sub, reuse commandLine

---------

Co-authored-by: Tanya Solyanik <tanyaso@microsoft.com>
Co-authored-by: Loni Tra <lonitra@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rich Lander <rlander@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants