211 references to Start
CSharpSyntaxGenerator (1)
SourceGenerator.cs (1)
85var position = line.Start + offset;
Microsoft.AspNetCore.App.Analyzers (2)
Infrastructure\VirtualChars\TextLineExtensions.cs (2)
15for (var i = line.Start; i < line.End; i++) 19return i - line.Start;
Microsoft.CodeAnalysis (8)
Syntax\LineDirectiveMap.cs (2)
209int lineLength = endLine.EndIncludingLineBreak - endLine.Start; 229int lineLength = lastLine.EndIncludingLineBreak - lastLine.Start;
Text\CompositeText.cs (1)
530var resultLine = TextLine.FromSpanUnsafe(_compositeText, new TextSpan(firstSegmentOffset + firstSegmentTextLine.Start, lineLength));
Text\SubText.cs (1)
173var startInUnderlyingText = Math.Max(underlyingTextLine.Start, _subText.UnderlyingSpan.Start);
Text\TextLine.cs (2)
160get { return TextSpan.FromBounds(this.Start, this.End); } 168get { return TextSpan.FromBounds(this.Start, this.EndIncludingLineBreak); }
Text\TextLineCollection.cs (2)
49return new LinePosition(line.LineNumber, position - line.Start); 70return this[position.Line].Start + position.Character;
Microsoft.CodeAnalysis.CodeStyle (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
76activeSectionStart = textLine.Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
29return lineText[..(linePosition.Value - line.Start)]; 72var linePosition = text.Lines[lineNumber].Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
111var linePosition = text.Lines[lineNumber].Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (4)
15var startPosition = line.Start; 35? firstNonWhitespaceOffset + line.Start 49for (var i = line.Start; i < line.End; i++) 52return i - line.Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
167baseToken = baseToken.SyntaxTree.GetRoot(cancellationToken).FindToken(textLine.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
30return line.GetColumnFromLineOffset(token.SpanStart - line.Start, tabSize);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (12)
80_syntaxFacts.IsInInactiveRegion(this.Tree, LineToBeIndented.Start, this.CancellationToken)) 126var token = Root.FindToken(LineToBeIndented.Start); 131if (token.SpanStart >= LineToBeIndented.Start) 160return new IndentationResult(basePosition: line.Start + offset.Value, offset: 0); 193indentationResult = new IndentationResult(basePosition: LineToBeIndented.Start, offset: offset); 204=> new(this.LineToBeIndented.Start, addedSpaces); 229var token = Root.FindTokenFromEnd(LineToBeIndented.Start); 230var indentation = Finder.GetIndentationOfCurrentPosition(this.Tree, token, LineToBeIndented.Start, CancellationToken.None); 232return new IndentationResult(LineToBeIndented.Start, indentation); 240if (LineToBeIndented.Start < position) 242return TextSpan.FromBounds(LineToBeIndented.Start, position); 245return TextSpan.FromBounds(position, LineToBeIndented.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
87text = prefix + " " + line.ToString()[(spanStart - line.Start)..].Trim() + " " + Ellipsis;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
154return line.GetColumnFromLineOffset(startPosition - line.Start, tabSize);
Microsoft.CodeAnalysis.CodeStyle.Fixes (21)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (17)
94if (position != conflictLine.Start) 103var startTrivia = root.FindTrivia(startLine.Start); 104var firstMiddleTrivia = root.FindTrivia(firstMiddleLine.Start); 105var secondMiddleTrivia = root.FindTrivia(secondMiddleLine.Start); 107if (position == firstMiddleLine.Start) 114else if (position == secondMiddleLine.Start) 125else if (position == endLine.Start) 246var currentLineStart = currentLine.Start; 247var currentLineLength = currentLine.End - currentLine.Start; 279var startPos = startLine.Start; 280var firstMiddlePos = firstMiddleLine.Start; 281var secondMiddlePos = secondMiddleLine.Start; 282var endPos = endLine.Start; 419var startPos = startLine.Start; 420var firstMiddlePos = firstMiddleLine.Start; 421var secondMiddlePos = secondMiddleLine.Start; 422var endPos = endLine.Start;
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (1)
71text.Lines[diagnosticLinePositionSpan.Start.Line].Start,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (3)
33if (tokenLine.Start != token.SpanStart) 40return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart)); 70var baseOffsetInLine = indentationResult.BasePosition - baseLine.Start;
Microsoft.CodeAnalysis.CSharp (2)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1289var lineLength = line.End - line.Start; 1296var referencedPosition = line.Start + characterNumberZeroBased;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
135for (var i = textLine.Start; i < textLine.End; i++)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (5)
175new TextSpan(textLine.Start, ComputeCommonIndentationLength(textLine)), 184if (indentation[commonIndentation] != text[textLine.Start + commonIndentation]) 225if (textLine.Text![textLine.Start] == '#') 227var token = root.FindToken(textLine.Start, findInsideTrivia: true); 235return new TextChange(new TextSpan(textLine.Start, 0), newText: indentation);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
InlineRename\CSharpEditorInlineRenameService.cs (1)
157startPosition = documentText.Lines[startLine].Start;
StringCopyPaste\StringCopyPasteHelpers.cs (2)
106for (int i = line.Start, n = line.End; i < n; i++) 514commonIndentPrefix = GetCommonIndentationPrefix(commonIndentPrefix, text, TextSpan.FromBounds(line.Start, nonWhitespaceIndex));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Extensions\SyntaxTreeExtensionsTests.cs (2)
19for (var pos = line.Start; pos < line.EndIncludingLineBreak; pos++) 28for (var pos = line.Start; pos < line.EndIncludingLineBreak; pos++)
StringIndentation\StringIndentationTests.cs (2)
49var offset = region.IndentSpan.End - lastLine.Start; 53var lineStart = text.Lines[i].Start;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\CSharpPDBTestBase.cs (2)
42var startColumn = span.Start - startLine.Start + 1; 46var endColumn = span.End - endLine.Start + 1;
Microsoft.CodeAnalysis.CSharp.Features (17)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (5)
306if (restrictedSpans.Algorithms.HasIntervalThatIntersectsWith(line.Start, new TextSpanIntervalIntrospector())) 322if (interpolationInteriorSpans.Any(s => s.Contains(line.Start))) 329rootAnchorIndentation, text, formattingOptions, stringExpression, line.Start); 477var indentation = lineText.ConvertTabToSpace(options.TabSize, initialColumn: 0, endPosition: position - lineContainingPosition.Start); 514? startLine.Start
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (3)
73for (var i = lastLine.Start; i < lastLine.End && SyntaxFacts.IsWhitespace(text[i]); i++) 79if (currentLine.Start + whitespaceCount < currentLine.End) 84currentLine.Start + whitespaceCount,
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
135for (var i = textLine.Start; i < textLine.End; i++)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (5)
175new TextSpan(textLine.Start, ComputeCommonIndentationLength(textLine)), 184if (indentation[commonIndentation] != text[textLine.Start + commonIndentation]) 225if (textLine.Text![textLine.Start] == '#') 227var token = root.FindToken(textLine.Start, findInsideTrivia: true); 235return new TextChange(new TextSpan(textLine.Start, 0), newText: indentation);
StringIndentation\CSharpStringIndentationService.cs (2)
178indentSpan = TextSpan.FromBounds(firstLine.Start, lastLine.Start + offset);
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (1)
53var span = TextSpan.FromBounds(startLine.Start, endLine.End);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\LineSpanDirectiveTests.cs (2)
246var actualVisibility = textB.Lines.Select(line => treeB.GetLineVisibility(line.Start)).ToImmutableArray(); 501return Math.Min(line.Start + position.Character, line.End);
Microsoft.CodeAnalysis.EditorFeatures (1)
IntelliSense\AsyncCompletion\CompletionSource.cs (1)
598var startOfLine = text.Lines.GetLineFromPosition(questionPosition).Start;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeFixes\CodeFixServiceTests.cs (1)
925var span = new TextSpan(line.Start, line.End);
Microsoft.CodeAnalysis.Features (36)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
111token = root.FindToken(line.Start); 276var startToken = root.FindToken(lineAtPos.Start);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (3)
147var containingType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(line.Start, cancellationToken); 162beforeThisLocation: semanticModel.SyntaxTree.GetLocation(TextSpan.FromBounds(line.Start, line.Start))));
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
68var lineStart = text.Lines.GetLineFromPosition(caretPosition).Start;
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (5)
57for (var i = line.Start; i < commentStart; i++) 215if (!lineOffset.HasValue || line.Start + lineOffset.Value < startPosition) 348Debug.Assert(line.Start + lineOffset == startPosition); 434? TextSpan.FromBounds(currentLine.Start, currentLine.Start + firstNonWhitespaceOffset.Value)
EditAndContinue\ActiveStatementsMap.cs (2)
280var start = lines[lineSpan.Start.Line].Start + lineSpan.Start.Character; 281var end = lines[lineSpan.End.Line].Start + lineSpan.End.Character;
QuickInfo\IndentationHelper.cs (2)
56var deletion = TextSpan.FromBounds(line.Start, line.Start + lineOffsetOfColumn);
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (17)
94if (position != conflictLine.Start) 103var startTrivia = root.FindTrivia(startLine.Start); 104var firstMiddleTrivia = root.FindTrivia(firstMiddleLine.Start); 105var secondMiddleTrivia = root.FindTrivia(secondMiddleLine.Start); 107if (position == firstMiddleLine.Start) 114else if (position == secondMiddleLine.Start) 125else if (position == endLine.Start) 246var currentLineStart = currentLine.Start; 247var currentLineLength = currentLine.End - currentLine.Start; 279var startPos = startLine.Start; 280var firstMiddlePos = firstMiddleLine.Start; 281var secondMiddlePos = secondMiddleLine.Start; 282var endPos = endLine.Start; 419var startPos = startLine.Start; 420var firstMiddlePos = firstMiddleLine.Start; 421var secondMiddlePos = secondMiddleLine.Start; 422var endPos = endLine.Start;
TaskList\AbstractTaskListService.cs (4)
153AppendTaskListItemsOnSingleLine(commentDescriptors, document, message, line.Start, items); 156var length = fullSpan.End - endLine.Start; 160var endMessage = text.ToString(new TextSpan(endLine.Start, length)); 161AppendTaskListItemsOnSingleLine(commentDescriptors, document, endMessage, endLine.Start, items);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\SemanticTokens\SemanticTokensHelpers.cs (2)
194var absoluteStart = line.Start + startOffset; 209textSpan = new TextSpan(line.Start, endOffSet);
Microsoft.CodeAnalysis.UnitTests (5)
Text\LargeTextTests.cs (2)
159Assert.Equal(start, textLine.Start); 171for (int p = textLine.Start; p < textLine.EndIncludingLineBreak; ++p)
Text\StringText_LineTest.cs (1)
88Assert.Equal(start, line.Start);
Text\StringTextTest.cs (2)
112Assert.Equal(start, textLine.Start); 124for (int p = textLine.Start; p < textLine.EndIncludingLineBreak; ++p)
Microsoft.CodeAnalysis.VisualBasic (4)
CommandLine\CommandLineDiagnosticFormatter.vb (4)
66If sourceSpan.IsEmpty AndAlso line.Start = sourceSpanEnd AndAlso linenumber > 0 Then 74While (line.Start < sourceSpanEnd) 80For position = Math.Min(sourceSpanStart, line.Start) To Math.Min(line.End, sourceSpanStart) - 1 93For position = Math.Max(sourceSpanStart, line.Start) To Math.Min(If(sourceSpanEnd = sourceSpanStart, sourceSpanEnd, sourceSpanEnd - 1), line.End - 1)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
359Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(line.Start)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Utilities\NavigationPointHelpers.vb (1)
70Return New VirtualTreePoint(beginStatement.SyntaxTree, text, line.GetLineOffsetFromColumn(targetColumn, indentSize) + line.Start)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (1)
34Dim destinationLineSpan = text.Lines(_destinationLine).Start
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
197Dim position = text.Lines(destinationLine).Start
Structure\Providers\XmlExpressionStructureProvider.vb (1)
28Dim lineText = line.ToString().Substring(span.Start - line.Start)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
Syntax\ManualTests.vb (1)
227Dim token = tree.GetRoot().FindToken(text.Lines.Item(3).Start)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
CompilationTestUtils.vb (1)
1026offsetInLine = position - textLine.Start
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
359Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(line.Start)
Microsoft.CodeAnalysis.Workspaces (31)
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (2)
71var startLineStartPosition = oldDocumentText.Lines.GetLineFromPosition(startPosition).Start; 144? text.GetSubText(TextSpan.FromBounds(text.Lines[startLine].Start, text.Lines[endLine].End)).ToString()
Shared\Extensions\SourceTextExtensions.cs (1)
40offset = position - line.Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
76activeSectionStart = textLine.Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
29return lineText[..(linePosition.Value - line.Start)]; 72var linePosition = text.Lines[lineNumber].Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
111var linePosition = text.Lines[lineNumber].Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (4)
15var startPosition = line.Start; 35? firstNonWhitespaceOffset + line.Start 49for (var i = line.Start; i < line.End; i++) 52return i - line.Start;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
167baseToken = baseToken.SyntaxTree.GetRoot(cancellationToken).FindToken(textLine.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
30return line.GetColumnFromLineOffset(token.SpanStart - line.Start, tabSize);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (12)
80_syntaxFacts.IsInInactiveRegion(this.Tree, LineToBeIndented.Start, this.CancellationToken)) 126var token = Root.FindToken(LineToBeIndented.Start); 131if (token.SpanStart >= LineToBeIndented.Start) 160return new IndentationResult(basePosition: line.Start + offset.Value, offset: 0); 193indentationResult = new IndentationResult(basePosition: LineToBeIndented.Start, offset: offset); 204=> new(this.LineToBeIndented.Start, addedSpaces); 229var token = Root.FindTokenFromEnd(LineToBeIndented.Start); 230var indentation = Finder.GetIndentationOfCurrentPosition(this.Tree, token, LineToBeIndented.Start, CancellationToken.None); 232return new IndentationResult(LineToBeIndented.Start, indentation); 240if (LineToBeIndented.Start < position) 242return TextSpan.FromBounds(LineToBeIndented.Start, position); 245return TextSpan.FromBounds(position, LineToBeIndented.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
87text = prefix + " " + line.ToString()[(spanStart - line.Start)..].Trim() + " " + Ellipsis;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
154return line.GetColumnFromLineOffset(startPosition - line.Start, tabSize);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\AbstractIndentationService.cs (1)
52var baseIndentationRule = formattingRuleFactory.CreateRule(document, lineToBeIndented.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (3)
33if (tokenLine.Start != token.SpanStart) 40return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart)); 70var baseOffsetInLine = indentationResult.BasePosition - baseLine.Start;
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
SolutionTests\ProjectSemanticVersionTests.cs (4)
156var position = text.Lines[1].Start; 170var position = text.Lines[2].Start; 198var position = text.Lines[1].Start; 212var position = text.Lines[1].Start;
Microsoft.VisualStudio.LanguageServices (13)
CallHierarchy\CallHierarchyDetail.cs (1)
44var start = location.SourceTree.GetText().Lines[lineSpan.StartLinePosition.Line].Start;
Extensions\DocumentExtensions.cs (2)
31var trivia = document.GetSyntaxRootSynchronously(cancellationToken).FindTrivia(line.Start); 46start = text.Lines[line.LineNumber + 1].Start;
Extensions\VirtualTreePointExtensions.cs (1)
18var columnIndex = virtualSnapshotPoint.Position - line.Start;
FindReferences\Entries\DocumentSpanEntry.cs (1)
240sourceText.Lines[firstLineNumber].Start,
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (2)
62var start = text.Lines[ts.iStartLine].Start + ts.iStartIndex; 63var end = text.Lines[ts.iEndLine].Start + ts.iEndIndex;
Venus\ContainedDocument.cs (6)
548TextSpan.FromBounds(visibleFirstLineInOriginalText.EndIncludingLineBreak, visibleLastLineInOriginalText.Start), 583if (spanInOriginalText.Start <= visibleLastLineInOriginalText.Start) 586TextSpan.FromBounds(spanInOriginalText.Start, visibleLastLineInOriginalText.Start), 891for (var line = startingLine; line.Start < span.End; line = text.Lines[line.LineNumber + 1]) 942end = (lastLine.Start < end + 1) ? end : lastLine.Start - 1;
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.NodeLocator.cs (4)
143? new VirtualTreePoint(openBrace.SyntaxTree, text, text.Lines[openBraceLine.LineNumber + 1].Start) 182return new VirtualTreePoint(openBrace.SyntaxTree, text, lineAfterOpenBrace.Start + firstNonWhitespaceOffset); 214var textBeforeBrace = text.ToString(TextSpan.FromBounds(closeBraceLine.Start, closeBrace.SpanStart)); 217? new VirtualTreePoint(closeBrace.SyntaxTree, text, closeBraceLine.Start)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
CodeModel\MockTextManagerAdapter.TextPoint.cs (3)
45get { return _point.Position == _point.GetContainingLine().Start; } 91var result = _point.Position - _point.GetContainingLine().Start + 1; 106return line.End - line.Start;
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Venus\DocumentService_IntegrationTests.vb (1)
328Return New ExcerptResult(mappedSource.GetSubText(line.Span), New TextSpan(mappedSpan.Start - line.Start, mappedSpan.Length), ImmutableArray.Create(New ClassifiedSpan(New TextSpan(0, line.Span.Length), ClassificationTypeNames.Text)), document, span)
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (6)
346startPosition = text.Lines(statementLine.LineNumber + 1).Start 417startPosition = text.Lines(statementLine.LineNumber + 1).Start 507startPosition = text.Lines(startLine.LineNumber + 1).Start 731startPosition = text.Lines(lineNumber).Start 816startPosition = text.Lines(startLine.LineNumber + 1).Start 1029startPosition = text.Lines(lineNumber).Start