tomazsaraiva / unity-canvas-page-slider

A Scrollable Page Viewer for Unity
https://tomazsaraiva.github.io/unity-canvas-page-slider/
28 stars 2 forks source link

Typo in PageContainer doc comment #5

Open jpetays opened 3 months ago

jpetays commented 3 months ago

One forward slash is missing:

        // <summary>
        /// The PageView component representing the content of this page container.
        /// </summary>

And by the way, all C# Attributes should be after doc comments section.
At least Rider complaints if they are mixed between C# Attributes.

Annex D Documentation comments D.1 General "They must immediately precede a user-defined type (such as a class, delegate, or interface) or a member" might mean that C# Attributes are part of the type!? https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments

tomazsaraiva commented 3 months ago

I'm not sure if I understood. How should I write the comments when having attributes? Thanks!

jpetays commented 3 months ago

I'm using IntelliJ Rider IDE and just fix everything it tells me to do 😊

As I actually checked this, it is about compiler warning CS1587: XML comment is not placed on a valid language element https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs1587

Example of code that produces this warning:

    public class PageDot : MonoBehaviour
    {
        #region Variables

        [Header("Configuration")]

        /// <summary>
        /// Determines whether it should change the Image component color on state changes
        /// </summary>
        [Tooltip("Determines whether it should change the Image component color on state changes")]
        [SerializeField] private bool _useImageComponent;

Fixed code that is OK:

        /// <summary>
        /// Determines whether it should change the Image component color on state changes
        /// </summary>
        [Header("Configuration")]
        [Tooltip("Determines whether it should change the Image component color on state changes")]
        [SerializeField] private bool _useImageComponent;

Putting XML doc comment section between two C# Attributes is not good and IntelliJ Rider IDE gives this warning to me. Reorganizing lines so that all C# Attributes are after XML doc comment section fixes it.