In This Article

IPythonContext Interface

Provides the base requirements for information about a Python language context of a certain offset within an ITextSnapshot.

public interface IPythonContext

Properties

ArgumentIndex

Gets the index of the current argument, if known, when the context is for the containing invocation.

int? ArgumentIndex { get; }

Property Value

int?:

The index of the current argument, if known, when the context is for the containing invocation.

ArgumentListSnapshotOffset

Gets the TextSnapshotOffset of the argument list, if known, when the context is for the containing invocation.

TextSnapshotOffset? ArgumentListSnapshotOffset { get; }

Property Value

TextSnapshotOffset?:

The TextSnapshotOffset of the argument list, if known, when the context is for the containing invocation.

ArgumentSnapshotOffset

Gets the TextSnapshotOffset of the current argument, if known, when the context is for the containing invocation.

TextSnapshotOffset? ArgumentSnapshotOffset { get; }

Property Value

TextSnapshotOffset?:

The TextSnapshotOffset of the current argument, if known, when the context is for the containing invocation.

ContainingAstNode

Gets the IAstNode that contains the SnapshotOffset.

IAstNode ContainingAstNode { get; }

Property Value

IAstNode:

The IAstNode that contains the SnapshotOffset.

InitializationSnapshotRange

Gets the TextSnapshotRange with which the context was initialized.

TextSnapshotRange? InitializationSnapshotRange { get; }

Property Value

TextSnapshotRange?:

The TextSnapshotRange with which the context was initialized.

Kind

Gets the PythonContextKind indicating the kind of context.

PythonContextKind Kind { get; }

Property Value

PythonContextKind:

The PythonContextKind indicating the kind of context.

Location

Gets an optional IPythonContextLocation that provides more location information about the context.

IPythonContextLocation Location { get; }

Property Value

IPythonContextLocation:

An optional IPythonContextLocation that provides more location information about the context.

Project

Gets the IProject with which this context is associated.

IProject Project { get; }

Property Value

IProject:

The IProject with which this context is associated.

SnapshotOffset

Gets the TextSnapshotOffset for which this context was created.

TextSnapshotOffset SnapshotOffset { get; }

Property Value

TextSnapshotOffset:

The TextSnapshotOffset for which this context was created.

TargetExpression

Gets the target AST Expression for the context, if known.

Expression TargetExpression { get; }

Property Value

Expression:

The target AST Expression for the context, if known.

TargetSnapshotOffset

Gets the TextSnapshotOffset, if known, against which to use as context for the resolver.

TextSnapshotOffset? TargetSnapshotOffset { get; }

Property Value

TextSnapshotOffset?:

The TextSnapshotOffset, if known, against which to use as context for the resolver.

Methods

Resolve()

Uses the IResolver on the Project to return an IResolverResultSet.

IResolverResultSet Resolve()

Returns

IResolverResultSet:

The IResolverResultSet that was returned by the resolver.