microsoft / typespec

https://typespec.io/
MIT License
4.36k stars 204 forks source link

Add xml doc for parameter in indexer declaration #3276

Open ArcturusZhang opened 5 months ago

ArcturusZhang commented 5 months ago

Clear and concise description of the problem

Current implementation does not write the xml doc for the parameter in indexer declaration, we should add it.

Checklist

m-nash commented 4 months ago

@ArcturusZhang can you link in the use case that needs this xml documentation on the public api surface

ArcturusZhang commented 4 months ago

@ArcturusZhang can you link in the use case that needs this xml documentation on the public api surface

In the code, it should be implemented here: https://github.com/microsoft/typespec/blob/546f65c6db38615d780a2b3fb0cf063e41122022/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriter.cs#L316

When we have an indexer property, we should have this:

/// <summary> ... </summary>
/// <param name="index> ... </param> <- this is the xml doc we are missing 
public string this[int index]
{
    get; set;
}
ShivangiReja commented 3 months ago

Currently, there is no public index property in any SDK. It may be beneficial to implement this feature when there is a requirement for it.