示例#1
0
 internal VsCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IKeyUtil keyUtil,
     IOleCommandTarget nextTarget,
     ReadOnlyCollection<ICommandTarget> commandTargets)
     : this(vimBufferCoordinator, textManager, vsAdapter, broker, keyUtil)
 {
     CompleteInit(nextTarget, commandTargets);
 }
示例#2
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IExternalEditorManager externalEditorManager)
 {
     _buffer = bufferCoordinator.VimBuffer;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer = _buffer.TextBuffer;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _externalEditManager = externalEditorManager;
 }
示例#3
0
 internal StandardCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IDisplayWindowBroker broker,
     IOleCommandTarget nextOleCommandTarget)
 {
     _vimBuffer = vimBufferCoordinator.VimBuffer;
     _vimBufferCoordinator = vimBufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _textView = _vimBuffer.TextView;
     _textManager = textManager;
     _broker = broker;
     _nextOleCommandTarget = nextOleCommandTarget;
 }
示例#4
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IResharperUtil resharperUtil)
 {
     _vimBuffer = bufferCoordinator.VimBuffer;
     _vim = _vimBuffer.Vim;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _resharperUtil = resharperUtil;
 }
示例#5
0
 private VsCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IKeyUtil keyUtil)
 {
     _vimBuffer = vimBufferCoordinator.VimBuffer;
     _vim = _vimBuffer.Vim;
     _vimBufferCoordinator = vimBufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _keyUtil = keyUtil;
 }
示例#6
0
 public DisplayWindowBrokerTest()
 {
     _smartTagBroker = new Mock<ISmartTagBroker>();
     _completionBroker = new Mock<ICompletionBroker>();
     _signatureBroker = new Mock<ISignatureHelpBroker>();
     _quickInfoBroker = new Mock<IQuickInfoBroker>();
     _textView = new Mock<ITextView>();
     _brokerRaw = new DisplayWindowBroker(
         _textView.Object,
         _completionBroker.Object,
         _signatureBroker.Object,
         _smartTagBroker.Object,
         _quickInfoBroker.Object);
     _broker = _brokerRaw;
 }
示例#7
0
        internal static Result <VsCommandTarget> Create(
            IVimBufferCoordinator bufferCoordinator,
            IVsTextView vsTextView,
            IVsAdapter adapter,
            IDisplayWindowBroker broker,
            IResharperUtil resharperUtil)
        {
            var vsCommandTarget = new VsCommandTarget(bufferCoordinator, adapter, broker, resharperUtil);
            var hresult         = vsTextView.AddCommandFilter(vsCommandTarget, out vsCommandTarget._nextTarget);
            var result          = Result.CreateSuccessOrError(vsCommandTarget, hresult);

            if (result.IsSuccess)
            {
                bufferCoordinator.VimBuffer.TextView.Properties[Key] = vsCommandTarget;
            }

            return(result);
        }
示例#8
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IReSharperUtil resharperUtil,
     IKeyUtil keyUtil)
 {
     _vimBuffer = bufferCoordinator.VimBuffer;
     _vim = _vimBuffer.Vim;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _textView = _vimBuffer.TextView;
     _textManager = textManager;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _resharperUtil = resharperUtil;
     _keyUtil = keyUtil;
 }
示例#9
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IReSharperUtil resharperUtil,
     IKeyUtil keyUtil)
 {
     _vimBuffer         = bufferCoordinator.VimBuffer;
     _vim               = _vimBuffer.Vim;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer        = _vimBuffer.TextBuffer;
     _textView          = _vimBuffer.TextView;
     _textManager       = textManager;
     _vsAdapter         = vsAdapter;
     _broker            = broker;
     _resharperUtil     = resharperUtil;
     _keyUtil           = keyUtil;
 }
示例#10
0
 internal static Result<VsCommandTarget> Create(
     IVimBuffer buffer,
     IVsTextView vsTextView,
     IVsAdapter adapter,
     IDisplayWindowBroker broker,
     IExternalEditorManager externalEditorManager)
 {
     var filter = new VsCommandTarget(buffer, adapter, broker, externalEditorManager);
     var hresult = vsTextView.AddCommandFilter(filter, out filter._nextTarget);
     return Result.CreateSuccessOrError(filter, hresult);
 }
示例#11
0
 private VsCommandTarget(
     IVimBuffer buffer,
     IVsAdapter adapter,
     IDisplayWindowBroker broker,
     IExternalEditorManager externalEditorManager)
 {
     _buffer = buffer;
     _adapter = adapter;
     _broker = broker;
     _externalEditManager = externalEditorManager;
 }
示例#12
0
        internal static Result<VsCommandTarget> Create(
            IVimBufferCoordinator vimBufferCoordinator,
            IVsTextView vsTextView,
            ITextManager textManager,
            IVsAdapter adapter,
            IDisplayWindowBroker broker,
            IKeyUtil keyUtil,
            IVimApplicationSettings vimApplicationSettings,
            ReadOnlyCollection<ICommandTargetFactory> commandTargetFactoryList)
        {
            var vsCommandTarget = new VsCommandTarget(vimBufferCoordinator, textManager, adapter, broker, keyUtil, vimApplicationSettings);

            IOleCommandTarget nextCommandTarget;
            var hresult = vsTextView.AddCommandFilter(vsCommandTarget, out nextCommandTarget);
            if (ErrorHandler.Failed(hresult))
            {
                return Result.CreateError(hresult);
            }

            var commandTargets = commandTargetFactoryList
                .Select(x => x.CreateCommandTarget(nextCommandTarget, vimBufferCoordinator))
                .Where(x => x != null)
                .ToReadOnlyCollection();
            vsCommandTarget.CompleteInit(nextCommandTarget, commandTargets);
            return Result.CreateSuccess(vsCommandTarget);
        }
示例#13
0
        internal static Result<VsCommandTarget> Create(
            IVimBufferCoordinator bufferCoordinator,
            IVsTextView vsTextView,
            ITextManager textManager,
            IVsAdapter adapter,
            IDisplayWindowBroker broker,
            IResharperUtil resharperUtil,
            IKeyUtil keyUtil)
        {
            var vsCommandTarget = new VsCommandTarget(bufferCoordinator, textManager, adapter, broker, resharperUtil, keyUtil);
            var hresult = vsTextView.AddCommandFilter(vsCommandTarget, out vsCommandTarget._nextTarget);
            var result = Result.CreateSuccessOrError(vsCommandTarget, hresult);
            if (result.IsSuccess)
            {
                bufferCoordinator.VimBuffer.TextView.Properties[Key] = vsCommandTarget;
            }

            return result;
        }