C# Class Emmet.Engine.EmmetEditorCallbacks

Implementation of IEmmetEditor interface for JavaScript engine. See https://github.com/emmetio/emmet/blob/master/lib/interfaces/IEmmetEditor.js for details.
ファイルを表示 Open project: sergey-rybalkin/emmet.net Class Usage Examples

Public Methods

Method Description
Attach ( IEmmetEditor editor ) : bool

Attaches this instance to the given code editor.

CreateSelection ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Creates selection from start to end character indexes. If end is omitted, this method should place caret and start index.

Detach ( ) : void

Detaches this instance from the editor window, cleans up any internal caches.

GetCarretPos ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns current caret position.

GetContent ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callbacks. Returns the content of the current editor window.

GetCurrentLine ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns the content of the current line.

GetCurrentLineRange ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns current line's start and end indexes as object with start and end properties.

GetFilePath ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns current editor's file path.

GetProfileName ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns current output profile name (see profile module). In most cases, this method should return null and let Emmet guess best profile name for current syntax and user data. In case you’re using advanced editor with access to syntax scopes (like Sublime Text 2), you can return syntax name for current scope. For example, you may return `line` profile when editor caret is inside string of programming language.

GetSelection ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns current selection.

GetSelectionRange ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns character indexes of selected text: object with start and end properties.If there's no selection, should return object with start and end properties referring to current caret position.

GetSyntax ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Returns current editor's syntax mode.

Prompt ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Asks user to enter something.

ReplaceContent ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Replace editor's content or it's part (from start to end index). If value contains caret_placeholder, the editor will put caret into this position. If you skip start and end arguments, the whole target's content will be replaced with value. If you pass start argument only, the value will be placed at start string index of current content. If you pass start and end arguments, the corresponding substring of current target's content will be replaced with value.

SetCarretPos ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle

JavaScript callback. Set new caret position.

Method Details

Attach() public method

Attaches this instance to the given code editor.
public Attach ( IEmmetEditor editor ) : bool
editor IEmmetEditor Editor to attach to.
return bool

CreateSelection() public method

JavaScript callback. Creates selection from start to end character indexes. If end is omitted, this method should place caret and start index.
public CreateSelection ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

Detach() public method

Detaches this instance from the editor window, cleans up any internal caches.
public Detach ( ) : void
return void

GetCarretPos() public method

JavaScript callback. Returns current caret position.
public GetCarretPos ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetContent() public method

JavaScript callbacks. Returns the content of the current editor window.
public GetContent ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetCurrentLine() public method

JavaScript callback. Returns the content of the current line.
public GetCurrentLine ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetCurrentLineRange() public method

JavaScript callback. Returns current line's start and end indexes as object with start and end properties.
public GetCurrentLineRange ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetFilePath() public method

JavaScript callback. Returns current editor's file path.
public GetFilePath ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetProfileName() public method

JavaScript callback. Returns current output profile name (see profile module). In most cases, this method should return null and let Emmet guess best profile name for current syntax and user data. In case you’re using advanced editor with access to syntax scopes (like Sublime Text 2), you can return syntax name for current scope. For example, you may return `line` profile when editor caret is inside string of programming language.
public GetProfileName ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetSelection() public method

JavaScript callback. Returns current selection.
public GetSelection ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetSelectionRange() public method

JavaScript callback. Returns character indexes of selected text: object with start and end properties.If there's no selection, should return object with start and end properties referring to current caret position.
public GetSelectionRange ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

GetSyntax() public method

JavaScript callback. Returns current editor's syntax mode.
public GetSyntax ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

Prompt() public method

JavaScript callback. Asks user to enter something.
public Prompt ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

ReplaceContent() public method

JavaScript callback. Replace editor's content or it's part (from start to end index). If value contains caret_placeholder, the editor will put caret into this position. If you skip start and end arguments, the whole target's content will be replaced with value. If you pass start argument only, the value will be placed at start string index of current content. If you pass start and end arguments, the corresponding substring of current target's content will be replaced with value.
public ReplaceContent ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle

SetCarretPos() public method

JavaScript callback. Set new caret position.
public SetCarretPos ( V8Engine engine, bool isConstructCall, InternalHandle self ) : InternalHandle
engine V8.Net.V8Engine
isConstructCall bool
self InternalHandle
return InternalHandle