/// <summary> /// Create a Visual Studio simulation with the specified set of lines /// </summary> private void CreateCore(bool simulateResharper, bool usePeekRole, params string[] lines) { if (usePeekRole) { _textBuffer = CreateTextBuffer(lines); _textView = TextEditorFactoryService.CreateTextView( _textBuffer, TextEditorFactoryService.CreateTextViewRoleSet(PredefinedTextViewRoles.Document, PredefinedTextViewRoles.Editable, Constants.TextViewRoleEmbeddedPeekTextView)); } else { _textView = CreateTextView(lines); _textBuffer = _textView.TextBuffer; } _vimBuffer = Vim.CreateVimBuffer(_textView); _bufferCoordinator = new VimBufferCoordinator(_vimBuffer); _vsSimulation = new VsSimulation( _bufferCoordinator, simulateResharper: simulateResharper, simulateStandardKeyMappings: false, editorOperationsFactoryService: EditorOperationsFactoryService, keyUtil: KeyUtil); VimHost.TryCustomProcessFunc = (textView, insertCommand) => { if (textView == _textView) { return _vsSimulation.VsCommandTarget.TryCustomProcess(insertCommand); } return false; }; }
/// <summary> /// Create a Visual Studio simulation with the specified set of lines /// </summary> private void CreateCore(bool simulateResharper, bool usePeekRole, params string[] lines) { if (usePeekRole) { _textBuffer = CreateTextBuffer(lines); _textView = TextEditorFactoryService.CreateTextView( _textBuffer, TextEditorFactoryService.CreateTextViewRoleSet(PredefinedTextViewRoles.Document, PredefinedTextViewRoles.Editable, Constants.TextViewRoleEmbeddedPeekTextView)); } else { _textView = CreateTextView(lines); _textBuffer = _textView.TextBuffer; } _vimBuffer = Vim.CreateVimBuffer(_textView); _bufferCoordinator = new VimBufferCoordinator(_vimBuffer); _vsSimulation = new VsSimulation( _bufferCoordinator, simulateResharper: simulateResharper, simulateStandardKeyMappings: false, editorOperationsFactoryService: EditorOperationsFactoryService, keyUtil: KeyUtil); }
internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView) { _vsSimulation = vsSimulation; }
/// <summary> /// Create a Visual Studio simulation with the specified set of lines /// </summary> private void Create(bool simulateResharper, params string[] lines) { _textView = CreateTextView(lines); _textBuffer = _textView.TextBuffer; _vimBuffer = Vim.CreateVimBuffer(_textView); _bufferCoordinator = new VimBufferCoordinator(_vimBuffer); _simulation = new VsSimulation( _bufferCoordinator, simulateResharper: simulateResharper, simulateStandardKeyMappings: false, editorOperationsFactoryService: EditorOperationsFactoryService); }
internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView) { _vsSimulation = vsSimulation; }
/// <summary> /// Create a Visual Studio simulation with the specified set of lines /// </summary> private void Create(bool simulateResharper, params string[] lines) { _textView = CreateTextView(lines); _vimBuffer = Vim.CreateVimBuffer(_textView); _bufferCoordinator = new VimBufferCoordinator(_vimBuffer); _simulation = new VsSimulation(_bufferCoordinator, simulateResharper); }