public void SetDotNetSpanMap(ITextView textView, IDotNetSpanMap map)
        {
            if (textView == null)
            {
                throw new ArgumentNullException(nameof(textView));
            }
            var service = GlyphTextViewMarkerService.TryGet(textView);

            Debug.Assert(service != null);
            service?.SetDotNetSpanMap(map);
        }
Beispiel #2
0
 void IGlyphTextViewMarkerService.SetDotNetSpanMap(IDotNetSpanMap map)
 {
     if (dotNetSpanMap == map)
     {
         return;
     }
     dotNetSpanMap = map as IDotNetSpanMap;
     Debug.Assert((map == null) == (dotNetSpanMap == null));
     if (markerAndSpanCollection.Count != 0)
     {
         markerAndSpanCollection.UpdateSpans(dotNetSpanMap);
         InvalidateEverything();
     }
 }
Beispiel #3
0
            public void UpdateSpans(IDotNetSpanMap map)
            {
                inDocMarkers.Clear();
                SelectedMarkersInDocumentCount = 0;
                if (map != null)
                {
                    var allMarkers = this.allMarkers;
                    for (int i = 0; i < allMarkers.Count; i++)
                    {
                        Span?span;
                        switch (allMarkers[i])
                        {
                        case IGlyphTextMethodMarkerImpl methodMarker:
                            span = map.ToSpan(methodMarker.Method.Module, methodMarker.Method.Token, methodMarker.ILOffset);
                            if (span != null)
                            {
                                inDocMarkers.Add(methodMarker, span.Value);
                                if (methodMarker.SelectedMarkerTypeName != null)
                                {
                                    SelectedMarkersInDocumentCount++;
                                }
                            }
                            break;

                        case IGlyphTextDotNetTokenMarkerImpl tokenMarker:
                            span = map.ToSpan(tokenMarker.Module, tokenMarker.Token);
                            if (span != null)
                            {
                                inDocMarkers.Add(tokenMarker, span.Value);
                                if (tokenMarker.SelectedMarkerTypeName != null)
                                {
                                    SelectedMarkersInDocumentCount++;
                                }
                            }
                            break;
                        }
                    }
                }
            }