public IEnumerable <ITagSpan <LoggingTag> > GetTags(NormalizedSnapshotSpanCollection spans) { if (ToolWindow1Control.CurrentTextViewer != _view) { Debug.WriteLine("FirstWindowControl.CurrentTextViewer != _view"); yield break; } if (spans.Count == 0) { yield break; } if (_currentViewLine == null) { yield break; } if (!_currentViewLine.IsValid) { yield break; } bool showToolTip = false; if (spans.Count > 0) { // look for 'StackdriverLogging' occurrences foreach (SnapshotSpan span in _textSearchService.FindAll(new FindData("StackdriverLogging", spans[0].Snapshot, FindOptions.WholeWord | FindOptions.MatchCase | FindOptions.SingleLine, _textStructureNavigator))) //spans[0].Snapshot, FindOptions.WholeWord | FindOptions.MatchCase, _textStructureNavigator))) { if (_currentViewLine.ContainsBufferPosition(span.Start)) { yield return(new TagSpan <LoggingTag>(span, new LoggingTag())); showToolTip = true; ShowToolTip(span); } } } if (showToolTip) { } else { _toolTipProvider.ClearToolTip(); } }
private void SetTooltip(ErrorGlyphTag newTag, ITrackingSpan trackingSpan) { if (newTag != null) { if ((_currentTag == null) || (newTag.Description != _currentTag.Description)) { _toolTipProvider.ShowToolTip(trackingSpan, newTag.Description); _currentTag = newTag; } } else if (_currentTag != null) { _toolTipProvider.ClearToolTip(); _currentTag = null; } }
private void HideTooltip() { _toolTipProvider.ClearToolTip(); _isTooltipShown = false; }