This repository has been archived by the owner on Dec 18, 2017. It is now read-only.
Add framework to diagnostic from compilation #2268
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressing #1722
Adding framework information to the diagnostic message print to the Console. It is supposed to be picked up by VS and flow to WTE with the framework information.
We used to use
CSharpDiagnosticFormatter
to format theDiagnostic
into message. However it is basically not extensible (with one virtual method do it all).https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/Diagnostic/DiagnosticFormatter.cs
I added
RoslynDiagnosticFormatter
to serialize the message using the same logic asDiagnosticFormatter
but insert the framework in it.The information represents framework is it's identity. I was suggested by @BillHiebert that version is not required. I won't be able to insert the friendly name because
Microsoft.Framework.Runtime.Roslyn.Common
doesn't depends onMicrosoft.Framework.Runtime
to avoid circular dependencies. But the framework identity should be enough to parse it back toFrameworkName
.Here's a sample output: