In This Article

IResolver Interface

Provides the base requirements of a Python language resolver.

public interface IResolver

Properties

MaximumImportRecursionLevel

Gets the maximum number of recursions that can be made when examining imports into other packages/modules.

int MaximumImportRecursionLevel { get; set; }

Property Value

int:

The maximum number of recursions that can be made when examining imports into other packages/modules. The default value is 10.

Remarks

Reducing this level can improve the time required to examine large packages that involve a lot import recursions, however it could also then lead to a subset of the real resolver results.

Project

Gets the IProject for which this resolver was created.

IProject Project { get; }

Property Value

IProject:

The IProject for which this resolver was created.

UnknownReturnTypeReferenceCallback

Gets or sets a callback that is invoked when examining an IReflectionDefinition with an unknown return type.

Func<IReflectionDefinition, ITypeReference> UnknownReturnTypeReferenceCallback { get; set; }

Property Value

Func<IReflectionDefinition, ITypeReference>:

A callback that is invoked when examining an IReflectionDefinition with an unknown return type.

Remarks

Callback implementations should examine the IReflectionDefinition and return an appropriate ITypeReference that references the return type, if the return type is known.

Methods

LoadAndResolveModule(string, CompilationUnit, bool)

Loads a module and attempts to resolve the return types of its members.

IModuleDefinition LoadAndResolveModule(string path, CompilationUnit compUnit, bool allowExternalModuleLookup)
Parameter Type Description
path string

The path to the module file.

compUnit CompilationUnit

The CompilationUnit to examine.

allowExternalModuleLookup bool

Whether external module lookup is allowed during resolution.

Returns

IModuleDefinition:

The IModuleDefinition that was loaded.

Resolve(IResolverRequest)

Performs a resolve operation on the specified IResolverRequest to an IResolverResultSet.

IResolverResultSet Resolve(IResolverRequest request)
Parameter Type Description
request IResolverRequest

The IResolverRequest to process.

Returns

IResolverResultSet:

An IResolverResultSet containing the results.