我正在寻找类似 GhostDoc for VS Code (C#) 的东西,但没有成功。有谁知道什么吗?
我只找到了一个“旧的”类似 VS 的扩展,它使 XML 注释在您键入“///”时可用,但这不是我正在寻找的。
有人可以解释为什么我看到我所看到的(下面控制台的屏幕截图)?对于 'ref' 和非 'ref' 方法参数,我从 Reflection 获得了不同的泛型相关属性。我正在使用 .NET 4.8(经典的 .NET Framework)。
public class MyClass {
public class Aref
{
public virtual void method(object je, ref List<MyClass> batchlist, object doc)
{
}
}
public class A
{
public virtual void method(object je, List<MyClass> batchlist, object doc)
{
}
}
private static void WriteGenericProps(Type type)
{
var method = type.GetMethod(nameof(Aref.method));
var param = method.GetParameters().First(p => p.Name == "batchlist");
Console.WriteLine(nameof(param.ParameterType.IsByRef) + "=" + param.ParameterType.IsByRef);
Console.WriteLine(nameof(param.ParameterType.IsGenericType) + "=" + param.ParameterType.IsGenericType);
Console.WriteLine(nameof(param.ParameterType.ContainsGenericParameters) + "=" + …Run Code Online (Sandbox Code Playgroud)