dotnet / dotnet/fsharp

XML-comments for function with out parameter not visible from C# project

Open
#6,310 3 comments 1 reaction 1 assignee Claimed by @dsyme View on GitHub
Area-LangService-ToolTips Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

XML-comments from an F# project are not showing up in a C# project when the function in question has out parameters.

#### Repro steps

Github-repo with reproduction https://github.com/viktorvan/FSharpXmlCommentBugRepro

1. Create a new F# class library `dotnet new classlib --language "F#" -n FSharpProject`

2. Add a type with xml-comments:
```fsharp
namespace FSharpProject
open System.Runtime.InteropServices //for OutAttribute

///
/// This is my type
///
type MyType() =

///
/// This is a method with an out parameter
///
/// An input string
/// An output string
static member StaticOutParam((s : string), [] result : string byref) =
result <- "test"
```

3. Setup the project to generate doc-comments, in fsproj, add:
```
true
```

4. Build the project and verify that xml-comments are generated correctly in /bin/Debug/netstandard2.0/FSharpProject.xml

5. At this point intellisense will work from within the F# project, or from another F# project referencing the original F#-project.

6. Create a new C# class library and reference the F# project. `dotnet new classlib -n CSharpProject`. `dotnet add CSharpProject/CSharpProject.csproj reference FSharpProject/FSharpProject.fsproj`

5. Add a class that uses the function from the F# project:
```csharp
using FSharpProject;

namespace CSharpProject
{
public class Class1
{
public static void Test()
{
MyType.StaticOutParam("test", out var dummy);
}
}
}
```

6. Hovering the class MyType will show the expected intellisense documentation. Hovering over the function StaticOutParam will **not** show any intellisense documentation.

#### Expected behavior

Intellisense documentation is displayed when hovering the function in the C# project.

#### Actual behavior

No intellisense documentation is shown.

#### Known workarounds

None that I have found.

#### Related information

Provide any related information

* Operating system: tested on Mac Os X 10.14.3 and Windows 10
* Branch: N/A
* .NET Runtime, CoreCLR or Mono Version: dotnet core sdk 2.2.104
* Editing Tools (e.g. Visual Studio Version): tested in VsCode 1.32.1 with Ionide 3.34.0 and also Visual Studio 2017 (latest)
* Links to F# RFCs or entries on https://github.com/fsharp/fslang-suggestions
* Links to performance testing scripts
* Indications of severity: This is an inconvenience, but not blocking.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.