In This Article

RangeOutliningSourceBase Class

Provides an abstract IOutliningSource implementation that constructs outlining node data based on designated node ranges, which are generally obtained from parser results such as an AST (abstract syntax tree).

public abstract class RangeOutliningSourceBase : IOutliningSource
Inheritance:
object object
Derived:
CSharpOutliningSource JavaScriptOutliningSource JsonOutliningSource PythonOutliningSource VBOutliningSource
Implements:
IOutliningSource

Constructors

RangeOutliningSourceBase(ITextSnapshot)

Initializes the RangeOutliningSourceBase class.

protected RangeOutliningSourceBase(ITextSnapshot snapshot)
Parameter Type Description
snapshot ITextSnapshot

The ITextSnapshot to use for this outlining source.

Methods

AddNode(TextRange, IOutliningNodeDefinition)

Marks that the TextRange is a closed node (has start and proper end) with the specified IOutliningNodeDefinition.

public virtual void AddNode(TextRange textRange, IOutliningNodeDefinition definition)
Parameter Type Description
textRange TextRange

The TextRange for the node.

definition IOutliningNodeDefinition

The IOutliningNodeDefinition to use for the node.

AddOpenNode(int, IOutliningNodeDefinition)

Marks that the TextRange is an open node (has start, but no proper end) with the specified IOutliningNodeDefinition.

public virtual void AddOpenNode(int startOffset, IOutliningNodeDefinition definition)
Parameter Type Description
startOffset int

The start offset for the node.

definition IOutliningNodeDefinition

The IOutliningNodeDefinition to use for the node.

GetNodeAction(ref int, out IOutliningNodeDefinition)

Returns information about the action to take when incrementally updating automatic outlining for a particular offset.

public virtual OutliningNodeAction GetNodeAction(ref int offset, out IOutliningNodeDefinition definition)
Parameter Type Description
offset int

The offset to examine. For improved incremental outlining performance, it can be modified to indicate the next meaningful offset for the source.

definition IOutliningNodeDefinition

If the node action indicated is a start or end, an IOutliningNodeDefinition describing the related node must be returned.

Returns

OutliningNodeAction:

An OutliningNodeAction indicating the action to take for the offset.

TranslateTo(ITextSnapshot)

Translates the outlining data to the specified ITextSnapshot.

public void TranslateTo(ITextSnapshot targetSnapshot)
Parameter Type Description
targetSnapshot ITextSnapshot

The target ITextSnapshot.

Inherited Members