@@ -340,37 +340,89 @@ module ExtensionTyping =
340
340
/// Check if this is a direct reference to a non-embedded generated type. This is not permitted at any name resolution.
341
341
/// We check by seeing if the type is absent from the remapping context.
342
342
val internal IsGeneratedTypeDirectReference : Tainted < ProvidedType > * range -> bool
343
-
343
+
344
+ /// The public API hook for instantiating type providers and getting provided types.
344
345
[< AutoOpen >]
345
346
module Shim =
346
347
348
+ /// Context for instantiating type providers.
347
349
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.
349
354
DesignerAssemblyName: string
355
+ /// Type providers resolution environment.
350
356
ResolutionEnvironment: ResolutionEnvironment
357
+ /// Is invalidation supported for type providers.
351
358
IsInvalidationSupported: bool
359
+ /// Is instantiation called from F# interactive.
352
360
IsInteractive: bool
361
+ /// Query information about types available in target system runtime library.
353
362
SystemRuntimeContainsType: string -> bool
363
+ /// System.Runtime assembly version
354
364
SystemRuntimeAssemblyVersion: Version
365
+ /// Compiler tools path
355
366
CompilerToolsPath: string list
367
+ /// Error logging function
356
368
LogError: TypeProviderError -> unit
369
+ /// Range
357
370
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>
359
380
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>
364
401
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>
366
410
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>
368
418
abstract DisplayNameOfTypeProvider: typeProvider : ITypeProvider * fullName : bool -> string
369
419
420
+ /// Default IExtensionTypingProvider implementation for creating type providers in the current FCS process.
370
421
[<Sealed>]
371
422
type DefaultExtensionTypingProvider =
372
423
interface IExtensionTypingProvider
373
424
425
+ /// IExtensionTypingProvider implementation currently used by FCS.
374
426
val mutable ExtensionTypingProvider : IExtensionTypingProvider
375
427
376
428
#endif
0 commit comments