bool TryGetStringSpanAtMousePosition(List <StringSpan> stringItems, out StringSpan matchedSpan) { matchedSpan = null; var wordSpan = GetWordSpanAtMousePosition(this.view, this.navigatorService); if (wordSpan == null) { return(false); } var wordText = wordSpan.Value.GetText(); matchedSpan = stringItems.FirstOrDefault(t => t.Value.Contains(wordText)); return(matchedSpan != null); }
void ShowToolTipIfNotShown(StringSpan targetSpan) { if (this.shownSpan == targetSpan.Span) { return; } this.shownSpan = targetSpan.Span; string basePath = (textDocument != null) ? Path.GetDirectoryName(textDocument.FilePath) : ""; var content = CreateToolTipContent(targetSpan.Value, basePath); if (content == null) { return; } this.toolTipProvider.ClearToolTip(); this.toolTipProvider.ShowToolTip( targetSpan.LineSnapshotSpan.Snapshot.CreateTrackingSpan(targetSpan.Span, SpanTrackingMode.EdgeExclusive), content, PopupStyles.PositionClosest); }