I created a VSIX project to read properties of a class, trying to get their names and varriable types as doing sth like below using Roslyn;
string filePath = Path.GetDirectoryName(dte.Solution.FullName) + @"\ProjectName\Models\Products.cs";
string fileBody = File.ReadAllText(filePath);
var tree = CSharpSyntaxTree.ParseText(fileBody);
var root = tree.GetRoot();
var nodes = root.DescendantNodes();
foreach (var node in Properties)
{
// How to get;
// Get name of the property
// Get type of property int, string, double etc...
}
Could you please provide correct way of doing that?