C# Class Microsoft.R.Editor.Completion.RCompletionController

R-specific completion controller. Initiates, commits or dismisses completion, signature and parameter help sessions depending on what was typed and the current editor context.
Inheritance: Microsoft.Languages.Editor.Completion.CompletionController
显示文件 Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
CommitCompletionSession ( char typedCharacter ) : bool
ConnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void

Called when text buffer becomes visible in the text view. The buffer may not be a top-level buffer in the graph and may be projected into view.

Create ( ITextView textView, IList subjectBuffers, ICompletionBroker completionBroker, IQuickInfoBroker quickInfoBroker, ISignatureHelpBroker signatureBroker, ICoreShell shell ) : RCompletionController
Detach ( ITextView textView ) : void
DisconnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void

Called when text buffer becomes invisible in the text view. The buffer may not be a top-level buffer in the graph and may be projected into view. Typically called when document is closed or buffer is removed from the view buffer graph.

FromTextView ( ITextView textView ) : RCompletionController
IsCommitChar ( char typedChar ) : bool

Should this key commit a completion session?

IsMuteCharacter ( char typedCharacter ) : bool
IsTriggerChar ( char typedCharacter ) : bool

Should this key press trigger a completion session?

OnPostTypeChar ( char typedCharacter ) : void

Called after character is typed. Gives language-specific completion controller has a chance to dismiss or initiate completion and paramenter help sessions depending on the current context.

OnPreTypeChar ( char typedCharacter ) : bool

Called before character type is passed down to the core editor along the controll chain. Gives language-specific controller a chance to initiate different action and potentially 'eat' the character. For example, in R typing 'abc[TAB] should bring up intellisense list rather than actually insert the tab character.

TriggerSignatureHelp ( ) : void

Overrides default session since we want to track signature as caret moves. Default signature session dismisses when caret changes position.

Protected Methods

Method Description
CanDismissSignatureOnCommit ( ) : bool
IsRetriggerChar ( ICompletionSession session, char typedCharacter ) : bool

Determines if character is a re-trigger one. Re-trigger means 'commit and trigger again' such as when user hits $ that commits current session for the class/object and trigger it again for object members.

OnCompletionSessionCommitted ( object sender, EventArgs eventArgs ) : void
UpdateInsertionText ( ) : void

Updates insertion text so it excludes final commit character

Private Methods

Method Description
RCompletionController ( ITextView textView, IList subjectBuffers, ICompletionBroker completionBroker, IQuickInfoBroker quickInfoBroker, ISignatureHelpBroker signatureBroker, ICoreShell shell ) : System
TryInsertRoxygenBlock ( ) : bool

Method Details

CanDismissSignatureOnCommit() protected method

protected CanDismissSignatureOnCommit ( ) : bool
return bool

CommitCompletionSession() public method

public CommitCompletionSession ( char typedCharacter ) : bool
typedCharacter char
return bool

ConnectSubjectBuffer() public method

Called when text buffer becomes visible in the text view. The buffer may not be a top-level buffer in the graph and may be projected into view.
public ConnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void
subjectBuffer ITextBuffer
return void

Create() public static method

public static Create ( ITextView textView, IList subjectBuffers, ICompletionBroker completionBroker, IQuickInfoBroker quickInfoBroker, ISignatureHelpBroker signatureBroker, ICoreShell shell ) : RCompletionController
textView ITextView
subjectBuffers IList
completionBroker ICompletionBroker
quickInfoBroker IQuickInfoBroker
signatureBroker ISignatureHelpBroker
shell ICoreShell
return RCompletionController

Detach() public method

public Detach ( ITextView textView ) : void
textView ITextView
return void

DisconnectSubjectBuffer() public method

Called when text buffer becomes invisible in the text view. The buffer may not be a top-level buffer in the graph and may be projected into view. Typically called when document is closed or buffer is removed from the view buffer graph.
public DisconnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void
subjectBuffer ITextBuffer
return void

FromTextView() public static method

public static FromTextView ( ITextView textView ) : RCompletionController
textView ITextView
return RCompletionController

IsCommitChar() public method

Should this key commit a completion session?
public IsCommitChar ( char typedChar ) : bool
typedChar char
return bool

IsMuteCharacter() public method

public IsMuteCharacter ( char typedCharacter ) : bool
typedCharacter char
return bool

IsRetriggerChar() protected method

Determines if character is a re-trigger one. Re-trigger means 'commit and trigger again' such as when user hits $ that commits current session for the class/object and trigger it again for object members.
protected IsRetriggerChar ( ICompletionSession session, char typedCharacter ) : bool
session ICompletionSession
typedCharacter char
return bool

IsTriggerChar() public method

Should this key press trigger a completion session?
public IsTriggerChar ( char typedCharacter ) : bool
typedCharacter char
return bool

OnCompletionSessionCommitted() protected method

protected OnCompletionSessionCommitted ( object sender, EventArgs eventArgs ) : void
sender object
eventArgs System.EventArgs
return void

OnPostTypeChar() public method

Called after character is typed. Gives language-specific completion controller has a chance to dismiss or initiate completion and paramenter help sessions depending on the current context.
public OnPostTypeChar ( char typedCharacter ) : void
typedCharacter char
return void

OnPreTypeChar() public method

Called before character type is passed down to the core editor along the controll chain. Gives language-specific controller a chance to initiate different action and potentially 'eat' the character. For example, in R typing 'abc[TAB] should bring up intellisense list rather than actually insert the tab character.
public OnPreTypeChar ( char typedCharacter ) : bool
typedCharacter char
return bool

TriggerSignatureHelp() public method

Overrides default session since we want to track signature as caret moves. Default signature session dismisses when caret changes position.
public TriggerSignatureHelp ( ) : void
return void

UpdateInsertionText() protected method

Updates insertion text so it excludes final commit character
protected UpdateInsertionText ( ) : void
return void