-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add Microsoft.CodeAnalysis.Contracts source package #76997
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
Conversation
|
@dotnet/roslyn-ide @dotnet/roslyn-compiler PTAL |
That sounds reasonable to me, for consistency with the current state. Then we can discuss separately whether to include the |
820f4fe to
948d2ea
Compare
948d2ea to
32af181
Compare
| <Compile Include="$(MSBuildThisFileDirectory)NullableAttributes.cs" /> | ||
| <Compile Include="$(MSBuildThisFileDirectory)RequiredMemberAttribute.cs" /> | ||
| <Compile Include="$(MSBuildThisFileDirectory)SetsRequiredMembersAttribute.cs" /> | ||
| <Compile Include="$(MSBuildThisFileDirectory)ExceptionUtilities.cs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not include glob *.cs rather than explicitly including each file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glob works but next time you edit the project VS screws it up :(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JakeRadMSFT Can we get this fixed please? dotnet/project-system#6010
Working with shared projects in VS is such a PITA.
The package is intended to include a small number of essential contracts and polyfills used across Roslyn code base and in other Roslyn source packages (see #76937).
Introduction of this package simplifies the set of file links in Roslyn repository, makes it easier to apply Roslyn coding patterns across other related repositories (e.g. dotnet-watch, Razor, WebTools, Interactive Window, etc) and to use other Roslyn source packages in these repositories.
Moves all non-polyfill types to
Microsoft.CodeAnalysisnamespace (instead ofRoslyn.Utilities). This move makes these core types immediately available in all Roslyn types defined inMicrosoft.CodeAnalysisnamespace or a subnamespace.For
Contracttype, it avoids accidental mix-up withMicrosoft.Diagnostics.Contracts.Contracttype in non-VS layer, which doesn't benefit since it defines types underMicrosoft.VisualStudionamespace.TODO:
Contracttype is not currently available in Compiler layer (only Workspace and up). We can use#if !MICROSOFT_CODEANALYSIS_CONTRACTS_NO_CONTRACTto keep it that way if desired.ExceptionUtilities.UnreachableandExceptionUtilities.UnexpectedValuemethods toContracttype. These helpers declare code contracts/assertions similar to those expressed byThrow*methods inContractclass.