File: src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISymbolExtensions.cs
Web Access
Project: src\src\CodeStyle\Core\CodeFixes\Microsoft.CodeAnalysis.CodeStyle.Fixes.csproj (Microsoft.CodeAnalysis.CodeStyle.Fixes)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
 
#if CODE_STYLE
using Microsoft.CodeAnalysis.Internal.Editing;
#else
using Microsoft.CodeAnalysis.Editing;
#endif
 
namespace Microsoft.CodeAnalysis.Shared.Extensions;
 
internal static partial class ISymbolExtensions
{
    public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
    {
        return new DeclarationModifiers(
            isStatic: symbol.IsStatic,
            isAbstract: symbol.IsAbstract,
            isUnsafe: symbol.RequiresUnsafeModifier(),
            isVirtual: symbol.IsVirtual,
            isOverride: symbol.IsOverride,
            isSealed: symbol.IsSealed,
            isRequired: symbol.IsRequired());
    }
}