-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authoring Support: Add WinRT Diagnostics #615
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…etdiagnostics dont show mine
…soft/CsWinRT into jlarkin/adding-diagnostics
…reported diagnostics dont get forgotten
…eeds a bit of fine tuning
manodasanW
reviewed
Dec 10, 2020
manodasanW
reviewed
Dec 10, 2020
manodasanW
reviewed
Dec 10, 2020
manodasanW
reviewed
Dec 10, 2020
* fix async interface check to have more accurate condition * cherry-pick the array attributes * removing workaround * moving tests to new style (about half done)
* more tests * cleanup * PR feedback
…soft/CsWinRT into jlarkin/adding-diagnostics
clean rules
manodasanW
reviewed
Dec 18, 2020
manodasanW
reviewed
Dec 19, 2020
manodasanW
reviewed
Dec 19, 2020
manodasanW
reviewed
Dec 19, 2020
manodasanW
approved these changes
Dec 19, 2020
* add tests for exposing invalid types * consolidating signature checks * splitting utilities into two files, catching (some) invalid types * bool to void change * using class fields instead of passing reference * add namespace diagnostic, reorganize * enumerable tests should be nongeneric * add test for basetype and bad interface * add case for basetype implementing not valid interfaces * fix test names * rename scanner * clean up IsInvalidNamespace * custom map, struct refactoring * custom type mapping support * Better custom type mapping support * Add special case for AsyncAction
j0shuams
changed the title
Adding WinRT Diagnostics (Part 1)
Authoring Support: Add WinRT Diagnostics
Dec 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
Previously (before C#/WinRT)
Winmdexp
tool was used to generate a winmd file from C# code, for a WRC. See this link for a list of the scenariosWinmdexp
looks for.I am working on adding diagnostic checks to the C#/WinRT source generator to catch these same cases that
Winmdexp
did. As I have been working, my additions are growing in size. So, I thought it would be good to integrate them into our primary branch in pieces. For one thing, if there's any suggestions that affect the design/code in a large way, it's better to catch that now than down the road when even more code has been written.The Work
This PR includes the work to add diagnostics for users authoring C#/WinRT components. Essentially, users could write some C# code that is not valid for a Windows Runtime Component (WRC).
The code I am introducing in this PR is
DiagnosticUtils
andDiagnosticHelpers
, new files in the WinRT.SourceGenerator project that handles all of the diagnostic checksDiagnosticRules
, another new file that holds all theDiagnosticDescriptor
used for the rules (diagnostic messages)DiagnosticTests
, built with positive and negative data driven testsGenerator
file in the SourceGenerator project, with calls to my functionsContributes to #309