/// <summary> /// Send the command to the current session head /// </summary> internal bool SendCommand(IntellisenseKeyboardCommand command) { // Don't send the command if the active completion set is not the word completion // set if (_wordCompletionSet != _completionSession.SelectedCompletionSet) { return(false); } var commandTarget = _intellisenseSessionStack as IIntellisenseCommandTarget; if (commandTarget == null) { return(false); } // Send the command if (!commandTarget.ExecuteKeyboardCommand(command)) { return(false); } // Command succeeded so there is a new selection. Put the new selection into the // ITextView to replace the current selection var wordSpan = TrackingSpanUtil.GetSpan(_textView.TextSnapshot, _wordTrackingSpan); if (wordSpan.IsSome() && _wordCompletionSet.SelectionStatus != null && _wordCompletionSet.SelectionStatus.Completion != null) { _textView.TextBuffer.Replace(wordSpan.Value, _wordCompletionSet.SelectionStatus.Completion.InsertionText); } return(true); }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: MoveCurrentByIdx(-1); return(true); case IntellisenseKeyboardCommand.PageUp: MoveCurrentByIdx(-10); return(true); case IntellisenseKeyboardCommand.Down: MoveCurrentByIdx(1); return(true); case IntellisenseKeyboardCommand.PageDown: MoveCurrentByIdx(10); return(true); case IntellisenseKeyboardCommand.Escape: this.CompletionSession.Dismiss(); return(true); default: return(false); } }
/// <summary> /// Send the command to the current session head /// </summary> internal bool SendCommand(IntellisenseKeyboardCommand command) { // Don't send the command if the active completion set is not the word completion // set if (_wordCompletionSet != _completionSession.SelectedCompletionSet) { return false; } var commandTarget = _intellisenseSessionStack as IIntellisenseCommandTarget; if (commandTarget == null) { return false; } // Send the command if (!commandTarget.ExecuteKeyboardCommand(command)) { return false; } // Command succeeded so there is a new selection. Put the new selection into the // ITextView to replace the current selection var wordSpan = TrackingSpanUtil.GetSpan(_textView.TextSnapshot, _wordTrackingSpan); if (wordSpan.IsSome() && _wordCompletionSet.SelectionStatus != null && _wordCompletionSet.SelectionStatus.Completion != null) { _textView.TextBuffer.Replace(wordSpan.Value, _wordCompletionSet.SelectionStatus.Completion.InsertionText); } return true; }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { IIntellisenseCommandTarget target = Content as IIntellisenseCommandTarget; if (target != null) { return target.ExecuteKeyboardCommand(command); } return false; }
/// <summary> /// /// </summary> /// <param name="command"></param> /// <returns></returns> public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: SelectCompletion(-1); return(true); case IntellisenseKeyboardCommand.PageUp: SelectCompletion(-10); return(true); case IntellisenseKeyboardCommand.Down: SelectCompletion(1); return(true); case IntellisenseKeyboardCommand.PageDown: SelectCompletion(10); return(true); case IntellisenseKeyboardCommand.Escape: this.Session.Dismiss(); return(true); } return(false); }
private bool ExecuteKeyboardCommandIfSessionActive(IntellisenseKeyboardCommand command) { var stackForTextView = _intellisenseSessionStackMapService.GetStackForTextView(_textView); if (stackForTextView != null) { var containsSigHelp = false; foreach (var session in stackForTextView.Sessions) { if (!containsSigHelp && (session is ISignatureHelpSession)) { containsSigHelp = true; } else if (session is ICompletionSession) { if (containsSigHelp) { stackForTextView.MoveSessionToTop(session); } break; } } } var target = stackForTextView as IIntellisenseCommandTarget; return(target != null && target.ExecuteKeyboardCommand(command)); }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Escape: session.Dismiss(); return true; case IntellisenseKeyboardCommand.Up: if (session.Signatures.Count > 1) { IncrementSelectedSignature(-1); return true; } return false; case IntellisenseKeyboardCommand.Down: if (session.Signatures.Count > 1) { IncrementSelectedSignature(1); return true; } return false; case IntellisenseKeyboardCommand.PageUp: case IntellisenseKeyboardCommand.PageDown: case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.TopLine: case IntellisenseKeyboardCommand.BottomLine: case IntellisenseKeyboardCommand.Enter: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.DecreaseFilterLevel: default: return false; } }
private bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { var target = _editorSessionOpt != null ? _editorSessionOpt.Presenter as IIntellisenseCommandTarget : null; return(target != null && target.ExecuteKeyboardCommand(command)); }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { IIntellisenseCommandTarget target = Content as IIntellisenseCommandTarget; if (target != null) { return(target.ExecuteKeyboardCommand(command)); } return(false); }
bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { foreach (var session in sessions) { if (session.Presenter?.ExecuteKeyboardCommand(command) == true) { return(true); } } return(false); }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Escape: if (this.session != null) { this.session.Dismiss(); return(true); } break; } return(false); }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: MoveUpDown(true); return(true); case IntellisenseKeyboardCommand.Down: MoveUpDown(false); return(true); case IntellisenseKeyboardCommand.PageUp: PageUpDown(true); return(true); case IntellisenseKeyboardCommand.PageDown: PageUpDown(false); return(true); case IntellisenseKeyboardCommand.Escape: session.Dismiss(); return(true); case IntellisenseKeyboardCommand.Enter: if (session.SelectedCompletionSet?.SelectionStatus.IsSelected == true) { session.Commit(); return(true); } return(false); case IntellisenseKeyboardCommand.TopLine: WpfUtils.ScrollToTop(control.completionsListBox); return(true); case IntellisenseKeyboardCommand.BottomLine: WpfUtils.ScrollToBottom(control.completionsListBox); return(true); case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.DecreaseFilterLevel: default: return(false); } }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { // Certain keys are important to us. We'll want to trap things like up/down/escape and make them mean something // special to us. switch (command) { case IntellisenseKeyboardCommand.Up: return(this.PreviousSignature()); case IntellisenseKeyboardCommand.Down: return(this.NextSignature()); default: break; } return(false); }
/// <summary> /// Calls each of the stack's session presenters, in order, to see if they want to handle the keyboard command /// </summary> public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { // We don't care if there's a keyboard session here or not. If someone has captured the keyboard, this should only get // called if the capturer has decided not to handle the command. // Run through the sessions from the topmost to the bottom-most. foreach (IIntellisenseSession session in _sessions) { IIntellisenseCommandTarget commandTarget = session.Presenter as IIntellisenseCommandTarget; if (commandTarget != null) { if (commandTarget.ExecuteKeyboardCommand(command)) { return(true); } } } return(false); }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Escape: session.Dismiss(); return true; case IntellisenseKeyboardCommand.Up: case IntellisenseKeyboardCommand.Down: case IntellisenseKeyboardCommand.PageUp: case IntellisenseKeyboardCommand.PageDown: case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.TopLine: case IntellisenseKeyboardCommand.BottomLine: case IntellisenseKeyboardCommand.Enter: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.DecreaseFilterLevel: default: return false; } }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: Move(-1); return(true); case IntellisenseKeyboardCommand.Down: Move(1); return(true); case IntellisenseKeyboardCommand.PageUp: Move(-10); return(true); case IntellisenseKeyboardCommand.PageDown: Move(10); return(true); case IntellisenseKeyboardCommand.Enter: _completionSession.Commit(); return(true); case IntellisenseKeyboardCommand.Escape: _completionSession.Dismiss(); return(true); //Maybe one day we'll do something with these below case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.DecreaseFilterLevel: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.TopLine: case IntellisenseKeyboardCommand.BottomLine: break; } return(false); }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Escape: session.Dismiss(); return(true); case IntellisenseKeyboardCommand.Up: case IntellisenseKeyboardCommand.Down: case IntellisenseKeyboardCommand.PageUp: case IntellisenseKeyboardCommand.PageDown: case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.TopLine: case IntellisenseKeyboardCommand.BottomLine: case IntellisenseKeyboardCommand.Enter: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.DecreaseFilterLevel: default: return(false); } }
private bool ExecuteKeyboardCommandIfSessionActive(IntellisenseKeyboardCommand command) { var stackForTextView = _intellisenseSessionStackMapService.GetStackForTextView(_textView); if (stackForTextView != null) { var containsSigHelp = false; foreach (var session in stackForTextView.Sessions) { if (!containsSigHelp && (session is ISignatureHelpSession)) { containsSigHelp = true; } else if (session is ICompletionSession) { if (containsSigHelp) stackForTextView.MoveSessionToTop(session); break; } } } var target = stackForTextView as IIntellisenseCommandTarget; return target != null && target.ExecuteKeyboardCommand(command); }
/// <summary> /// /// </summary> /// <param name="command"></param> /// <returns></returns> public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: SelectCompletion(-1); return true; case IntellisenseKeyboardCommand.PageUp: SelectCompletion(-10); return true; case IntellisenseKeyboardCommand.Down: SelectCompletion(1); return true; case IntellisenseKeyboardCommand.PageDown: SelectCompletion(10); return true; case IntellisenseKeyboardCommand.Escape: this.Session.Dismiss(); return true; } return false; }
private bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { var target = _editorSessionOpt != null ? _editorSessionOpt.Presenter as IIntellisenseCommandTarget : null; return target != null && target.ExecuteKeyboardCommand(command); }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: Move(-1); return true; case IntellisenseKeyboardCommand.Down: Move(1); return true; case IntellisenseKeyboardCommand.PageUp: Move(-10); return true; case IntellisenseKeyboardCommand.PageDown: Move(10); return true; case IntellisenseKeyboardCommand.Enter: _completionSession.Commit(); return true; case IntellisenseKeyboardCommand.Escape: _completionSession.Dismiss(); return true; //Maybe one day we'll do something with these below case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.DecreaseFilterLevel: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.TopLine: case IntellisenseKeyboardCommand.BottomLine: break; } return false; }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { return _intellisenseCommandTarget != null ? _intellisenseCommandTarget.ExecuteKeyboardCommand(command) : false; }
bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { foreach (var session in sessions) { if ((session.Presenter as IIntellisenseCommandTarget)?.ExecuteKeyboardCommand(command) == true) return true; } return false; }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { return(_intellisenseCommandTarget != null ? _intellisenseCommandTarget.ExecuteKeyboardCommand(command) : false); }
public bool ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch ( command ) { case IntellisenseKeyboardCommand.Escape: if ( this.session != null ) { this.session.Dismiss(); return true; } break; } return false; }
bool IIntellisenseCommandTarget.ExecuteKeyboardCommand(IntellisenseKeyboardCommand command) { switch (command) { case IntellisenseKeyboardCommand.Up: MoveUpDown(true); return true; case IntellisenseKeyboardCommand.Down: MoveUpDown(false); return true; case IntellisenseKeyboardCommand.PageUp: PageUpDown(true); return true; case IntellisenseKeyboardCommand.PageDown: PageUpDown(false); return true; case IntellisenseKeyboardCommand.Escape: session.Dismiss(); return true; case IntellisenseKeyboardCommand.Enter: if (session.SelectedCompletionSet?.SelectionStatus.IsSelected == true) { session.Commit(); return true; } return false; case IntellisenseKeyboardCommand.TopLine: WpfUtils.ScrollToTop(control.completionsListBox); return true; case IntellisenseKeyboardCommand.BottomLine: WpfUtils.ScrollToBottom(control.completionsListBox); return true; case IntellisenseKeyboardCommand.Home: case IntellisenseKeyboardCommand.End: case IntellisenseKeyboardCommand.IncreaseFilterLevel: case IntellisenseKeyboardCommand.DecreaseFilterLevel: default: return false; } }