Language Types Source Generator
A source generator providing types necessary for recent C# language features.
Features
NullableSourceGenerator
: Generates attributes for using Nullable Reference Types (C# 8 for most attributes, C# 9 forMemberNotNullAttribute
andMemberNotNullWhenAttribute
)IndexRangeSourceGenerator
: GeneratesSystem.Index
andSystem.Range
for improved indexing, slicing, and substrings (C# 8)IsExternalInitSourceGenerator
: GeneratesIsExternalInit
for using records and init-only properties (C# 9)
Installation and Use
This package can be installed by adding a package reference to TunnelVisionLabs.LanguageTypes.SourceGenerator. Current requirements:
- C# project
- PackageReference for NuGet dependencies
- Compiler version 4.0 or higher (included with Visual Studio 2022 and newer)