C# Class Microsoft.R.Editor.Completion.AutoCompletion.BraceCompletionContext

Represents a simple context used to extend the default brace completion behaviors to include language-specific behaviors such as parsing and formatting.
Inheritance: IBraceCompletionContext
Mostrar archivo Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
AllowOverType ( IBraceCompletionSession session ) : bool

Called by the editor when the closing brace character has been typed.

The closing brace character will not be inserted into the buffer until after this returns. Does not occur if there is any non-whitespace between the caret and the closing brace. Language-specific decisions may be made here to take into account scenarios such as an escaped closing char.

BraceCompletionContext ( IEditorShell shell ) : Microsoft.Languages.Editor.Shell
Finish ( IBraceCompletionSession session ) : void

Called after the session has been removed from the stack.

OnReturn ( IBraceCompletionSession session ) : void

Called by the editor when return is pressed while both braces are on the same line and no typing has occurred in the session.

Called after the newline has been inserted into the buffer. Formatting for scenarios where the closing brace needs to be moved down an additional line past the caret should be done here.

Start ( IBraceCompletionSession session ) : void

Called before the session is added to the stack.

If additional formatting is required for the opening or closing brace it should be done here.

Private Methods

Method Description
EnsureTreeReady ( ITextBuffer subjectBuffer ) : void

Method Details

AllowOverType() public method

Called by the editor when the closing brace character has been typed.
The closing brace character will not be inserted into the buffer until after this returns. Does not occur if there is any non-whitespace between the caret and the closing brace. Language-specific decisions may be made here to take into account scenarios such as an escaped closing char.
public AllowOverType ( IBraceCompletionSession session ) : bool
session IBraceCompletionSession Default brace completion session
return bool

BraceCompletionContext() public method

public BraceCompletionContext ( IEditorShell shell ) : Microsoft.Languages.Editor.Shell
shell IEditorShell
return Microsoft.Languages.Editor.Shell

Finish() public method

Called after the session has been removed from the stack.
public Finish ( IBraceCompletionSession session ) : void
session IBraceCompletionSession Default brace completion session
return void

OnReturn() public method

Called by the editor when return is pressed while both braces are on the same line and no typing has occurred in the session.
Called after the newline has been inserted into the buffer. Formatting for scenarios where the closing brace needs to be moved down an additional line past the caret should be done here.
public OnReturn ( IBraceCompletionSession session ) : void
session IBraceCompletionSession Default brace completion session
return void

Start() public method

Called before the session is added to the stack.
If additional formatting is required for the opening or closing brace it should be done here.
public Start ( IBraceCompletionSession session ) : void
session IBraceCompletionSession Default brace completion session
return void