EditAndContinue\AbstractEditAndContinueAnalyzer.cs (15)
708var line = text.Lines.GetLineFromPosition(diagnostic.Span.Start);
710lineText = text.ToString(TextSpan.FromBounds(diagnostic.Span.Start, Math.Min(diagnostic.Span.Start + 120, line.End)));
817var node = TryGetNode(topMatch.OldRoot, oldStatementSpan.Start);
833Log.Write("Invalid active statement span: [{0}..{1})", oldStatementSpan.Start, oldStatementSpan.End);
847var adjustedOldStatementStart = oldMember.FullSpan.Contains(oldStatementSpan.Start) ? oldStatementSpan.Start : oldMember.SpanStart;
883Log.Write("Invalid active statement span: [{0}..{1})", oldStatementSpan.Start, oldStatementSpan.End);
1325if (!bodyMatch.NewRoot.Span.Contains(newStatementSyntaxSpan.Start))
1330newStatementSyntax = bodyMatch.NewRoot.FindToken(newStatementSyntaxSpan.Start).Parent;
1572var token = syntaxRoot.FindToken(unmappedActiveStatementSpan.Start);
1710envelope.Start,
1713startPositionComparer: (x, y) => x.UnmappedSpan.Start.CompareTo(y));
1717if (!hole.Contains(statements[i].UnmappedSpan.Start))
2157lastNewToken.HasTrailingTrivia ? lastNewToken.Span.End : newTokensEnum.Current.FullSpan.Start,
FormattingContext.cs (12)
162if (operationSpan.Start < baseSpan.Start ||
208var inseparableRegionStartingPosition = effectiveBaseTokenGetter(this, operation).FullSpan.Start;
227var indentationData = _indentationTree.GetSmallestContainingInterval(operation.TextSpan.Start, 0);
436var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.Length);
473var indentationData = _relativeIndentationTree.GetSmallestContainingInterval(span.Start, 0);
495var anchorData = _anchorTree.GetSmallestContainingInterval(span.Start, 0);
499DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
566var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.Length);
624var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
653var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
675=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.Length);
J\s\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
67index += span.Start;
PatternMatching\PatternMatcher.cs (8)
229var hump = TextSpan.FromBounds(candidateHumps[i].Start, candidateLength);
234matchedSpan: GetMatchedSpan(hump.Start, patternChunk.Text.Length));
403candidate, candidatePart.Start, patternPart.Length,
404pattern, patternPart.Start, patternPart.Length, compareOptions) == 0;
537if (!char.IsUpper(patternChunk.Text[patternHumps[currentPatternHump - 1].Start]) ||
538!char.IsUpper(patternChunk.Text[patternHumps[currentPatternHump].Start]))
549matchSpans.Add(new TextSpan(candidateHump.Start, patternChunkCharacterSpan.Length));
559candidateHump = new TextSpan(candidateHump.Start + patternChunkCharacterSpan.Length, candidateHump.Length - patternChunkCharacterSpan.Length);
Rename\ConflictEngine\ConflictResolver.Session.cs (12)
223renamedSpansTracker.GetAdjustedPosition(_renameSymbolDeclarationLocation.SourceSpan.Start, _documentIdOfRenameSymbolDeclaration),
419var baseToken = baseRoot.FindToken(conflictAnnotation.OriginalSpan.Start, true);
539var adjustedStartPosition = conflictResolution.GetAdjustedTokenStartingPosition(originalReference.TextSpan.Start, originalReference.DocumentId);
540if (newLocations.Any(loc => loc.SourceSpan.Start == adjustedStartPosition))
589var newAdjustedStartPosition = conflictResolution.GetAdjustedTokenStartingPosition(renameDeclarationLocationReference.TextSpan.Start, renameDeclarationLocationReference.DocumentId);
590if (newAdjustedStartPosition != newLocation.SourceSpan.Start)
598var overridingSymbol = await SymbolFinder.FindSymbolAtPositionAsync(solution.GetRequiredDocument(newLocation.SourceTree), newLocation.SourceSpan.Start, cancellationToken: _cancellationToken).ConfigureAwait(false);
649var newReferencedSymbols = RenameUtilities.GetSymbolsTouchingPosition(tokenOrNode.Span.Start, newDocumentSemanticModel, newDocument.Project.Solution.Services, _cancellationToken);
676? conflictResolution.GetAdjustedTokenStartingPosition(_renameSymbolDeclarationLocation.SourceSpan.Start, _documentIdOfRenameSymbolDeclaration)
677: _renameSymbolDeclarationLocation.SourceSpan.Start;
896var offset = renameLocation.Location.SourceSpan.Start - containingLocationForStringOrComment.Start;
TextChangeRangeExtensions.cs (19)
37var currentStart = accumulatedTextChangeSoFar.Value.Span.Start;
39var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.NewLength;
68if (newChange.Span.Start < currentStart)
70currentStart = newChange.Span.Start;
96currentNewEnd = newChange.Span.Start + newChange.NewLength;
161else if (newChange.SpanEnd <= oldChange.Span.Start + oldDelta)
179else if (newChange.SpanStart < oldChange.Span.Start + oldDelta)
198var newChangeLeadingDeletion = oldChange.Span.Start + oldDelta - newChange.SpanStart;
200newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newChange.SpanLength - newChangeLeadingDeletion, newChange.NewLength);
203else if (newChange.SpanStart > oldChange.Span.Start + oldDelta)
221var oldChangeLeadingInsertion = newChange.SpanStart - (oldChange.Span.Start + oldDelta);
224addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
231Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
310newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newDeletion, newChange.NewLength);
387if (last.Span.End == change.Span.Start)
390builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
393else if (last.Span.End > change.Span.Start)
429: this(range.Span.Start, range.Span.Length, range.NewLength)
434private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;