Add benchmarks project
This commit is contained in:
@@ -18,23 +18,23 @@ public static class RoslynTest
|
||||
Console.WriteLine($"Solution loaded in {timer.ElapsedMilliseconds}ms");
|
||||
Console.WriteLine();
|
||||
|
||||
foreach (var project in solution.Projects)
|
||||
{
|
||||
Console.WriteLine($"Project: {project.Name}");
|
||||
foreach (var document in project.Documents)
|
||||
{
|
||||
Console.WriteLine($"Document: {document.Name}");
|
||||
var syntaxTree = await document.GetSyntaxTreeAsync();
|
||||
var root = await syntaxTree!.GetRootAsync();
|
||||
var classifiedSpans = await Classifier.GetClassifiedSpansAsync(document, root.FullSpan);
|
||||
foreach (var span in classifiedSpans)
|
||||
{
|
||||
var classifiedSpan = root.GetText().GetSubText(span.TextSpan);
|
||||
Console.WriteLine($"{span.TextSpan}: {span.ClassificationType}");
|
||||
Console.WriteLine(classifiedSpan);
|
||||
}
|
||||
}
|
||||
}
|
||||
// foreach (var project in solution.Projects)
|
||||
// {
|
||||
// Console.WriteLine($"Project: {project.Name}");
|
||||
// foreach (var document in project.Documents)
|
||||
// {
|
||||
// Console.WriteLine($"Document: {document.Name}");
|
||||
// var syntaxTree = await document.GetSyntaxTreeAsync();
|
||||
// var root = await syntaxTree!.GetRootAsync();
|
||||
// var classifiedSpans = await Classifier.GetClassifiedSpansAsync(document, root.FullSpan);
|
||||
// foreach (var span in classifiedSpans)
|
||||
// {
|
||||
// var classifiedSpan = root.GetText().GetSubText(span.TextSpan);
|
||||
// Console.WriteLine($"{span.TextSpan}: {span.ClassificationType}");
|
||||
// Console.WriteLine(classifiedSpan);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
private void LoadSolution(string solutionPath)
|
||||
{
|
||||
return;
|
||||
var solutionFile = GetNodesInSolution.ParseSolutionFileFromPath("C:/Users/Matthew/Documents/Git/amazon/ClientPortal.sln");
|
||||
ArgumentNullException.ThrowIfNull(solutionFile);
|
||||
_solutionFile = solutionFile;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(100);
|
||||
await RoslynTest.Analyse("C:/Users/Matthew/Documents/Git/StatusApp/StatusApp.sln");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user