Closed realvizu closed 7 years ago
So it's:
var serviceProvider = ServiceProvider.GlobalProvider;
var activityLog = (IVsActivityLog)serviceProvider.GetService(typeof(SVsActivityLog));
Unfortunately activity log record description cannot be formatted with whitespaces so dumps like config content are effectively unreadable. Staying with Trace.WriteLine.
At the moment NsDepCopDiagnosticAnalyzer writes its own diagnostic trace messages (eg. cache hits/misses) to the debug output and it works in the debug build only.
It would be better if it could be configured on the host whether diagnostic trace messages are emitted or not. In case of Visual Studio being the host the obvious mechanism for writing diagnostic trace messages would be the Visual Studio Activity Log. The problem is that NsDepCopDiagnosticAnalyzer is a DiagnosticAnalyzer descendant and not a VSPackage so I can't obtain the IVsActivityLog service from the host.