Roslyn: Doc comments don't show on local functions

Created on 29 Sep 2016  路  8Comments  路  Source: dotnet/roslyn

Version Used:

Steps to Reproduce:

  1. Create a local function with doc comments

``` C#
static Gen> GenerateUsings() {
///


/// method summary
///

///
Gen GenerateUsing()
{
var strings = GenerateIdentifierStrings();
return Gen.Choose(1, 100).SelectMany(i => strings.ArrayOf(i))
.Where(i => i.Length > 1)
.Select(x => UsingDirective(CreateNameSyntax(x)));
}

var usings = GenerateUsing();
return Gen.Choose(1, 100).SelectMany(i => usings.ArrayOf(i))
    .Select(array => List(array));

}
```

  1. Hover over `var usings = GenerateUsing();

Expected Behavior:
Doc comments show up
actual

Actual Behavior:
actual

Area-Compilers Bug New Language Feature - Local Functions Resolution-By Design

Most helpful comment

Doc comments are for members, in my opinion. I do not think this should work.

All 8 comments

It isn't clear that they are _supposed_ to be supported on local functions. We need to decide, and then do whatever we decided.

Doc comments are for members, in my opinion. I do not think this should work.

@agocke I'm OK with doc comments not being supported for local functions.

@dotnet/ldm @dotnet/roslyn-compiler Does anyone want to push back on this?

Doc comments are for members, in my opinion. I do not think this should work.

Agreed. Also, if we were to support this, we'd also have to come up with how to represent local functions in documentation IDs and decide how to persist them in the resulting XML. Which seems like a bad idea...

馃憤 on not supporting doc comments. It's similar to how we do nto support them for local lambdas either.

@CyrusNajmabadi Or local variables.

I don't think we need full doc-comment support because these are likely pretty lightweight but it would be nice if quick info showed the text from a comment immediately preceding the local function declaration. It seems to me the most likely and natural place for someone to write a brief summary of what that function does and we should plumb that through as we would a doc comment. I think this is also a fair experience for local variables now that I mention it.

Consensus reached! 馃槃

Was this page helpful?
0 / 5 - 0 ratings