0
我想獲得類型的所有擴展方法。例如,對於類型string
,如果我使用semanticmodel方法lookupsymbols。使用roslyn api獲取所有類型的擴展方法
var sourceText = @"string a = "";
a."
var tree= CSharpSyntaxTree.ParseText(sourceTextx...);
....
var members = semanticModel.LookupSymbols(source.IndexOf("a."), someType, includeReducedExtensionMethods: true);
//this return all members with extension methods for type string someExtMethod(this string text)....
//I want get all extension with methods where first param might be one of them
var interfaces = someType.AllInerfaces;
//for example IEnumerable<out T>, methods like: Select, Where, Aggregate...
謝謝,但我不明白沒有例子。我可以在任何地方看到例子嗎? – itihonov
和CSharpScipt有什麼不同嗎? – itihonov