Ejemplo n.º 1
0
        /// <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;
                };
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView)
     : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView)
     : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
Ejemplo n.º 6
0
 internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
Ejemplo n.º 7
0
 internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
Ejemplo n.º 8
0
 /// <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);
 }