C# Class Microsoft.Languages.Editor.Completion.CompletionController

Base completion controller. Not language specific.
Inheritance: IIntellisenseController
Exibir arquivo Open project: Microsoft/RTVS

Public Methods

Method Description
CommitCompletionSession ( ) : bool

Close the completion dropdown, commit the selected item to the text view.

CommitCompletionSession ( char typedCharacter ) : bool

Close the completion dropdown, commit the selected item to the text view. Used when typing a char, use the one without a typed char for CompleteWord command

ConnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void
Detach ( ITextView textView ) : void
DisconnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void
DismissAllSessions ( ) : void

Close any sessions that I am showing

DismissCompletionSession ( ) : void

Close the completion dropdown, don't make any changes

DismissQuickInfoSession ( ITextView textView ) : void
DismissSignatureSession ( ITextView textView, ICoreShell shell ) : void
FilterCompletionSession ( ) : void

Restricts the set of completions to those that match the applicability text of the completion set, and then determines the best match. R is case-sensitive so 't' is different from 'T' (the latter is a shortcut for 'TRUE').

HandleCommand ( System.Guid group, int id, object inputArg ) : bool

Allows custom completion presenters to intercept commands

HasActiveSignatureSession ( ITextView textView, ICoreShell shell ) : bool

Is there an active signature help session? (is the tooltip showing?)

IsClosingChar ( char typedCharacter ) : bool

In some languages completion needs to know if a character is a 'closing' character. Closing character typically tells if user finished typing certain fragment. This might be semicolon in C# or JScript, closing angle bracked in HTML etc. Upon closing character language may choose to autoformat code, dismiss intellisense or change intellisense presenter.

IsCommitChar ( char typedCharacter ) : bool

Should this key press commit a completion session?

IsMuteCharacter ( char typedCharacter ) : bool

True if character should be 'eaten' when session completes rather than passed to the core editor controller. For example, '=' symbol is ignored in HTML completion since on = HTML editor inserts ="" which already contains equals.

IsTriggerChar ( char typedCharacter ) : bool

Should this key press start a completion session?

OnCompleteWord ( ) : void

Called when the user executes a command that should show the completion list, and also automatically completes the current word if possible

OnPostTypeChar ( char typedCharacter ) : void

Called when the user types a character, after it shows up in the text view

OnPreTypeChar ( char typedCharacter ) : bool

Called when the user types a character, but before it shows up in the text view.

OnShowMemberList ( bool filterList ) : void

Called when the user executes a command that should show the completion list

OnShowQuickInfo ( ) : void

Called when the user executes a command that should show the signature help tooltip

OnShowSignatureHelp ( ) : void

Called when the user executes a command that should show the signature help tooltip

ShowCompletion ( bool autoShownCompletion ) : ICompletionSession

Show the completion dropdown if it isn't showing already

ShowSignature ( bool autoShown ) : void

Shows the signature help tooltip if it isn't showing already

TriggerCompletion ( ) : ICompletionSession
TriggerSignatureHelp ( ) : void

Protected Methods

Method Description
CanCommitCompletionSession ( char typedCharacter ) : bool
CanDismissSignatureOnCommit ( ) : bool
CommitUniqueCompletionSession ( ) : void

Only commit the completion selection if there is a unique choice in the list

HasActiveSignatureSession ( ITextView textView ) : bool
IsAutoShownCompletion ( ) : bool

Determines if current completion session is automatically invoked such as when user types a trigger character. Oppisite is when user explicitly invokes Edit > Intellisense > Show Members or similar command such as Ctrl+J or Ctrl+Space.

IsRetriggerChar ( ICompletionSession session, char typedCharacter ) : bool

If completion is already showing, should this keypress start a new session?

OnCompletionSessionCommitted ( object sender, EventArgs eventArgs ) : void
OnCompletionSessionDismissed ( object sender, EventArgs eventArgs ) : void
OnPostTypeClosingChar ( char typedCharacter ) : void

Invoked if user typed a closing character. IsClosingChar

OnPostTypeCompletionChar ( char typedCharacter ) : void
OnPreTypeCompletionChar ( char typedCharacter ) : void
ShowSignatureAndCompletion ( bool autoShownSignature, bool autoShownCompletion ) : void

The signature and completion MUST be shown in a specific order, so use this function to get the order correct.

UpdateInsertionText ( ) : void

Gives derived controllers a chance to update CompletionSession.SelectedCompletionSet.SelectionStatus.Completion.InsertionText

Private Methods

Method Description
ClearCompletionSession ( ) : void
CompletionController ( ITextView textView, IList subjectBuffers, ICompletionBroker completionBroker, IQuickInfoBroker quickInfoBroker, ISignatureHelpBroker signatureBroker, ICoreShell shell ) : System

Method Details

CanCommitCompletionSession() protected method

protected CanCommitCompletionSession ( char typedCharacter ) : bool
typedCharacter char
return bool

CanDismissSignatureOnCommit() protected method

protected CanDismissSignatureOnCommit ( ) : bool
return bool

CommitCompletionSession() public method

Close the completion dropdown, commit the selected item to the text view.
public CommitCompletionSession ( ) : bool
return bool

CommitCompletionSession() public method

Close the completion dropdown, commit the selected item to the text view. Used when typing a char, use the one without a typed char for CompleteWord command
public CommitCompletionSession ( char typedCharacter ) : bool
typedCharacter char
return bool

CommitUniqueCompletionSession() protected method

