ITextViewSnapshot Interface

Definition

Provides immutable, read access to properties of a text editor remoted from the host Visual Studio.

public interface ITextViewSnapshot : IDisposable, Microsoft.VisualStudio.Extensibility.Editor.IEditable<Microsoft.VisualStudio.Extensibility.Editor.ITextViewEditor>
type ITextViewSnapshot = interface
    interface IDisposable
    interface IEditable<ITextViewEditor>
Public Interface ITextViewSnapshot
Implements IDisposable, IEditable(Of ITextViewEditor)
Implements

Remarks

ITextViewSnapshot represents an editor at a point in time and does not change. Most IDE features will be invoked with an ITextViewSnapshot with the state of the editor when the feature was invoked.

ITextViewSnapshot is not directly mutable. Any changes must be requested via EditorExtensibility.EditAsync(System.Action<IEditBatch>, System.Threading.CancellationToken)

Properties

Document

Gets the document associated with this text editor. The document will be the same for the entire lifetime of this text editor.

FilePath

The LocalPath of this document's Uri.

RpcContract

Converts this thick object to a serializable representation for use in an RPC call.

Selection

The primary selection on this text view. Shorthand for this.Selections[0].

Selections

The selections in this text view. The primary selection is always at index 0.

Uri

The Uri of the document. Most frequently the name and path of the file on disk.

Methods

AsEditable(IEditBatch)

Gets an interface with methods for requesting changes to the underlying IEditable<TEditor> object.

(Inherited from IEditable<TEditor>)
GetOptionValueAsync<T>(TextDocumentOption<T>, CancellationToken)

Gets an editor option value based on the scope of text document in this view.

GetOptionValueAsync<T>(TextViewOption<T>, CancellationToken)

Gets an editor option value based on the current text view scope.

Applies to