FSharp.Formatting icon indicating copy to clipboard operation
FSharp.Formatting copied to clipboard

Unit returning functions yield warning

Open johannesvp opened this issue 1 year ago • 5 comments

For functions to be documented that return unit, a warning is returned: a parameter is missing a name. Using fsdocs 19.1.1

The code:

    /// <summary>
    /// Resets all channels ...
    /// Next to this it also disables ...
    /// </summary>
    /// <exception cref="ErrorHandeling.DriverException">An exception that is thrown when the driver encounters
    /// an exception/error</exception>
    let Disable () =
        disable read write

fsdocs output:

> 
> 2>API docs:
> 2>  generating model for 2 assemblies in API docs...
> 2>  loading 2 assemblies...
> 2>isNetCoreApp = true
> 2>  registering entities for assembly Apollo.Driver...
> 2>  registering entities for assembly Apollo.SwitchPanel.Gui...
> 2>  reading XML doc for C:\Users\Johannes.vanPutten\Documents\Salland\Products\Apollo\src\Apollo\Apollo.Driver\bin\x64\Release\net6\Apollo.Driver.dll...
> 2>  reading assembly data for C:\Users\Johannes.vanPutten\Documents\Salland\Products\Apollo\src\Apollo\Apollo.Driver\bin\x64\Release\net6\Apollo.Driver.dll...
> 2>C:\Users\Johannes.vanPutten\Documents\Salland\Products\Apollo\src\Apollo\Apollo.Driver\Dps.fs(126,8): warning : a parameter was missing a name

Same warning is produced for any public function with XML comments that returns unit.

johannesvp avatar Aug 07 '24 06:08 johannesvp

Can you reproduce this with the latest main?

nojaf avatar Aug 07 '24 06:08 nojaf

Same result with v20.0.1

johannesvp avatar Aug 07 '24 08:08 johannesvp

I appreciate your response, but my question was specific to the latest update. The main branch received an update to the F# compiler yesterday, and I'm curious if the issue persists with this new version.

nojaf avatar Aug 07 '24 08:08 nojaf

Not yet available at nuget, after a local build it appeared that the result is the same for 21.0.0-beta-003.

johannesvp avatar Aug 07 '24 10:08 johannesvp

I noticed this warning comes from this line.

I'd be happy to accept a PR to check whether the parameter type is unit or not. Would you be interested in submitting a PR for this?

nojaf avatar Aug 07 '24 11:08 nojaf

@nojaf I think this can be closed now

MangelMaxime avatar Dec 29 '24 22:12 MangelMaxime