in ReSharper.FSharp/src/FSharp/FSharp.Psi/src/Features/Daemon/FSharpSymbolHighlightingUtil.cs [52:95]
public static string GetMfvHighlightingAttributeId([NotNull] this FSharpMemberOrFunctionOrValue mfv)
{
if (mfv.IsEvent || mfv.IsEventAddMethod || mfv.IsEventRemoveMethod || mfv.EventForFSharpProperty != null)
return FSharpHighlightingAttributeIdsModule.Event;
if (mfv.IsImplicitConstructor || mfv.IsConstructor)
return mfv.DeclaringEntity?.Value is { IsValueType: true }
? FSharpHighlightingAttributeIdsModule.Struct
: FSharpHighlightingAttributeIdsModule.Class;
var entity = mfv.DeclaringEntity;
if (mfv.IsMember && (entity != null && !entity.Value.IsFSharpModule || mfv.IsExtensionMember))
if (mfv.IsProperty || mfv.IsPropertyGetterMethod || mfv.IsPropertySetterMethod)
return mfv.IsExtensionMember
? FSharpHighlightingAttributeIdsModule.ExtensionProperty
: FSharpHighlightingAttributeIdsModule.Property;
else
return mfv.IsExtensionMember
? FSharpHighlightingAttributeIdsModule.ExtensionMethod
: FSharpHighlightingAttributeIdsModule.Method;
if (mfv.LiteralValue != null)
return FSharpHighlightingAttributeIdsModule.Literal;
if (mfv.IsActivePattern)
return FSharpHighlightingAttributeIdsModule.ActivePatternCase;
if (IsLogicalOpName(mfv.LogicalName))
return FSharpHighlightingAttributeIdsModule.Operator;
var fcsType = mfv.FullType;
if (fcsType.IsFunctionType || mfv.IsTypeFunction || fcsType.IsAbbreviation && fcsType.AbbreviatedType.IsFunctionType)
return mfv.IsMutable
? FSharpHighlightingAttributeIdsModule.MutableFunction
: FSharpHighlightingAttributeIdsModule.Function;
if (mfv.IsMutable || mfv.IsRefCell())
return FSharpHighlightingAttributeIdsModule.MutableValue;
if (fcsType.HasTypeDefinition && fcsType.TypeDefinition is var mfvTypeEntity && mfvTypeEntity.IsByRef)
return FSharpHighlightingAttributeIdsModule.MutableValue;
return FSharpHighlightingAttributeIdsModule.Value;
}