C# Class Emmet.Snippets.CodeSnippet

Represents a region of source code in the editor that has some tab stops in it.
Datei anzeigen Open project: sergey-rybalkin/emmet.net Class Usage Examples

Public Methods

Method Description
BeginEditSnippet ( ) : void

Moves caret to the first tab stop in the active snippet.

CreateSnippetInView ( ViewContext view, Span tabStops, int tabStopGroups ) : CodeSnippet

Creates code snippet in the specified view.

EndEditSnippet ( ) : void

Detaches this object from the target view.

GetTabStopsPositions ( ) : Span[]

Gets this snippet tab stops positions in the active text snapshot.

TryMoveToNextTabStop ( bool reverse = false ) : bool

Tries to move caret to next tab stop. Returns true if succeeded; false otherwise. False indicates that caret is not inside any of the available tab stops which indicates that tab stops tracking should be finished and this snippet should be detached from the view.

Private Methods

Method Description
CodeSnippet ( ) : Microsoft.VisualStudio.Text

Initializes a new instance of the CodeSnippet class. Constructor that prevents a default instance of this class from being created.

ConvertToTrackingSpans ( ViewContext view, Span spans ) : ITrackingSpan[]
GetLastTabStopInGroup ( int index ) : int
MoveToSpan ( ITrackingSpan span ) : void
MoveToSpan ( SnapshotSpan target ) : void

Method Details

BeginEditSnippet() public method

Moves caret to the first tab stop in the active snippet.
public BeginEditSnippet ( ) : void
return void

CreateSnippetInView() public static method

Creates code snippet in the specified view.
public static CreateSnippetInView ( ViewContext view, Span tabStops, int tabStopGroups ) : CodeSnippet
view ViewContext Editor view that contains snippet.
tabStops Span Tab stops collection.
tabStopGroups int Groups the tab stop belongs to.
return CodeSnippet

EndEditSnippet() public method

Detaches this object from the target view.
public EndEditSnippet ( ) : void
return void

GetTabStopsPositions() public method

Gets this snippet tab stops positions in the active text snapshot.
public GetTabStopsPositions ( ) : Span[]
return Span[]

TryMoveToNextTabStop() public method

Tries to move caret to next tab stop. Returns true if succeeded; false otherwise. False indicates that caret is not inside any of the available tab stops which indicates that tab stops tracking should be finished and this snippet should be detached from the view.
public TryMoveToNextTabStop ( bool reverse = false ) : bool
reverse bool Indicates whether move should be made in reverse direction.
return bool