| Name | Message | Date |
|---|---|---|
| 📄 ITestInterface.cs | 1 month ago | |
| 📄 packages.lock.json | 1 month ago | |
| 📄 Poc.csproj | 1 month ago | |
| 📄 Program.cs | 1 month ago |
📄
Poc/Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using Microsoft.Build.Locator; using Microsoft.CodeAnalysis.MSBuild; using Reacher; using Reacher.Poc; MSBuildLocator.RegisterDefaults(); using var workspace = MSBuildWorkspace.Create(); var solution = await workspace.OpenSolutionAsync(GetSolutionPath()); ITestInterface test = new TestImplementation(); test.Test(); Noop(); var analysis = args is [] ? await solution.AnalyzeReachabilityFromEntryPoints(default) : await solution.AnalyzeReachabilityFromDocumentationCommentIds(args, default); Console.WriteLine("Reachable members:"); foreach ( var r in analysis.ReachableMembers.Where(r => r.ReachabilityConfidence is ReachabilityConfidence.DefinitelyReachable ) ) { Console.WriteLine($"\t{r.Member.GetDocumentationCommentId()}"); } Console.WriteLine("Probably reachable members:"); foreach ( var r in analysis.ReachableMembers.Where(r => r.ReachabilityConfidence is ReachabilityConfidence.ProbablyReachable) ) { Console.WriteLine($"\t{r.Member.GetDocumentationCommentId()}"); } Console.WriteLine("Unreachable members:"); foreach (var member in analysis.UnreachableMembers) { Console.WriteLine($"\t{member.GetDocumentationCommentId()}"); } return; #pragma warning disable CS0162 // Intentionally unreachable Unreachable(); #pragma warning restore CS0162 static string GetSolutionPath([CallerFilePath] string sourcePath = null!) => Path.GetFullPath(Path.Join(Path.GetDirectoryName(sourcePath), @"..\Reacher.slnx")); static void Noop() => TransitiveNoop(); static void TransitiveNoop() { } static void Unreachable() => Unreachable(); static void Unused() => Unused();