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

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

int? ArgumentIndex { get; }

Property Value

int?

ArgumentListSnapshotOffset

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

TextSnapshotOffset? ArgumentListSnapshotOffset { get; }

Property Value

TextSnapshotOffset?

ArgumentSnapshotOffset

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

TextSnapshotOffset? ArgumentSnapshotOffset { get; }

Property Value

TextSnapshotOffset?

ContainingAstNode

The IAstNode that contains the SnapshotOffset.

IAstNode? ContainingAstNode { get; }

Property Value

IAstNode

InitializationSnapshotRange

The TextSnapshotRange with which the context was initialized.

TextSnapshotRange? InitializationSnapshotRange { get; }

Property Value

TextSnapshotRange?

Kind

The PythonContextKind indicating the kind of context.

PythonContextKind Kind { get; }

Property Value

PythonContextKind

Location

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

IPythonContextLocation? Location { get; }

Property Value

IPythonContextLocation

Project

The IProject with which this context is associated.

IProject? Project { get; }

Property Value

IProject

SnapshotOffset

The TextSnapshotOffset for which this context was created.

TextSnapshotOffset SnapshotOffset { get; }

Property Value

TextSnapshotOffset

TargetExpression

The target AST Expression for the context, if known.

Expression? TargetExpression { get; }

Property Value

Expression

TargetSnapshotOffset

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

TextSnapshotOffset? TargetSnapshotOffset { get; }

Property Value

TextSnapshotOffset?

Methods

Resolve()

Uses the IResolver on the Project to return an IResolverResultSet.

IResolverResultSet? Resolve()

Returns

IResolverResultSet:

The IResolverResultSet that was returned by the resolver.

Extension Methods