示例#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;
                };
        }
示例#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);
 }
示例#3
0
 internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView)
     : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
示例#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);
 }
示例#5
0
 internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView)
     : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
示例#6
0
 internal VsKeyProcessorSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
示例#7
0
 internal VsKeyboardInputSimulation(VsSimulation vsSimulation, IWpfTextView wpfTextView) : base(wpfTextView)
 {
     _vsSimulation = vsSimulation;
 }
示例#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);
 }