@@ -209,223 +209,4 @@ module Symbol =
209209if func.IsExtensionMemberthen Some() else None
210210
211211let (| Event | _ |) ( func : FSharpMemberOrFunctionOrValue ) =
212- if func.IsEventthen Some() else None
213-
214- /// Active patterns over `FSharpSymbolUse`.
215- [<RequireQualifiedAccess>]
216- module SymbolUse =
217-
218- let (| ActivePatternCase | _ |) ( symbol : FSharpSymbolUse ) =
219- match symbol.Symbolwith
220- | :? FSharpActivePatternCaseas ap-> ActivePatternCase( ap) |> Some
221- | _ -> None
222-
223- let private attributeSuffixLength = " Attribute" .Length
224-
225- let (| Entity | _ |) ( symbol : FSharpSymbolUse ) : ( FSharpEntity * (* cleanFullNames *) string list )option =
226- match symbol.Symbolwith
227- | :? FSharpEntityas ent->
228- // strip generic parameters count suffix (List`1 => List)
229- let cleanFullName =
230- // `TryFullName` for type aliases is always `None`, so we have to make one by our own
231- if ent.IsFSharpAbbreviationthen
232- [ ent.AccessPath+ " ." + ent.DisplayName]
233- else
234- ent.TryFullName
235- |> Option.toList
236- |> List.map( fun fullName ->
237- if ent.GenericParameters.Count> 0 && fullName.Length> 2 then
238- fullName.[ 0 .. fullName.Length- 3 ]
239- else fullName)
240-
241- let cleanFullNames =
242- cleanFullName
243- |> List.collect( fun cleanFullName ->
244- if ent.IsAttributeTypethen
245- [ cleanFullName; cleanFullName.[ 0 .. cleanFullName.Length- attributeSuffixLength- 1 ]]
246- else [ cleanFullName]
247- )
248- Some( ent, cleanFullNames)
249- | _ -> None
250-
251- let (| Field | _ |) ( symbol : FSharpSymbolUse ) =
252- match symbol.Symbolwith
253- | :? FSharpFieldas field-> Some field
254- | _ -> None
255-
256- let (| GenericParameter | _ |) ( symbol : FSharpSymbolUse ) =
257- match symbol.Symbolwith
258- | :? FSharpGenericParameteras gp-> Some gp
259- | _ -> None
260-
261- let (| MemberFunctionOrValue | _ |) ( symbol : FSharpSymbolUse ) =
262- match symbol.Symbolwith
263- | :? FSharpMemberOrFunctionOrValueas func-> Some func
264- | _ -> None
265-
266- let (| ActivePattern | _ |) = function
267- | MemberFunctionOrValue mwhen m.IsActivePattern-> Some m| _ -> None
268-
269- let (| Parameter | _ |) ( symbol : FSharpSymbolUse ) =
270- match symbol.Symbolwith
271- | :? FSharpParameteras param-> Some param
272- | _ -> None
273-
274- let (| StaticParameter | _ |) ( symbol : FSharpSymbolUse ) =
275- match symbol.Symbolwith
276- | :? FSharpStaticParameteras sp-> Some sp
277- | _ -> None
278-
279- let (| UnionCase | _ |) ( symbol : FSharpSymbolUse ) =
280- match symbol.Symbolwith
281- | :? FSharpUnionCaseas uc-> Some uc
282- | _ -> None
283-
284- let (| Constructor | _ |) = function
285- | MemberFunctionOrValue funcwhen func.IsConstructor|| func.IsImplicitConstructor-> Some func
286- | _ -> None
287-
288- let (| TypeAbbreviation | _ |) = function
289- | Entity( entity, _) when entity.IsFSharpAbbreviation-> Some entity
290- | _ -> None
291-
292- let (| Class | _ |) = function
293- | Entity( entity, _) when entity.IsClass-> Some entity
294- | Entity( entity, _) when entity.IsFSharp&&
295- entity.IsOpaque&&
296- not entity.IsFSharpModule&&
297- not entity.IsNamespace&&
298- not entity.IsDelegate&&
299- not entity.IsFSharpUnion&&
300- not entity.IsFSharpRecord&&
301- not entity.IsInterface&&
302- not entity.IsValueType-> Some entity
303- | _ -> None
304-
305- let (| Delegate | _ |) = function
306- | Entity( entity, _) when entity.IsDelegate-> Some entity
307- | _ -> None
308-
309- let (| Event | _ |) = function
310- | MemberFunctionOrValue symbolwhen symbol.IsEvent-> Some symbol
311- | _ -> None
312-
313- let (| Property | _ |) = function
314- | MemberFunctionOrValue symbolwhen symbol.IsProperty|| symbol.IsPropertyGetterMethod|| symbol.IsPropertySetterMethod-> Some symbol
315- | _ -> None
316-
317- let inline private notCtorOrProp ( symbol : FSharpMemberOrFunctionOrValue ) =
318- not symbol.IsConstructor&& not symbol.IsPropertyGetterMethod&& not symbol.IsPropertySetterMethod
319-
320- type FSharpSymbol with
321- member x.IsOperatorOrActivePattern =
322- let name = x.DisplayName
323- if name.StartsWith" (" && name.EndsWith" )" && name.Length> 4
324- then name.Substring( 2 , name.Length- 4 ) |> String.forall( fun c -> c<> ' ' )
325- else false
326-
327- type FSharpMemberOrFunctionOrValue with
328- member x.FullTypeSafe = try Some x.FullTypewith _ -> None
329-
330- let (| Method | _ |) ( symbolUse : FSharpSymbolUse ) =
331- match symbolUsewith
332- | MemberFunctionOrValue symbolwhen
333- symbol.IsModuleValueOrMember&&
334- not symbolUse.IsFromPattern&&
335- not symbol.IsOperatorOrActivePattern&&
336- not symbol.IsPropertyGetterMethod&&
337- not symbol.IsPropertySetterMethod-> Some symbol
338- | _ -> None
339-
340- let (| Function | _ |) ( symbolUse : FSharpSymbolUse ) =
341- match symbolUsewith
342- | MemberFunctionOrValue symbolwhen
343- notCtorOrProp symbol&&
344- symbol.IsModuleValueOrMember&&
345- not symbol.IsOperatorOrActivePattern&&
346- not symbolUse.IsFromPattern->
347-
348- match symbol.FullTypeSafewith
349- | Some fullTypewhen fullType.IsFunctionType-> Some symbol
350- | _ -> None
351- | _ -> None
352-
353- let (| Operator | _ |) ( symbolUse : FSharpSymbolUse ) =
354- match symbolUsewith
355- | MemberFunctionOrValue symbolwhen
356- notCtorOrProp symbol&&
357- not symbolUse.IsFromPattern&&
358- not symbol.IsActivePattern&&
359- symbol.IsOperatorOrActivePattern->
360-
361- match symbol.FullTypeSafewith
362- | Some fullTypewhen fullType.IsFunctionType-> Some symbol
363- | _ -> None
364- | _ -> None
365-
366- let (| Pattern | _ |) ( symbolUse : FSharpSymbolUse ) =
367- match symbolUsewith
368- | MemberFunctionOrValue symbolwhen
369- notCtorOrProp symbol&&
370- not symbol.IsOperatorOrActivePattern&&
371- symbolUse.IsFromPattern->
372-
373- match symbol.FullTypeSafewith
374- | Some fullTypewhen fullType.IsFunctionType-> Some symbol
375- | _ -> None
376- | _ -> None
377-
378- let (| ClosureOrNestedFunction | _ |) = function
379- | MemberFunctionOrValue symbolwhen
380- notCtorOrProp symbol&&
381- not symbol.IsOperatorOrActivePattern&&
382- not symbol.IsModuleValueOrMember->
383-
384- match symbol.FullTypeSafewith
385- | Some fullTypewhen fullType.IsFunctionType-> Some symbol
386- | _ -> None
387- | _ -> None
388-
389- let (| Val | _ |) = function
390- | MemberFunctionOrValue symbolwhen notCtorOrProp symbol&&
391- not symbol.IsOperatorOrActivePattern->
392- match symbol.FullTypeSafewith
393- | Some_ fullType-> Some symbol
394- | _ -> None
395- | _ -> None
396-
397- let (| Enum | _ |) = function
398- | Entity( entity, _) when entity.IsEnum-> Some entity
399- | _ -> None
400-
401- let (| Interface | _ |) = function
402- | Entity( entity, _) when entity.IsInterface-> Some entity
403- | _ -> None
404-
405- let (| Module | _ |) = function
406- | Entity( entity, _) when entity.IsFSharpModule-> Some entity
407- | _ -> None
408-
409- let (| Namespace | _ |) = function
410- | Entity( entity, _) when entity.IsNamespace-> Some entity
411- | _ -> None
412-
413- let (| Record | _ |) = function
414- | Entity( entity, _) when entity.IsFSharpRecord-> Some entity
415- | _ -> None
416-
417- let (| Union | _ |) = function
418- | Entity( entity, _) when entity.IsFSharpUnion-> Some entity
419- | _ -> None
420-
421- let (| ValueType | _ |) = function
422- | Entity( entity, _) when entity.IsValueType&& not entity.IsEnum-> Some entity
423- | _ -> None
424-
425- let (| ComputationExpression | _ |) ( symbol : FSharpSymbolUse ) =
426- if symbol.IsFromComputationExpressionthen Some symbol
427- else None
428-
429- let (| Attribute | _ |) = function
430- | Entity( entity, _) when entity.IsAttributeType-> Some entity
431- | _ -> None
212+ if func.IsEventthen Some() else None