/// <summary>
 /// Initializes a new instance of the <see cref="SarifLocationErrorTag"/> class.
 /// </summary>
 /// <param name="persistentSpan">The persistent span for the tag within a document.</param>
 /// <param name="runIndex">The SARIF run index associated with this tag.</param>
 /// <param name="resultId">the result ID associated with this tag.</param>
 /// <param name="errorType">The Visual Studio error type to display.</param>
 /// <param name="toolTipContent">The content to use when displaying a tool tip for this error. This parameter may be null.</param>
 /// <param name="toolTipXamlString">The string to be rendered as Xaml element when displaying a tool tip for this error. This parameter may be null.</param>
 /// <param name="context">Gets the data context for this tag.</param>
 public SarifLocationErrorTag(IPersistentSpan persistentSpan, int runIndex, int resultId, string errorType, object toolTipContent, string toolTipXamlString, object context)
     : base(persistentSpan, runIndex: runIndex, resultId: resultId, context: context)
 {
     this.ErrorType         = errorType;
     this.toolTipString     = toolTipContent;
     this.toolTipXamlString = toolTipXamlString;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SarifLocationTagBase"/> class.
 /// </summary>
 /// <param name="persistentSpan">The persistent span for the tag within a document.</param>
 /// <param name="runIndex">The SARIF run index associated with this tag.</param>
 /// <param name="resultId">the result ID associated with this tag.</param>
 /// <param name="context">Gets the data context for this tag.</param>
 public SarifLocationTagBase(IPersistentSpan persistentSpan, int runIndex, int resultId, object context)
 {
     this.PersistentSpan = persistentSpan;
     this.RunIndex       = runIndex;
     this.ResultId       = resultId;
     this.Context        = context;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SarifLocationTextMarkerTag"/> class.
 /// </summary>
 /// <param name="persistentSpan">The persistent span for the tag within a document.</param>
 /// <param name="runIndex">The SARIF run index associated with this tag.</param>
 /// <param name="resultId">the result ID associated with this tag.</param>
 /// <param name="nonHighlightedTextMarkerTagType">The text marker tag to display for this tag when it is not highlighted.</param>
 /// <param name="highlightedTextMarkerTagType">The text marker tag to display for this tag when it is highlighted.</param>
 /// <param name="context">Gets the data context for this tag.</param>
 public SarifLocationTextMarkerTag(IPersistentSpan persistentSpan, int runIndex, int resultId, string nonHighlightedTextMarkerTagType, string highlightedTextMarkerTagType, object context)
     : base(persistentSpan: persistentSpan, runIndex: runIndex, resultId: resultId, context: context)
 {
     this.currentTextMarkerTagType        = nonHighlightedTextMarkerTagType;
     this.highlightedTextMarkerTagType    = highlightedTextMarkerTagType;
     this.nonHighlightedTextMarkerTagType = nonHighlightedTextMarkerTagType;
 }
Ejemplo n.º 4
0
        internal static bool TryCreatePersistentSpan(Region fullyPopulatedRegion, ITextBuffer textBuffer, IPersistentSpanFactory persistentSpanFactory, out IPersistentSpan persistentSpan)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            persistentSpan = null;

            if (!TryCreateTextSpanWithinDocumentFromSourceRegion(fullyPopulatedRegion, textBuffer, out TextSpan documentSpan))
            {
                return(false);
            }

            if (!persistentSpanFactory.CanCreate(textBuffer))
            {
                return(false);
            }

            persistentSpan = persistentSpanFactory.Create(
                textBuffer.CurrentSnapshot,
                startLine: documentSpan.iStartLine,
                startIndex: documentSpan.iStartIndex,
                endLine: documentSpan.iEndLine,
                endIndex: documentSpan.iEndIndex,
                trackingMode: SpanTrackingMode.EdgeInclusive);

            return(true);
        }