コード例 #1
0
        public IEnumerable <CharPos> ErrorBracesInSpans(NormalizedSnapshotSpanCollection spans)
        {
            if (ScanIsUnnecessary())
            {
                return(Enumerable.Empty <CharPos>());
            }

            // we expect there to be very few brace errors,
            // so it's not worth optimizing this too much
            EnsureLinesInPreferredSpan(spans.Complete());
            if (this.braceErrors.Count == 0)
            {
                return(Enumerable.Empty <CharPos>());
            }

            return(from e in this.braceErrors
                   from span in spans
                   where e.Position >= span.Start &&
                   e.Position <= span.End
                   select e);
        }
コード例 #2
0
        public IEnumerable<CharPos> ErrorBracesInSpans(NormalizedSnapshotSpanCollection spans)
        {
            if ( ScanIsUnnecessary() )
            return Enumerable.Empty<CharPos>();

              // we expect there to be very few brace errors,
              // so it's not worth optimizing this too much
              EnsureLinesInPreferredSpan(spans.Complete());
              if ( this.braceErrors.Count == 0 )
            return Enumerable.Empty<CharPos>();

              return from e in this.braceErrors
             from span in spans
             where e.Position >= span.Start
                && e.Position <= span.End
             select e;
        }