1 write to Start
Microsoft.CodeAnalysis (1)
1717 references to Start
AnalyzerRunner (1)
Microsoft.Analyzers.Extra.Tests (4)
Microsoft.Analyzers.Local.Tests (5)
Microsoft.AspNetCore.Analyzer.Testing (2)
Microsoft.AspNetCore.App.Analyzers (30)
Microsoft.AspNetCore.App.Analyzers.Test (5)
Microsoft.AspNetCore.App.CodeFixes (2)
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Components.Analyzers.Tests (3)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (3)
Microsoft.CodeAnalysis (112)
Text\TextChangeRangeExtensions.cs (19)
38var currentStart = accumulatedTextChangeSoFar.Value.Span.Start;
40var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.NewLength;
69if (newChange.Span.Start < currentStart)
71currentStart = newChange.Span.Start;
97currentNewEnd = newChange.Span.Start + newChange.NewLength;
162else if (newChange.SpanEnd <= oldChange.Span.Start + oldDelta)
180else if (newChange.SpanStart < oldChange.Span.Start + oldDelta)
199var newChangeLeadingDeletion = oldChange.Span.Start + oldDelta - newChange.SpanStart;
201newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newChange.SpanLength - newChangeLeadingDeletion, newChange.NewLength);
204else if (newChange.SpanStart > oldChange.Span.Start + oldDelta)
222var oldChangeLeadingInsertion = newChange.SpanStart - (oldChange.Span.Start + oldDelta);
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
311newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newDeletion, newChange.NewLength);
388if (last.Span.End == change.Span.Start)
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
394else if (last.Span.End > change.Span.Start)
430: this(range.Span.Start, range.Span.Length, range.NewLength)
435private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;
Microsoft.CodeAnalysis.CodeStyle (183)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (19)
38var currentStart = accumulatedTextChangeSoFar.Value.Span.Start;
40var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.NewLength;
69if (newChange.Span.Start < currentStart)
71currentStart = newChange.Span.Start;
97currentNewEnd = newChange.Span.Start + newChange.NewLength;
162else if (newChange.SpanEnd <= oldChange.Span.Start + oldDelta)
180else if (newChange.SpanStart < oldChange.Span.Start + oldDelta)
199var newChangeLeadingDeletion = oldChange.Span.Start + oldDelta - newChange.SpanStart;
201newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newChange.SpanLength - newChangeLeadingDeletion, newChange.NewLength);
204else if (newChange.SpanStart > oldChange.Span.Start + oldDelta)
222var oldChangeLeadingInsertion = newChange.SpanStart - (oldChange.Span.Start + oldDelta);
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
311newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newDeletion, newChange.NewLength);
388if (last.Span.End == change.Span.Start)
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
394else if (last.Span.End > change.Span.Start)
430: this(range.Span.Start, range.Span.Length, range.NewLength)
435private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (11)
162if (operationSpan.Start < baseSpan.Start ||
208var inseparableRegionStartingPosition = effectiveBaseTokenGetter(this, operation).FullSpan.Start;
227var indentationData = _indentationTree.GetSmallestContainingInterval(operation.TextSpan.Start, 0);
413var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.Length);
450var indentationData = _relativeIndentationTree.GetSmallestContainingInterval(span.Start, 0);
472var anchorData = _anchorTree.GetSmallestContainingInterval(span.Start, 0);
476DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
601var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
630var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
652=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.Length);
Microsoft.CodeAnalysis.CodeStyle.Fixes (43)
Microsoft.CodeAnalysis.CSharp (52)
Microsoft.CodeAnalysis.CSharp.CodeStyle (27)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (30)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (25)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (11)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (106)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (9)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (42)
Diagnostics\DiagnosticTest.cs (13)
2354Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "public class").Start));
2355Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "public static").Start));
2356Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "public static").Start));
2357Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "int x").Start));
2358Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "int x").Start));
2359Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "int y").Start));
2360Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "int y").Start));
2361Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "int z").Start));
2362Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "int z").Start));
2383Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "static void").Start));
2384Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "var x").Start));
2385Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "var y").Start));
2401Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "static void").Start));
LexicalAndXml\LexicalTests.cs (12)
3980Assert.Equal(16, trivia.Span.Start);
3985Assert.Equal(18, trivia.Span.Start);
4025Assert.Equal(16, trivia2.Span.Start);
4030Assert.Equal(18, trivia3.Span.Start);
4035Assert.Equal(33, trivia4.Span.Start);
4058Assert.Equal(16, trivia2.Span.Start);
4063Assert.Equal(18, trivia3.Span.Start);
4109Assert.Equal(19, trivia.Span.Start);
4114Assert.Equal(21, trivia.Span.Start);
4144Assert.Equal(19, trivia2.Span.Start);
4149Assert.Equal(21, trivia3.Span.Start);
4154Assert.Equal(36, trivia4.Span.Start);
Microsoft.CodeAnalysis.CSharp.Workspaces (37)
Rename\CSharpRenameRewriterLanguageService.cs (6)
111newSpan = new TextSpan(oldSpan.Start, newSpan.Length);
317_renameSpansTracker.AddComplexifiedSpan(_documentId, oldSpan, new TextSpan(oldSpan.Start, newSpan.Length), _modifiedSubSpans);
349var symbols = RenameUtilities.GetSymbolsTouchingPosition(token.Span.Start, _semanticModel, _solution.Services, _cancellationToken);
874var token = await tree.GetTouchingTokenAsync(location.SourceSpan.Start, cancellationToken, findInsideTrivia: true).ConfigureAwait(false);
902var token = await location.SourceTree!.GetTouchingTokenAsync(location.SourceSpan.Start, cancellationToken, findInsideTrivia: true).ConfigureAwait(false);
1007implicitReferenceLocation.Location.SourceSpan.Start, cancellationToken, findInsideTrivia: false).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures (45)
CommentSelection\AbstractToggleBlockCommentBase.cs (22)
153var trackingSpan = TextSpan.FromBounds(intersectingBlockComments.First().Start, intersectingBlockComments.Last().End);
234if (blockCommentSelection.IsLocationCommented(selectedSpan.Start) && !startsWithCommentMarker)
236InsertText(textChanges, selectedSpan.Start, commentInfo.BlockCommentEndString);
237InsertText(textChanges, selectedSpan.Start, commentInfo.BlockCommentStartString);
256InsertText(textChanges, span.Start, commentInfo.BlockCommentStartString);
263DeleteText(textChanges, new TextSpan(spanToRemove.Start, commentInfo.BlockCommentStartString.Length));
303for (var i = span.Start; i < span.End; i++)
363var selectedLine = snapshot.GetLineFromPosition(SelectedSpan.Start);
364var lineStartToCaretIsWhitespace = IsSpanWhitespace(TextSpan.FromBounds(selectedLine.Start, SelectedSpan.Start));
365var caretToLineEndIsWhitespace = IsSpanWhitespace(TextSpan.FromBounds(SelectedSpan.Start, selectedLine.End));
369&& SelectedSpan.Start < blockComment.Start
370&& snapshot.AreOnSameLine(SelectedSpan.Start, blockComment.Start))
372if (IsSpanWhitespace(TextSpan.FromBounds(SelectedSpan.Start, blockComment.Start)))
379&& SelectedSpan.Start > blockComment.End
380&& snapshot.AreOnSameLine(SelectedSpan.Start, blockComment.End))
382if (IsSpanWhitespace(TextSpan.FromBounds(blockComment.End, SelectedSpan.Start)))
409var spanStart = SelectedSpan.Start;
412if (commentedSpan.Start > spanStart)
415var possibleUncommentedSpan = TextSpan.FromBounds(spanStart, commentedSpan.Start);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (35)
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (16)
RenameTracking\RenameTrackingTaggerProviderTests.cs (5)
382state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "cation");
396state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Complex");
410state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Dog");
430state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "_");
854state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Go");
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (1)
Microsoft.CodeAnalysis.Features (175)
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
Microsoft.CodeAnalysis.Features.UnitTests (1)
Microsoft.CodeAnalysis.InteractiveHost (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol (28)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (20)
Microsoft.CodeAnalysis.VisualBasic (64)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (10)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (13)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
Microsoft.CodeAnalysis.VisualBasic.Features (50)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (36)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (34)
1258paramSymbol1.Locations.Single().SourceSpan.Start)
1266paramSymbol2.Locations.Single().SourceSpan.Start - "Optional ".Length)
1274paramSymbol3.Locations.Single().SourceSpan.Start)
1282paramSymbol4.Locations.Single().SourceSpan.Start)
1290paramSymbol5.Locations.Single().SourceSpan.Start)
1369Assert.Equal(syntax.SpanStart + 6, paramSymbol1.Locations.Single().SourceSpan.Start)
1374Assert.Equal(syntax.SpanStart + 6, paramSymbol2.Locations.Single().SourceSpan.Start)
1379Assert.Equal(syntax.SpanStart, paramSymbol3.Locations.Single().SourceSpan.Start)
1384Assert.Equal(syntax.SpanStart + 6, paramSymbol4.Locations.Single().SourceSpan.Start)
1849Assert.True(syntax.SpanStart = tpSymbol1.Locations.Item(0).SourceSpan.Start OrElse
1850syntax.SpanStart = tpSymbol1.Locations.Item(1).SourceSpan.Start,
1858Assert.True(syntax.SpanStart = tpSymbol2.Locations.Item(0).SourceSpan.Start OrElse
1859syntax.SpanStart = tpSymbol2.Locations.Item(1).SourceSpan.Start,
1867Assert.True(syntax.SpanStart = tpSymbol3.Locations.Item(0).SourceSpan.Start OrElse
1868syntax.SpanStart = tpSymbol3.Locations.Item(1).SourceSpan.Start,
1876Assert.True(syntax.SpanStart = tpSymbol4.Locations.Item(0).SourceSpan.Start OrElse
1877syntax.SpanStart = tpSymbol4.Locations.Item(1).SourceSpan.Start,
1885Assert.Equal(syntax.SpanStart, tpSymbol5.Locations.Single().SourceSpan.Start)
2022Assert.True(syntax.SpanStart = varSymbol1.Locations.Item(0).SourceSpan.Start OrElse
2023syntax.SpanStart = varSymbol1.Locations.Item(1).SourceSpan.Start,
2032Assert.True(syntax.SpanStart = varSymbol2.Locations.Item(0).SourceSpan.Start OrElse
2033syntax.SpanStart = varSymbol2.Locations.Item(1).SourceSpan.Start,
2042Assert.True(syntax.SpanStart = varSymbol3.Locations.Item(0).SourceSpan.Start OrElse
2043syntax.SpanStart = varSymbol3.Locations.Item(1).SourceSpan.Start,
2052Assert.True(syntax.SpanStart = varSymbol4.Locations.Item(0).SourceSpan.Start OrElse
2053syntax.SpanStart = varSymbol4.Locations.Item(1).SourceSpan.Start,
2062Assert.True(syntax.SpanStart = varSymbol5.Locations.Item(0).SourceSpan.Start OrElse
2063syntax.SpanStart = varSymbol5.Locations.Item(1).SourceSpan.Start,
2072Assert.True(syntax.SpanStart = varSymbol6.Locations.Item(0).SourceSpan.Start OrElse
2073syntax.SpanStart = varSymbol6.Locations.Item(1).SourceSpan.Start,
2083Assert.True(syntax.SpanStart = varSymbol7.Locations.Item(0).SourceSpan.Start OrElse
2084syntax.SpanStart = varSymbol7.Locations.Item(1).SourceSpan.Start,
2093Assert.True(syntax.SpanStart = varSymbol8.Locations.Item(0).SourceSpan.Start OrElse
2094syntax.SpanStart = varSymbol8.Locations.Item(1).SourceSpan.Start,
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (40)
TestSyntaxNodes.vb (38)
222Assert.Equal(expectedFullSpan.Start, list(0).FullSpan.Start)
228Assert.Equal(list(i - 1).FullSpan.End, list(i).FullSpan.Start)
231Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start)
244Assert.Equal(expectedFullSpan.Start, list(0).FullSpan.Start)
250Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start)
266Assert.Equal(expectedFullSpan.Start, list(0).FullSpan.Start)
272Assert.Equal(list(i - 1).FullSpan.End, list(i).FullSpan.Start)
275Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start)
290Assert.Equal(expectedFullSpan.Start, list(0).FullSpan.Start)
296Assert.Equal(list(i - 1).FullSpan.End, list(i).FullSpan.Start)
299Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start)
309Assert.Equal(expectedFullSpan.Start, list(0).FullSpan.Start)
315Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start)
334Assert.Equal(tree.SpanStart, tree.FullSpan.Start)
336VerifyListSpans(precedingTrivia, New TextSpan(tree.FullSpan.Start, (tree.SpanStart - tree.FullSpan.Start)))
359Assert.Equal(tree.SpanStart, tree.FullSpan.Start)
361VerifyListSpans(precedingTrivia, New TextSpan(tree.FullSpan.Start, (tree.SpanStart - tree.FullSpan.Start)))
411VerifyListSpans(statements, TextSpan.FromBounds(statements(0).FullSpan.Start, statements(statements.Count - 1).FullSpan.End))
595Assert.Equal(start, seplist(0).FullSpan.Start)
685Assert.Equal(0, tok.FullSpan.Start)
701Assert.Equal(0, tok.FullSpan.Start)
709Assert.Equal(1, follTrivia(0).FullSpan.Start)
715Assert.Equal(4, follTrivia(1).FullSpan.Start)
728Assert.Equal(0, tok.FullSpan.Start)
740Assert.Equal(0, precTrivia(0).FullSpan.Start)
746Assert.Equal(4, precTrivia(1).FullSpan.Start)
752Assert.Equal(6, precTrivia(2).FullSpan.Start)
761Assert.Equal(10, follTrivia(0).FullSpan.Start)
934Dim i = span1.Start.CompareTo(span2.Start)
2298invalidSpan = New TextSpan(classDecl2.FullSpan.Start - 1, root.FullSpan.End)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (8)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (37)
Rename\VisualBasicRenameRewriterLanguageService.vb (4)
97newSpan = New TextSpan(oldSpan.Start, newSpan.Length)
237Me._renameSpansTracker.AddComplexifiedSpan(Me._documentId, oldSpan, New TextSpan(oldSpan.Start, newSpan.Length), Me._modifiedSubSpans)
295AddModifiedSpan(annotation.OriginalSpan, New TextSpan(token.Span.Start, newToken.Span.Length))
304Dim symbols = RenameUtilities.GetSymbolsTouchingPosition(token.Span.Start, _semanticModel, _solution.Services, _cancellationToken)
Microsoft.CodeAnalysis.Workspaces (258)
PatternMatching\PatternMatcher.cs (8)
256var hump = TextSpan.FromBounds(candidateHumps[i].Start, candidateLength);
261matchedSpan: GetMatchedSpan(hump.Start, patternChunk.Text.Length));
437candidate, candidatePart.Start, patternPart.Length,
438pattern, patternPart.Start, patternPart.Length, compareOptions) == 0;
575if (!char.IsUpper(patternChunk.Text[patternHumps[currentPatternHump - 1].Start]) ||
576!char.IsUpper(patternChunk.Text[patternHumps[currentPatternHump].Start]))
587matchSpans.Add(new TextSpan(candidateHump.Start, patternChunkCharacterSpan.Length));
597candidateHump = new TextSpan(candidateHump.Start + patternChunkCharacterSpan.Length, candidateHump.Length - patternChunkCharacterSpan.Length);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (19)
38var currentStart = accumulatedTextChangeSoFar.Value.Span.Start;
40var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.NewLength;
69if (newChange.Span.Start < currentStart)
71currentStart = newChange.Span.Start;
97currentNewEnd = newChange.Span.Start + newChange.NewLength;
162else if (newChange.SpanEnd <= oldChange.Span.Start + oldDelta)
180else if (newChange.SpanStart < oldChange.Span.Start + oldDelta)
199var newChangeLeadingDeletion = oldChange.Span.Start + oldDelta - newChange.SpanStart;
201newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newChange.SpanLength - newChangeLeadingDeletion, newChange.NewLength);
204else if (newChange.SpanStart > oldChange.Span.Start + oldDelta)
222var oldChangeLeadingInsertion = newChange.SpanStart - (oldChange.Span.Start + oldDelta);
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
311newChange = new UnadjustedNewChange(oldChange.Span.Start + oldDelta, newDeletion, newChange.NewLength);
388if (last.Span.End == change.Span.Start)
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
394else if (last.Span.End > change.Span.Start)
430: this(range.Span.Start, range.Span.Length, range.NewLength)
435private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (11)
162if (operationSpan.Start < baseSpan.Start ||
208var inseparableRegionStartingPosition = effectiveBaseTokenGetter(this, operation).FullSpan.Start;
227var indentationData = _indentationTree.GetSmallestContainingInterval(operation.TextSpan.Start, 0);
413var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.Length);
450var indentationData = _relativeIndentationTree.GetSmallestContainingInterval(span.Start, 0);
472var anchorData = _anchorTree.GetSmallestContainingInterval(span.Start, 0);
476DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
601var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
630var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
652=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.Length);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
Microsoft.Gen.Logging.Unit.Tests (4)
Microsoft.Gen.Metrics.Unit.Tests (4)
Microsoft.Gen.MetricsReports.Unit.Tests (4)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.VisualStudio.LanguageServices (46)
Venus\ContainedDocument.cs (29)
287if (change.Span.End < visibleSpan.Start)
335if (change.Span.End <= visibleTextSpan.Start)
340if (visibleTextSpan.End <= change.Span.Start)
354var offsetInOriginalText = changeInOriginalText.Span.Start;
508var visibleFirstLineInOriginalText = originalText.Lines.GetLineFromPosition(visibleSpanInOriginalText.Start);
519var snippetInRightText = rightText.Substring(spanInRightText.Start, spanInRightText.Length);
558if (spanInOriginalText.Start < visibleSpanInOriginalText.Start &&
559visibleSpanInOriginalText.Start <= spanInOriginalText.End &&
578if (visibleSpanInOriginalText.Start < spanInOriginalText.Start &&
579spanInOriginalText.Start <= visibleSpanInOriginalText.End &&
583if (spanInOriginalText.Start <= visibleLastLineInOriginalText.Start)
586TextSpan.FromBounds(spanInOriginalText.Start, visibleLastLineInOriginalText.Start),
734visibleSpansInOriginal[currentVisibleSpanIndex].End < change.Span.Start)
832var current = root.FindToken(visibleTextSpan.Start).Parent;
835if (current.Span.Start == visibleTextSpan.Start)
837var blockType = GetRazorCodeBlockType(visibleSpan.Start);
841return new BaseIndentationFormattingRule(root, TextSpan.FromBounds(visibleSpan.Start, end), baseIndentation, _vbHelperFormattingRule);
845if (current.Span.Start < visibleSpan.Start)
847var blockType = GetRazorCodeBlockType(visibleSpan.Start);
851return new BaseIndentationFormattingRule(root, TextSpan.FromBounds(visibleSpan.Start, end), baseIndentation, _vbHelperFormattingRule);
890var startingLine = text.Lines.GetLineFromPosition(span.Start);
913var start = visibleSpan.Start;
936var firstLine = text.Lines.GetLineFromPosition(visibleSpan.Start);
958var type = GetRazorCodeBlockType(span.Start);
975if (token.Span.Start == end && service != null)
Microsoft.VisualStudio.LanguageServices.CSharp (7)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (9)
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
System.Text.RegularExpressions.Generator (1)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)