Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 17, 2025 21:47
using DeclarationModifiers = Microsoft.CodeAnalysis.Internal.Editing.DeclarationModifiers;
#else
using DeclarationModifiers = Microsoft.CodeAnalysis.Editing.DeclarationModifiers;
#endif
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was teh core thing i wanted to get rid of. we have DeclarationModifiers as a public API in teh workspace. We then also cloned it into an internal namespace, both to get access to internal parts of it and to pull it down to our 'analyzer/compiler' layer. That's awwful.

I've separated this out so there's a trivial enum now at hte analyzer/compiler layer. ANd only workspace/fixer/refactoring layer types access the true DeclarationModifiers type.

File = 1 << 17,
Fixed = 1 << 18,
#pragma warning restore format
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what was extracted out to the lower layer.

#if WORKSPACE
return new DeclarationModifiers(modifiers);
#else
return Unsafe.As<Modifiers, DeclarationModifiers>(ref modifiers);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugly, but simple. if we are ever worried about this, we can always write the full logic that checks each flag and creates teh final DeclarationModifiers from it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this works because DeclarationModifiers is a struct with a single field that is of type Modifiers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup!

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge June 17, 2025 22:57
@dotnet-policy-service dotnet-policy-service bot added the Needs API Review Needs to be reviewed by the API review council label Jun 18, 2025
@CyrusNajmabadi CyrusNajmabadi merged commit 6f8893d into dotnet:main Jun 18, 2025
24 of 25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the modifiers branch June 18, 2025 01:52
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jun 18, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Needs API Review Needs to be reviewed by the API review council VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants