Gold file only has only one Highlight when two Highlights are expected...

I have the following code to add a highlight when IInvocationExpression qualifies for a highlight.

            var file = expression.GetContainingFile();
            var range = expression.GetDocumentRange();
            var highlighting = new ReactiveSchedulerHighlighting(expression);
            var info = new HighlightingInfo(range, highlighting, new Severity?());

            consumer.AddHighlighting(info.Highlighting, range, file);



The test file I am using should generate 2 highlights but the output from the test is only showing 1 highlight - debugging the above code I can see the 'range' is different for both instances (as expected) but only the first highlight is outputed to the test output file (tmp file).

Am I doing something wrong?

Expected out should be something like the following but only has the first (0) highlight

namespace Resharper._7._1.ReactivePlugin.Tests.test.data.highlighting
{
    using System;
    using System.Reactive.Linq;

    class file04
    {
        public static void Main()
        {
            ||Observable.Return(42)|(0).Delay(TimeSpan.FromSeconds(1))|(1).Select(n => n);
        }
    }
}

---------------------------------------------------------
(0): ReSharper Warning: Optional Scheduler parameter has not defined, consider using the overload with an explicitly defining a Scheduler instance.
(1): ReSharper Warning: Optional Scheduler parameter has not defined, consider using the overload with an explicitly defining a Scheduler instance.

2 comments
Comment actions Permalink

I found the issue - the ranges for the warning I wanted were not correct, they were overlapping and it appears this is not allowed.


ta

Ollie

0
Comment actions Permalink

Yep, overlaps are not (strictly speaking) allowed - only one is used. The way the get resolved depends on the attributes to both sets of highlights.

0

Please sign in to leave a comment.