示例#1
0
        private void OnTextViewMouseHover(object sender, MouseHoverEventArgs ee)
        {
            ITextBuffer buff = null;
            //find the mouse position by mapping down to the subject buffer
            SnapshotPoint?point = m_textView.BufferGraph.MapDownToFirstMatch
                                      (new SnapshotPoint(m_textView.TextSnapshot, ee.Position),
                                      PointTrackingMode.Positive,
                                      snapshot => m_subjectBuffers.Contains(buff = snapshot.TextBuffer),
                                      PositionAffinity.Predecessor);

            if (point != null)
            {
                ITrackingPoint triggerPoint = point.Value.Snapshot.CreateTrackingPoint(point.Value.Position,
                                                                                       PointTrackingMode.Positive);

                EnvDTE.DTE      dte = SQVSUtils.GetService <EnvDTE.DTE>();
                EnvDTE.Debugger dbg = dte.Debugger as EnvDTE.Debugger;

                if (dbg != null && dte.Debugger.CurrentMode == dbgDebugMode.dbgBreakMode)
                {
                    string filename = SQLanguageServiceEX.GetFileName(buff);

                    SQProjectFileNode node = _languageService.GetNode(filename);
                    SQVSUtils.CreateDataTipViewFilter(_serviceProvider, node);
                }
                else if (!m_provider.QuickInfoBroker.IsQuickInfoActive(m_textView))
                {
                    //m_session = m_provider.QuickInfoBroker.TriggerQuickInfo(m_textView, triggerPoint, true);
                    /*Setting DEBUG_PROPERTY_INFO.bstrFullName enables the button. I think it uses that name to persist the data tip to a file. It sure would be nice if the documentation gets enhanced one of these days!*/
                }
            }
        }
 public SQOutliningTagger(ITextBuffer buffer, SQLanguageServiceEX service)
 {
     this._languangeService = service;
     this._buffer           = buffer;
     _buffer.Changed       += _buffer_Changed;
     filepath = SQLanguageServiceEX.GetFileName(buffer);
 }
 public SQErrorTagger(ITextView view, ITextBuffer sourceBuffer, ITextStructureNavigator textStructureNavigator, SQLanguageServiceEX service)
 {
     _buffer                     = sourceBuffer;
     _languangeService           = service;
     filepath                    = SQLanguageServiceEX.GetFileName(_buffer);
     _buffer.Changed            -= _buffer_Changed;
     _buffer.ChangedLowPriority += _buffer_Changed;
 }
示例#4
0
        public AttributeScopeTagger(ITextSearchService textSearchService, ITextStructureNavigatorSelectorService textStructureNavigatorSelector, ITextBuffer buffer, SQLanguageServiceEX service, IClassificationTypeRegistryService typeService, IClassifierAggregatorService classifierAggregator)
        {
            if (_attribtag == null)
            {
                _classifierAggregator = classifierAggregator;
                var classificationType = typeService.GetClassificationType(SQAtrributeFormat);
                _attribtag = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.Comment);
                _commenttag        = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.String);
                _stringtag         = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("class name");
                _classtag          = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("enum name");
                _enumtag           = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.SymbolReference);
                _subnametag        = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("number");
                _numberictag       = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("keyword");
                _keywordtag        = new ClassificationTag(classificationType);
            }

            _languangeService = service;

            _textStructureNavigatorSelector = textStructureNavigatorSelector;
            _buffer            = buffer;
            _textSearchService = textSearchService;

            filepath         = SQLanguageServiceEX.GetFileName(buffer);
            _buffer.Changed -= _buffer_Changed;
            _buffer.Changed += _buffer_Changed;
            ForceNewVersion  = true;
        }