Only commit the completion selection if there is a unique choice in the list
protected CommitUniqueCompletionSession ( ) : void
return void

ConnectSubjectBuffer() public abstract method

public abstract ConnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void
subjectBuffer ITextBuffer
return void

Detach() public method

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

DisconnectSubjectBuffer() public abstract method

public abstract DisconnectSubjectBuffer ( ITextBuffer subjectBuffer ) : void
subjectBuffer ITextBuffer
return void

DismissAllSessions() public method

Close any sessions that I am showing
public DismissAllSessions ( ) : void
return void

DismissCompletionSession() public method

Close the completion dropdown, don't make any changes
public DismissCompletionSession ( ) : void
return void

DismissQuickInfoSession() public method

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

DismissSignatureSession() public static method

public static DismissSignatureSession ( ITextView textView, ICoreShell shell ) : void
textView ITextView
shell ICoreShell
return void

FilterCompletionSession() public method

Restricts the set of completions to those that match the applicability text of the completion set, and then determines the best match. R is case-sensitive so 't' is different from 'T' (the latter is a shortcut for 'TRUE').
public FilterCompletionSession ( ) : void
return void

HandleCommand() public method

Allows custom completion presenters to intercept commands
public HandleCommand ( System.Guid group, int id, object inputArg ) : bool
group System.Guid
id int
inputArg object
return bool

HasActiveSignatureSession() protected method

protected HasActiveSignatureSession ( ITextView textView ) : bool
textView ITextView
return bool

HasActiveSignatureSession() public static method

Is there an active signature help session? (is the tooltip showing?)
public static HasActiveSignatureSession ( ITextView textView, ICoreShell shell ) : bool
textView ITextView
shell ICoreShell
return bool

IsAutoShownCompletion() protected method

Determines if current completion session is automatically invoked such as when user types a trigger character. Oppisite is when user explicitly invokes Edit > Intellisense > Show Members or similar command such as Ctrl+J or Ctrl+Space.
protected IsAutoShownCompletion ( ) : bool
return bool

IsClosingChar() public method

In some languages completion needs to know if a character is a 'closing' character. Closing character typically tells if user finished typing certain fragment. This might be semicolon in C# or JScript, closing angle bracked in HTML etc. Upon closing character language may choose to autoformat code, dismiss intellisense or change intellisense presenter.
public IsClosingChar ( char typedCharacter ) : bool
typedCharacter char
return bool

IsCommitChar() public method

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

IsMuteCharacter() public method

True if character should be 'eaten' when session completes rather than passed to the core editor controller. For example, '=' symbol is ignored in HTML completion since on = HTML editor inserts ="" which already contains equals.
public IsMuteCharacter ( char typedCharacter ) : bool
typedCharacter char
return bool

IsRetriggerChar() protected method

If completion is already showing, should this keypress start a new session?
protected IsRetriggerChar ( ICompletionSession session, char typedCharacter ) : bool
session ICompletionSession
typedCharacter char
return bool

IsTriggerChar() public method

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

OnCompleteWord() public method

Called when the user executes a command that should show the completion list, and also automatically completes the current word if possible
public OnCompleteWord ( ) : void
return void

OnCompletionSessionCommitted() protected method

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

OnCompletionSessionDismissed() protected method

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

OnPostTypeChar() public method

Called when the user types a character, after it shows up in the text view
public OnPostTypeChar ( char typedCharacter ) : void
typedCharacter char
return void

OnPostTypeClosingChar() protected method

Invoked if user typed a closing character. IsClosingChar
protected OnPostTypeClosingChar ( char typedCharacter ) : void
typedCharacter char
return void

OnPostTypeCompletionChar() protected method

protected OnPostTypeCompletionChar ( char typedCharacter ) : void
typedCharacter char
return void

OnPreTypeChar() public method

Called when the user types a character, but before it shows up in the text view.
public OnPreTypeChar ( char typedCharacter ) : bool
typedCharacter char
return bool

OnPreTypeCompletionChar() protected method

protected OnPreTypeCompletionChar ( char typedCharacter ) : void
typedCharacter char
return void

OnShowMemberList() public method

Called when the user executes a command that should show the completion list
public OnShowMemberList ( bool filterList ) : void
filterList bool
return void

OnShowQuickInfo() public method

Called when the user executes a command that should show the signature help tooltip
public OnShowQuickInfo ( ) : void
return void

OnShowSignatureHelp() public method

Called when the user executes a command that should show the signature help tooltip
public OnShowSignatureHelp ( ) : void
return void

ShowCompletion() public method

Show the completion dropdown if it isn't showing already
public ShowCompletion ( bool autoShownCompletion ) : ICompletionSession
autoShownCompletion bool
return ICompletionSession

ShowSignature() public method

Shows the signature help tooltip if it isn't showing already
public ShowSignature ( bool autoShown ) : void
autoShown bool
return void

ShowSignatureAndCompletion() protected method

The signature and completion MUST be shown in a specific order, so use this function to get the order correct.
protected ShowSignatureAndCompletion ( bool autoShownSignature, bool autoShownCompletion ) : void
autoShownSignature bool
autoShownCompletion bool
return void

TriggerCompletion() public method

public TriggerCompletion ( ) : ICompletionSession
return ICompletionSession

TriggerSignatureHelp() public method

public TriggerSignatureHelp ( ) : void
return void

UpdateInsertionText() protected method

Gives derived controllers a chance to update CompletionSession.SelectedCompletionSet.SelectionStatus.Completion.InsertionText
protected UpdateInsertionText ( ) : void
return void