1 write to Start
Microsoft.CodeAnalysis (1)
1741 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.Analyzers (3)
Microsoft.CodeAnalysis.CodeStyle (184)
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)
161if (operationSpan.Start < baseSpan.Start ||
207var inseparableRegionStartingPosition = effectiveBaseTokenGetter(this, operation).FullSpan.Start;
226var indentationData = _indentationTree.GetSmallestContainingInterval(operation.TextSpan.Start, 0);
412var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.Length);
449var indentationData = _relativeIndentationTree.GetSmallestContainingInterval(span.Start, 0);
471var anchorData = _anchorTree.GetSmallestContainingInterval(span.Start, 0);
475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
600var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
629var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
651=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.Length);
Microsoft.CodeAnalysis.CodeStyle.Fixes (43)
Microsoft.CodeAnalysis.CSharp (49)
Microsoft.CodeAnalysis.CSharp.CodeStyle (27)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (31)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (26)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (11)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (108)
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)
2360Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "public class").Start));
2361Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "public static").Start));
2362Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "public static").Start));
2363Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "int x").Start));
2364Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "int x").Start));
2365Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "int y").Start));
2366Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "int y").Start));
2367Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "int z").Start));
2368Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "int z").Start));
2389Assert.Equal(PragmaWarningState.Default, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "static void").Start));
2390Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(168), GetSpanIn(syntaxTree, "var x").Start));
2391Assert.Equal(PragmaWarningState.Disabled, syntaxTree.GetPragmaDirectiveWarningState(MessageProvider.Instance.GetIdForErrorCode(219), GetSpanIn(syntaxTree, "var y").Start));
2407Assert.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 (38)
Rename\CSharpRenameRewriterLanguageService.cs (6)
108newSpan = new TextSpan(oldSpan.Start, newSpan.Length);
313_renameSpansTracker.AddComplexifiedSpan(_documentId, oldSpan, new TextSpan(oldSpan.Start, newSpan.Length), _modifiedSubSpans);
345var symbols = RenameUtilities.GetSymbolsTouchingPosition(token.Span.Start, _semanticModel, _solution.Services, _cancellationToken);
865var token = await tree.GetTouchingTokenAsync(location.SourceSpan.Start, cancellationToken, findInsideTrivia: true).ConfigureAwait(false);
893var token = await location.SourceTree!.GetTouchingTokenAsync(location.SourceSpan.Start, cancellationToken, findInsideTrivia: true).ConfigureAwait(false);
998implicitReferenceLocation.Location.SourceSpan.Start, cancellationToken, findInsideTrivia: false).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures (43)
CommentSelection\AbstractToggleBlockCommentBase.cs (22)
151var trackingSpan = TextSpan.FromBounds(intersectingBlockComments.First().Start, intersectingBlockComments.Last().End);
232if (blockCommentSelection.IsLocationCommented(selectedSpan.Start) && !startsWithCommentMarker)
234InsertText(textChanges, selectedSpan.Start, commentInfo.BlockCommentEndString);
235InsertText(textChanges, selectedSpan.Start, commentInfo.BlockCommentStartString);
254InsertText(textChanges, span.Start, commentInfo.BlockCommentStartString);
261DeleteText(textChanges, new TextSpan(spanToRemove.Start, commentInfo.BlockCommentStartString.Length));
301for (var i = span.Start; i < span.End; i++)
361var selectedLine = snapshot.GetLineFromPosition(SelectedSpan.Start);
362var lineStartToCaretIsWhitespace = IsSpanWhitespace(TextSpan.FromBounds(selectedLine.Start, SelectedSpan.Start));
363var caretToLineEndIsWhitespace = IsSpanWhitespace(TextSpan.FromBounds(SelectedSpan.Start, selectedLine.End));
367&& SelectedSpan.Start < blockComment.Start
368&& snapshot.AreOnSameLine(SelectedSpan.Start, blockComment.Start))
370if (IsSpanWhitespace(TextSpan.FromBounds(SelectedSpan.Start, blockComment.Start)))
377&& SelectedSpan.Start > blockComment.End
378&& snapshot.AreOnSameLine(SelectedSpan.Start, blockComment.End))
380if (IsSpanWhitespace(TextSpan.FromBounds(blockComment.End, SelectedSpan.Start)))
407var spanStart = SelectedSpan.Start;
410if (commentedSpan.Start > spanStart)
413var 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)
381state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "cation");
395state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Complex");
409state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Dog");
429state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "_");
853state.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 (172)
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
Microsoft.CodeAnalysis.Features.UnitTests (1)
Microsoft.CodeAnalysis.InteractiveHost (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol (24)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (20)
Microsoft.CodeAnalysis.VisualBasic (64)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (9)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (13)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
Microsoft.CodeAnalysis.VisualBasic.Features (51)
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 (36)
Rename\VisualBasicRenameRewriterLanguageService.vb (4)
96newSpan = New TextSpan(oldSpan.Start, newSpan.Length)
236Me._renameSpansTracker.AddComplexifiedSpan(Me._documentId, oldSpan, New TextSpan(oldSpan.Start, newSpan.Length), Me._modifiedSubSpans)
294AddModifiedSpan(annotation.OriginalSpan, New TextSpan(token.Span.Start, newToken.Span.Length))
303Dim symbols = RenameUtilities.GetSymbolsTouchingPosition(token.Span.Start, _semanticModel, _solution.Services, _cancellationToken)
Microsoft.CodeAnalysis.Workspaces (262)
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)
161if (operationSpan.Start < baseSpan.Start ||
207var inseparableRegionStartingPosition = effectiveBaseTokenGetter(this, operation).FullSpan.Start;
226var indentationData = _indentationTree.GetSmallestContainingInterval(operation.TextSpan.Start, 0);
412var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.Length);
449var indentationData = _relativeIndentationTree.GetSmallestContainingInterval(span.Start, 0);
471var anchorData = _anchorTree.GetSmallestContainingInterval(span.Start, 0);
475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
600var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
629var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.Length);
651=> _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.MetadataExtractor.Unit.Tests (4)
Microsoft.Gen.Metrics.Unit.Tests (4)
Microsoft.Gen.MetricsReports.Unit.Tests (4)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.Maui.Controls.BindingSourceGen (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)
Roslyn.Diagnostics.Analyzers (18)
Roslyn.Diagnostics.CSharp.Analyzers (1)
System.Text.RegularExpressions.Generator (1)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)