Exemple #1
0
 /// <summary>
 /// Attaches events for invoking Statement completion
 /// </summary>
 /// <param name="subjectBuffers"></param>
 /// <param name="textView"></param>
 /// <param name="completionBrokerMap"></param>
 public IntellisenseController(IntellisenseControllerProvider provider, IList <ITextBuffer> subjectBuffers, ITextView textView, BufferParser bufferParser)
 {
     _subjectBuffers       = subjectBuffers;
     _textView             = textView;
     _provider             = provider;
     _editOps              = provider._EditOperationsFactory.GetEditorOperations(textView);
     _incSearch            = provider._IncrementalSearch.GetIncrementalSearch(textView);
     _textView.MouseHover += new EventHandler <MouseHoverEventArgs>(TextViewMouseHover);
     _bufferParser         = bufferParser;
     textView.Properties.AddProperty(typeof(IntellisenseController), this);  // added so our key processors can get back to us
     AttachKeyboardFilter();
 }
Exemple #2
0
        /// <summary>
        /// Attaches events for invoking Statement completion 
        /// </summary>
        public IntellisenseController(IntellisenseControllerProvider provider, ITextView textView, IServiceProvider serviceProvider) {
            _textView = textView;
            _provider = provider;
            _editOps = provider._EditOperationsFactory.GetEditorOperations(textView);
            _incSearch = provider._IncrementalSearch.GetIncrementalSearch(textView);
            _textView.MouseHover += TextViewMouseHover;
            _serviceProvider = serviceProvider;
            if (textView.TextBuffer.IsPythonContent()) {
                try {
                    _expansionClient = new ExpansionClient(textView, provider._adaptersFactory, provider._ServiceProvider);
                    var textMgr = (IVsTextManager2)_serviceProvider.GetService(typeof(SVsTextManager));
                    textMgr.GetExpansionManager(out _expansionMgr);
                } catch (ArgumentException) {
                    // No expansion client for this buffer, but we can continue without it
                }
            }

            textView.Properties.AddProperty(typeof(IntellisenseController), this);  // added so our key processors can get back to us
            _textView.Closed += TextView_Closed;
        }
        /// <summary>
        /// Attaches events for invoking Statement completion
        /// </summary>
        public IntellisenseController(IntellisenseControllerProvider provider, ITextView textView, IServiceProvider serviceProvider)
        {
            _textView             = textView;
            _provider             = provider;
            _editOps              = provider._EditOperationsFactory.GetEditorOperations(textView);
            _incSearch            = provider._IncrementalSearch.GetIncrementalSearch(textView);
            _textView.MouseHover += TextViewMouseHover;
            _serviceProvider      = serviceProvider;
            if (textView.TextBuffer.IsPythonContent())
            {
                try {
                    _expansionClient = new ExpansionClient(textView, provider._adaptersFactory, provider._ServiceProvider);
                    var textMgr = (IVsTextManager2)_serviceProvider.GetService(typeof(SVsTextManager));
                    textMgr.GetExpansionManager(out _expansionMgr);
                } catch (ArgumentException ex) {
                    // No expansion client for this buffer, but we can continue without it
                    Debug.Fail(ex.ToString());
                }
            }

            textView.Properties.AddProperty(typeof(IntellisenseController), this);  // added so our key processors can get back to us
        }