Skip to content

Expose DeclarationModifiers.Fixed publicly #78861

Open
@DoctorKrolic

Description

@DoctorKrolic

Background and Motivation

DeclarationModifiers is publicly available for code generation related workflows and contains all possible declaration modifiers. Previously it was missing fixed modifier as it is quite rare in the wild. However, after a bug discovery it was added as an internal API in #78698. I don't see much reason in keeping it internal.

Proposed API

namespace Microsoft.CodeAnalysis.Editing;

public readonly record struct DeclarationModifiers
{
+    public bool IsFixed { get; }
+    public DeclarationModifiers WithIsFixed(bool isFixed)

+    public static DeclarationModifiers Fixed { get; }
}

Usage Examples

#78698

Alternative Designs

Risks

None I can think of

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CompilersConcept-APIThis issue involves adding, removing, clarification, or modification of an API.Feature RequestuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions