Skip to content

Commit 6eaf9f4

Browse files
committed
add documentation
1 parent c1afbfe commit 6eaf9f4

File tree

1 file changed

+61
-9
lines changed

1 file changed

+61
-9
lines changed

src/fsharp/ExtensionTyping.fsi

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,37 +340,89 @@ module ExtensionTyping =
340340
/// Check if this is a direct reference to a non-embedded generated type. This is not permitted at any name resolution.
341341
/// We check by seeing if the type is absent from the remapping context.
342342
val internal IsGeneratedTypeDirectReference: Tainted<ProvidedType> * range -> bool
343-
343+
344+
/// The public API hook for instantiating type providers and getting provided types.
344345
[<AutoOpen>]
345346
module Shim =
346347

348+
/// Context for instantiating type providers.
347349
type TypeProvidersInstantiationContext =
348-
{ RuntimeAssemblyFilename: string
350+
{ /// Type providers runtime component filename.
351+
RuntimeAssemblyFilename: string
352+
/// Type providers design-time component name,
353+
/// that have a class that implements ITypeProvider, and on which there is a type provider attribute.
349354
DesignerAssemblyName: string
355+
/// Type providers resolution environment.
350356
ResolutionEnvironment: ResolutionEnvironment
357+
/// Is invalidation supported for type providers.
351358
IsInvalidationSupported: bool
359+
/// Is instantiation called from F# interactive.
352360
IsInteractive: bool
361+
/// Query information about types available in target system runtime library.
353362
SystemRuntimeContainsType: string -> bool
363+
/// System.Runtime assembly version
354364
SystemRuntimeAssemblyVersion: Version
365+
/// Compiler tools path
355366
CompilerToolsPath: string list
367+
/// Error logging function
356368
LogError: TypeProviderError -> unit
369+
/// Range
357370
Range: range }
358-
371+
372+
/// <summary>
373+
/// Contains API for instantiating type providers and getting provided types.
374+
/// </summary>
375+
/// <remarks>
376+
/// This interface operates with <c>Provided-</c> wrappers and can be used to host type providers out-of-process.
377+
/// For example, in the FCS process for an IDE, the implementation of this interface can receive data from another process
378+
/// in which type providers are instantiated using <c>DefaultExtensionTypingProvider</c>.
379+
/// </remarks>
359380
type IExtensionTypingProvider =
360-
/// Find and instantiate the set of ITypeProvider components for the given assembly reference
361-
abstract InstantiateTypeProvidersOfAssembly: TypeProvidersInstantiationContext -> ITypeProvider list
362-
/// Get all provided types from provided namespace
363-
abstract GetProvidedTypes: pn: IProvidedNamespace -> ProvidedType[]
381+
/// <summary>
382+
/// Called by the FCS to find and instantiate the set of ITypeProvider components for the given assembly reference.
383+
/// </summary>
384+
/// <param name='context'>Instantiation context.</param>
385+
/// <returns>List of found and instantiated ITypeProvider components.</returns>
386+
abstract InstantiateTypeProvidersOfAssembly: context: TypeProvidersInstantiationContext -> ITypeProvider list
387+
388+
/// <summary>
389+
/// Called by the FCS to get top-level provided types from provided namespace.
390+
/// </summary>
391+
/// <param name='pn'>Provided namespace in which to search.</param>
392+
/// <returns>Top-level provided types from namespace.</returns>
393+
abstract GetProvidedTypes: pn: IProvidedNamespace -> ProvidedType[]
394+
395+
/// <summary>
396+
/// Called by the FCS to query a type provider for a type <c>name</c>.
397+
/// </summary>
398+
/// <param name='pn'>Provided namespace in which to search.</param>
399+
/// <param name='typeName'>Name of the searched type.</param>
400+
/// <returns>Resolver should return a type called <c>name</c> in namespace <c>NamespaceName</c> or <c>null</c> if the type is unknown.</returns>
364401
abstract ResolveTypeName: pn: IProvidedNamespace * typeName: string -> ProvidedType
365-
/// Get the provided invoker expression for a particular use of a method.
402+
403+
/// <summary>
404+
/// Called by the FCS to ask for an Expression tree to replace the given MethodBase with.
405+
/// </summary>
406+
/// <param name='provider'>ITypeProvider component.</param>
407+
/// <param name="methodBase">MethodBase that was given to the compiler by a type returned by a GetType(s) call.</param>
408+
/// <param name="paramExprs">Expressions that represent the parameters to this call.</param>
409+
/// <returns>An expression that the compiler will use in place of the given method base.</returns>
366410
abstract GetInvokerExpression: provider: ITypeProvider * methodBase: ProvidedMethodBase * paramExprs: ProvidedVar[] -> ProvidedExpr
367-
/// Get the string to show for the name of a type provider
411+
412+
/// <summary>
413+
/// Get the name of the type provider to display in error messages.
414+
/// </summary>
415+
/// <param name='typeProvider'>ITypeProvider component.</param>
416+
/// <param name='fullName'>Get full name including namespace.</param>
417+
/// <returns>Type provider name.</returns>
368418
abstract DisplayNameOfTypeProvider: typeProvider: ITypeProvider * fullName: bool -> string
369419

420+
/// Default IExtensionTypingProvider implementation for creating type providers in the current FCS process.
370421
[<Sealed>]
371422
type DefaultExtensionTypingProvider =
372423
interface IExtensionTypingProvider
373424

425+
/// IExtensionTypingProvider implementation currently used by FCS.
374426
val mutable ExtensionTypingProvider: IExtensionTypingProvider
375427

376428
#endif

0 commit comments

Comments
 (0)