@@ -1407,6 +1407,19 @@ type TypeCheckInfo
14071407
14081408// Not, this does not have to be a SyncOp, it can be called from any thread
14091409member scope.GetExtraColorizations () =
1410+ let (| LegitTypeOccurence | _ |) = function
1411+ | ItemOccurence.UseInType
1412+ | ItemOccurence.UseInAttribute
1413+ | ItemOccurence.Use_
1414+ | ItemOccurence.Binding_
1415+ | ItemOccurence.Pattern_ -> Some()
1416+ | _ -> None
1417+
1418+ let inline (| OptionalArgumentAttribute | _ |) ttype =
1419+ match ttypewith
1420+ | TType.TType_ app( tref, _) when tref.Stamp= g.attrib_ OptionalArgumentAttribute.TyconRef.Stamp-> Some()
1421+ | _ -> None
1422+
14101423 sResolutions.CapturedNameResolutions
14111424|> Seq.choose( fun cnr ->
14121425match cnrwith
@@ -1421,22 +1434,13 @@ type TypeCheckInfo
14211434 Some( m, FSharpTokenColorKind.Keyword)
14221435// types get colored as types when they occur in syntactic types or custom attributes
14231436// typevariables get colored as types when they occur in syntactic types custom builders, custom operations get colored as keywords
1424- | CNR(_, ( Item.TypeVar_
1425- | Item.Types_
1426- | Item.UnqualifiedType_
1427- | Item.CtorGroup_),
1428- ( ItemOccurence.UseInType
1429- | ItemOccurence.UseInAttribute
1430- | ItemOccurence.Use_
1431- | ItemOccurence.Binding_
1432- | ItemOccurence.Pattern_), _, _, _, m) ->
1437+ | CNR(_, Item.Types(_, [ OptionalArgumentAttribute]), LegitTypeOccurence, _, _, _, _) -> None
1438+ | CNR(_, Item.CtorGroup(_, [ MethInfo.FSMeth(_, OptionalArgumentAttribute, _, _)]), LegitTypeOccurence, _, _, _, _) -> None
1439+ | CNR(_, Item.Types_, LegitTypeOccurence, _, _, _, m) ->
1440+ Some( m, FSharpTokenColorKind.TypeName)
1441+ | CNR(_, ( Item.TypeVar_ | Item.UnqualifiedType_ | Item.CtorGroup_), LegitTypeOccurence, _, _, _, m) ->
14331442 Some( m, FSharpTokenColorKind.TypeName)
1434- | CNR(_, Item.ModuleOrNamespaces refs,
1435- ( ItemOccurence.UseInType
1436- | ItemOccurence.UseInAttribute
1437- | ItemOccurence.Use_
1438- | ItemOccurence.Binding_
1439- | ItemOccurence.Pattern_), _, _, _, m) when refs|> List.exists( fun x -> x.IsModule) ->
1443+ | CNR(_, Item.ModuleOrNamespaces refs, LegitTypeOccurence, _, _, _, m) when refs|> List.exists( fun x -> x.IsModule) ->
14401444 Some( m, FSharpTokenColorKind.TypeName)
14411445| _ -> None)
14421446|> Seq.toArray