[New API] IsIterator field on DeclarationModifiers type #75388
Labels
Area-IDE
Concept-API
This issue involves adding, removing, clarification, or modification of an API.
Feature Request
Background and Motivation
For quick reference the file can be found here
The purpose of this api is to solve this issue in the make member static analyzer.
C# does not have the explicit Iterator api and when using the SyntaxGenerator the modifier is dropped.
The type already has features that are language specific (ie IsUnsafe) so I would see no harm in supporting this as well.
This would bring the option for generators to create iterator methods closer to reality (not necessarily important).
Proposed API
namespace Microsoft.CodeAnalysis.Editing { public readonly record struct DeclarationModifiers { + public bool IsIterator => (_modifiers & Modifiers.Iterator ) != 0; }
This would also include the corresponding WithIterator() api.
Usage Examples
Alternative Designs
Not having the API and having language specific code in the analyzer.
Risks
Possible confusion since it only exists in VB.
The text was updated successfully, but these errors were encountered: