742 references to SpanStart
Microsoft.AspNetCore.App.Analyzers (12)
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (4)
82Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 86Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 87currentVC.Span.Start == token.SpanStart + 2, "First span should start on the second or third char of the string."); 158var offset = token.SpanStart;
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (3)
135var offset = token.SpanStart; 237i += ConvertTextAtIndexToRune(tokenSourceText, i, result, token.SpanStart); 270var offset = token.SpanStart;
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (4)
87if (position <= token.SpanStart) 96while (position <= token.SpanStart && root.FullSpan.Start < token.SpanStart); 138if (token.Span.Length > 0 && token.SpanStart <= position)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
102if (context.Position <= stringToken.SpanStart ||
Microsoft.CodeAnalysis.CodeStyle (60)
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (4)
86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 91currentVC.Span.Start == token.SpanStart + 2, "First span should start on the second or third char of the string."); 162var offset = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
86text.AreOnSameLine(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (5)
585if (token.Span.Length > 0 && token.SpanStart <= position) 624if (position < token.SpanStart) 663if (position <= token.SpanStart) 672while (position <= token.SpanStart && root.FullSpan.Start < token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
75if (token.SpanStart == position &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
126return position <= firstToken.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
61position <= token.GetNextToken(includeZeroWidth: true).SpanStart) 132return GetIndentationOfCurrentPosition(root, list, token.SpanStart, /* extraSpaces */ 0, tokenColumnGetter, cancellationToken); 166var textLine = baseToken.SyntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(baseToken.SpanStart); 357if (operation.TextSpan.End == position && position == nextToken.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
418=> GetBaseIndentation(token.SpanStart); 644var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End); 659var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (4)
59o => o.TextSpan.Contains(startToken.SpanStart) || 60o.TextSpan.Contains(endToken.SpanStart))); 69var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End); 146var startPosition = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (3)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0))) 338var startPosition = this.TreeData.IsFirstToken(_startToken) ? this.TreeData.StartPosition : _startToken.SpanStart; 458var spanBetweenTokens = TextSpan.FromBounds(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
337var spanBetweenTokens = TextSpan.FromBounds(previousToken.Token.Span.End, currentToken.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
78var span = TextSpan.FromBounds(token1.RawKind == 0 ? this.TreeInfo.StartPosition : token1.Span.End, token2.RawKind == 0 ? this.TreeInfo.EndPosition : token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (2)
72var start = this.Token.SpanStart - other.Token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (3)
211if (token1.Span.End > token2.SpanStart) 390Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 415Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (4)
28var line = _text.Lines.GetLineFromPosition(token.SpanStart); 30return line.GetColumnFromLineOffset(token.SpanStart - line.Start, tabSize); 38return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 47return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (1)
43var text = _trivia.ToFullString()[..(token.SpanStart - _trivia.FullSpan.Start)];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
305return TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End); 363if (headerFacts.IsOnIfStatementHeader(root, operation.BaseToken.SpanStart, out var conditionStatement) 364|| headerFacts.IsOnWhileStatementHeader(root, operation.BaseToken.SpanStart, out conditionStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (1)
43=> CreateSuppressOperation(startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End), option);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
219return this.Token2.SpanStart; 488if (ContainsOnlyWhitespace(firstToken.FullSpan.Start, firstToken.SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
131if (token.SpanStart >= LineToBeIndented.Start) 210=> GetIndentationOfPosition(token.SpanStart, addedSpaces);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (2)
169position <= token.SpanStart && 170text.AreOnSameLine(position, token.SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
221var orderedTokens = tokens.Distinct().OrderBy(t => t.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (10)
64if (currentOne.Item1.SpanStart <= previousOne.Item2.Span.End) 97if (textSpan.Start < startToken.SpanStart) 124Contract.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart); 143return root.FullSpan.End == startToken.SpanStart || startToken.FullSpan.End > endToken.FullSpan.Start; 151var startPosition = token.SpanStart; 158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 275return nextToken.SpanStart; 292return nextToken.SpanStart; 365var startPosition = startToken.SpanStart;
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (1)
102var containingType = semanticModel.GetEnclosingNamedType(identifierToken.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
79ancestor.SpanStart < token.SpanStart)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (3)
207ContainingType = semanticModel.GetEnclosingNamedType(IdentifierToken.SpanStart, cancellationToken); 263ContainingType = semanticModel.GetEnclosingNamedType(IdentifierToken.SpanStart, cancellationToken); 308ContainingMethod = FindContainingMethodSymbol(IdentifierToken.SpanStart, semanticModel, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
51return TextSpan.FromBounds(start.SpanStart, end.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (5)
32var tokenLine = document.Text.Lines.GetLineFromPosition(token.SpanStart); 33if (tokenLine.Start != token.SpanStart) 37if (firstNonWhitespacePos.Value == token.SpanStart) 40return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart)); 56var newTokenLine = newDocument.Text.Lines.GetLineFromPosition(newRoot.GetAnnotatedTokens(annotation).Single().SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
172var affectedSpan = TextSpan.FromBounds(previousToken.SpanStart, FirstStatementAffectedInInnermostBlock.Span.End);
Microsoft.CodeAnalysis.CSharp (14)
Binder\Binder.cs (1)
273return AreNullableAnnotationsEnabled(token.SyntaxTree, token.SpanStart);
Compilation\CSharpSemanticModel.cs (4)
438if (position == 0 && position != token.SpanStart) 1282if (position < token.SpanStart) // NB: Span, not FullSpan 1293return Math.Max(token.SpanStart, fullStart); 1321int betterPosition = firstToken.SpanStart;
Compilation\SyntaxTreeSemanticModel.cs (2)
155if (position == 0 && position != token.SpanStart) 1872var position = originalSymbol.IdentifierToken.SpanStart;
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
62var snapshot = GetSnapshotForPosition(symbol.IdentifierToken.SpanStart);
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (2)
60startPos = startOpt.First().SpanStart; 151int start = firstToken?.SpanStart ?? declarationSyntax.SpanStart;
Symbols\LexicalSortKey.cs (1)
91: this(token.SyntaxTree, token.SpanStart, compilation)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1318if (referencedPosition != referencedToken.SpanStart)
Syntax\LookupPosition.cs (2)
82return position >= firstIncluded.SpanStart && IsBeforeToken(position, firstExcluded); 95return firstExcluded.Kind() == SyntaxKind.None || position < firstExcluded.SpanStart;
Microsoft.CodeAnalysis.CSharp.CodeStyle (29)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
112var firstBraceLine = lines.GetLineFromPosition(firstBrace.SpanStart).LineNumber; 113var secondBraceLine = lines.GetLineFromPosition(secondBrace.SpanStart).LineNumber;
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (2)
74var colonLine = sourceText.Lines.GetLineFromPosition(colonToken.SpanStart); 75var thisBaseLine = sourceText.Lines.GetLineFromPosition(thisOrBaseKeyword.SpanStart);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (2)
32CastExpressionSyntax cast => TextSpan.FromBounds(cast.OpenParenToken.SpanStart, cast.CloseParenToken.Span.End), 33BinaryExpressionSyntax binary => TextSpan.FromBounds(binary.OperatorToken.SpanStart, node.Span.End),
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
47var fadeSpan = TextSpan.FromBounds(defaultExpression.OpenParenToken.SpanStart, defaultExpression.CloseParenToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (3)
133var offset = token.SpanStart; 225i += ConvertTextAtIndexToRune(tokenSourceText, i, result, token.SpanStart); 257var offset = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
72if (conditionalDirectives.First().SpanStart <= block.OpenBraceToken.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (3)
168var tokenLine = text.Lines.IndexOf(token.SpanStart); 169var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart); 239var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
66if (position <= declaration.OpenBraceToken.SpanStart) 76return position <= declaration.CloseBraceToken.SpanStart; 95(targetToken.IsKind(SyntaxKind.DotDotToken) && position == targetToken.SpanStart + 1) || 354for (int i = token.SpanStart, n = token.Span.End; i < n; i++) 427return token.SpanStart < position && token.Span.End > position;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (2)
103return TextSpan.FromBounds(_node.FullSpan.Start, pair.Item2.SpanStart); 111return TextSpan.FromBounds(pair.Item1.Span.End, pair.Item2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
120TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, nextToken.SpanStart) : TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, lastTokenOfLabel.FullSpan.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
335var textSpan = TextSpan.FromBounds(startToken.Span.End, endToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
188var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (4)
67_root, [TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)], _options.FormattingOptions, smartTokenformattingRules, cancellationToken); 103adjustedEndPosition = token.SpanStart; 108var adjustedStartPosition = previousToken.SpanStart; 115adjustedStartPosition = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1002=> TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (30)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (5)
94var openBraceLine = document.Text.Lines.GetLineFromPosition(namespaceDeclaration.OpenBraceToken.SpanStart).LineNumber; 95var closeBraceLine = document.Text.Lines.GetLineFromPosition(namespaceDeclaration.CloseBraceToken.SpanStart).LineNumber; 116var semicolonLine = text.Lines.GetLineFromPosition(fileScopedNamespace.SemicolonToken.SpanStart).LineNumber; 202var openBraceLine = text.Lines.GetLineFromPosition(blockScopedNamespace.OpenBraceToken.SpanStart).LineNumber; 203var closeBraceLine = text.Lines.GetLineFromPosition(blockScopedNamespace.CloseBraceToken.SpanStart).LineNumber;
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
81var start = token.SpanStart;
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
83var start = token.SpanStart;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
638preferredIndentation, firstTokenOnLineIndentationString, token.SpanStart)); 716=> GetIndentationStringForPosition(token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
441return leftToken.SpanStart < usingDirective.Alias.EqualsToken.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
1289position = token.SpanStart; 2011var position = targetToken.SpanStart; 2860if (syntaxTree.IsLocalVariableDeclarationContext(token.SpanStart, syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken), cancellationToken)) 2886semanticModel, token.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (2)
29var end = GetEndToken(destination).SpanStart; 48end = GetEndToken(destination).SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
81token.SpanStart != firstNonWhitespacePosition)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (10)
94var startLine = sourceText.Lines.GetLineFromPosition(token.SpanStart); 233return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(embeddedStatementOwner.GetFirstToken(includeZeroWidth: true).SpanStart)); 275return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.GetFirstToken(includeZeroWidth: true).SpanStart), indenter.Options.FormattingOptions.IndentationSize); 289return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.GetFirstToken(includeZeroWidth: true).SpanStart)); 297return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(token.SpanStart)); 353return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(firstToken.SpanStart)); 385var firstTokenLine = sourceText.Lines.GetLineFromPosition(firstToken.SpanStart); 388var givenTokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart); 414if (firstToken.SpanStart <= clause.SpanStart) 472var givenTokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
430return InferTypes(previousToken.SpanStart); 830return InferTypes(previousToken.Value.SpanStart);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (7)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
129return CommonFormattingHelpers.GetFormattingSpan(root, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End));
EventHookup\EventHookupSessionManager_EventHookupSession.cs (2)
209var reservedNames = semanticModel.LookupSymbols(plusEqualsToken.SpanStart).Select(m => m.Name); 253plusEqualsToken.SpanStart) as BaseTypeDeclarationSyntax;
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (1)
55if (startToken != endToken && startToken.Span.End > endToken.SpanStart)
StringCopyPaste\StringInfo.cs (2)
220endDelimiterSpan: TextSpan.FromBounds(interpolatedString.StringEndToken.SpanStart, interpolatedString.Span.End), 221endDelimiterSpanWithoutSuffix: TextSpan.FromBounds(interpolatedString.StringEndToken.SpanStart, endBeforeU8Suffix),
TextStructureNavigation\CSharpTextStructureNavigatorProvider.cs (1)
44if (token.SpanStart == position)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3424if (position == endToken.SpanStart && !endToken.GetPreviousToken().IsKind(SyntaxKind.None))
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (64)
Semantics\PrimaryConstructorTests.cs (33)
2165Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer, out _)); 2167symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2170symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 2184Assert.True(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out speculativeModel)); 2195Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null, out _)); 2196Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _)); 2210symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2213symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 2216Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2217Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart, 2241Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _)); 2243symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 2246symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2249symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 2252Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2317Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer, out _)); 2319symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2322symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 2332Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _)); 2334Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null, out _)); 2335Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _)); 2349symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2352symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 2355Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2356Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart, 2380Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _)); 2382symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 2385symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2388symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 2391Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2481Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); 2487Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); 6863Assert.DoesNotContain("System.Int32 y", model.LookupSymbols(attrApplication.ArgumentList!.OpenParenToken.SpanStart + 1).Select(s => s.ToTestDisplayString()));
Semantics\RecordTests.cs (31)
22322Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer, out _)); 22324symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22327symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 22341Assert.True(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out speculativeModel!)); 22352Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null!, out _)); 22353Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _)); 22367symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22370symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 22373Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22374Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart, 22398Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _)); 22400symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 22403symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22406symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 22409Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22474Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer, out _)); 22476symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22479symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 22489Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _)); 22491Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (PrimaryConstructorBaseTypeSyntax)null!, out _)); 22492Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, baseWithargs, out _)); 22506symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22509symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 22512Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22513Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(tree.GetRoot().DescendantNodes().OfType<ConstructorInitializerSyntax>().Single().ArgumentList.OpenParenToken.SpanStart, 22537Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer, out _)); 22539symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer); 22542symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22545symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer); 22548Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 30445Assert.DoesNotContain("System.Int32 y", model.LookupSymbols(attrApplication.ArgumentList!.OpenParenToken.SpanStart + 1).Select(s => s.ToTestDisplayString()));
Microsoft.CodeAnalysis.CSharp.Features (132)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
268var newClosingPoint = newRoot.GetAnnotatedTokens(s_closingBraceFormatAnnotation).Single().SpanStart + 1;
BraceCompletion\InterpolationBraceCompletionService.cs (1)
39=> IsValidOpeningBraceToken(token) && token.SpanStart == position;
BraceCompletion\ParenthesisBraceCompletionService.cs (1)
34|| token.SpanStart != position
BraceCompletion\StringLiteralBraceCompletionService.cs (2)
80var isStartOfString = token.SpanStart == position; 85var isStartOfVerbatimString = token.SpanStart + 1 == position && token.IsVerbatimStringLiteral();
BraceMatching\CSharpDirectiveTriviaBraceMatcher.cs (1)
36=> TextSpan.FromBounds(directive.HashToken.SpanStart, directive.DirectiveNameToken.Span.End);
BraceMatching\StringLiteralBraceMatcher.cs (2)
65new TextSpan(token.SpanStart, 2), 71new TextSpan(token.SpanStart, 1),
ChangeSignature\CSharpChangeSignatureService.cs (1)
220var start = lastAttributes?.GetLastToken().GetNextToken().SpanStart ??
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
248if (firstSemanticToken.IsKind(SyntaxKind.None) || firstSemanticToken.SpanStart > nullableDirective.Span.End)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
170contextPosition: token.SpanStart, 193contextPosition: token.SpanStart,
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
46AnonymousMethodExpressionSyntax anonymous => anonymous.DelegateKeyword.SpanStart,
Completion\CompletionProviders\CompletionUtilities.cs (1)
40if (token.Kind() == SyntaxKind.DotDotToken && token.SpanStart == characterPosition)
Completion\CompletionProviders\CrefCompletionProvider.cs (4)
171return semanticModel.LookupNamespacesAndTypes(token.SpanStart); 183result.AddRange(semanticModel.LookupSymbols(token.SpanStart)); 219result.AddRange(semanticModel.LookupSymbols(token.SpanStart, container)); 296builder.Append(symbol.ToMinimalDisplayString(semanticModel, token.SpanStart, unqualifiedCrefFormat));
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
291var containingType = semanticModel.GetEnclosingNamedType(token.SpanStart, cancellationToken);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (2)
195? questionToken.Value.SpanStart 196: dotToken.SpanStart;
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (3)
107builder.Add(new TextChange(new TextSpan(dotToken.SpanStart, 1), ")")); 112builder.Add(new TextChange(new TextSpan(questionToken.Value.SpanStart, 0), ")")); 114builder.Add(new TextChange(new TextSpan(dotToken.SpanStart, 1), ""));
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (1)
143var replacement = item.DisplayText + text.ToString(TextSpan.FromBounds(expressionStart, dotLikeToken.SpanStart));
Completion\CompletionProviders\OverrideCompletionProvider.cs (3)
90if (token.SpanStart < parentMember.SpanStart) 94if (IsOnStartLine(token.SpanStart, text, startLine)) 112if (!IsOnStartLine(token.SpanStart, text, startLine))
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
137&& text.Lines.IndexOf(syntaxToken.SpanStart) == text.Lines.IndexOf(touchingToken.SpanStart);
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
68.Any(t => token.SpanStart > t.OpenBraceToken.Span.End &&
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (3)
193var tokenLine = document.Text.Lines.GetLineFromPosition(token.SpanStart); 194if (token.SpanStart == tokenLine.Start) 471=> GetIndentationStringForPosition(text, options, token.SpanStart);
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (2)
153var tokenLine = parsedDocument.Text.Lines.GetLineFromPosition(token.SpanStart); 154if (token.SpanStart == tokenLine.Start)
Debugging\CSharpProximityExpressionsService.cs (1)
64var info = semanticModel.GetSpeculativeSymbolInfo(token.SpanStart, expression, SpeculativeBindingOption.BindAsExpression);
EditAndContinue\BreakpointSpans.cs (11)
110=> TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End); 119=> TextSpan.FromBounds(token.SpanStart, token.Span.End); 128startPos = startOpt.First().SpanStart; 193if (position > LastNotMissing(typeDeclaration.SemicolonToken, typeDeclaration.OpenBraceToken).SpanStart) 202if (baseInitializer != null && position > typeDeclaration.BaseList!.ColonToken.SpanStart) 208if (position >= typeDeclaration.Identifier.SpanStart && node is RecordDeclarationSyntax recordDeclaration) 240if (position <= separator.SpanStart) 486return TextSpan.FromBounds(typeDeclaration.Identifier.SpanStart, typeDeclaration.ParameterList.Span.End); 668if (position < forEachStatement.OpenParenToken.Span.End || position > forEachStatement.CloseParenToken.SpanStart) 808if (semicolonOpt != default && position > semicolonOpt.SpanStart) 905if (position > list.GetSeparator(i).SpanStart)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (19)
253Debug.Assert(position == ((DoStatementSyntax)node).WhileKeyword.SpanStart); 287if (position == switchExpression.SwitchKeyword.SpanStart) 342=> position < node.OpenParenToken.SpanStart ? ForEachPart.ForEach : 343position < node.InKeyword.SpanStart ? ForEachPart.VariableDeclaration : 371SwitchExpressionPart.SwitchBody => TextSpan.FromBounds(node.SwitchKeyword.SpanStart, node.CloseBraceToken.Span.End), 601=> BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent!, token.SpanStart, minLength: token.Span.Length, out span); 632return BreakpointSpans.TryGetClosestBreakpointSpan(node, doStatement.WhileKeyword.SpanStart, minLength, out span); 1644return TextSpan.FromBounds(ns.NamespaceKeyword.SpanStart, ns.Name.Span.End); 1727return TextSpan.FromBounds(constraint.WhereKeyword.SpanStart, constraint.Constraints.Last().Span.End); 1768return TextSpan.FromBounds(usingStatement.UsingKeyword.SpanStart, usingStatement.CloseParenToken.Span.End); 1772return TextSpan.FromBounds(fixedStatement.FixedKeyword.SpanStart, fixedStatement.CloseParenToken.Span.End); 1776return TextSpan.FromBounds(lockStatement.LockKeyword.SpanStart, lockStatement.CloseParenToken.Span.End); 1799return TextSpan.FromBounds(ifStatement.IfKeyword.SpanStart, ifStatement.CloseParenToken.Span.End); 1806return TextSpan.FromBounds(switchStatement.SwitchKeyword.SpanStart, 1814return TextSpan.FromBounds(whileStatement.WhileKeyword.SpanStart, whileStatement.CloseParenToken.Span.End); 1821return TextSpan.FromBounds(forStatement.ForKeyword.SpanStart, forStatement.CloseParenToken.Span.End); 1827(commonForEachStatement.AwaitKeyword.Span.Length > 0) ? commonForEachStatement.AwaitKeyword.SpanStart : commonForEachStatement.ForEachKeyword.SpanStart, 1940=> TextSpan.FromBounds((modifiers.Count != 0) ? modifiers.First().SpanStart : start.SpanStart, end.Span.End);
ExtractMethod\CSharpMethodExtractor.cs (1)
200invocationNameToken = newRoot.FindToken(invocationNameToken.Value.SpanStart);
ExtractMethod\CSharpSelectionResult.cs (2)
96return firstToken.SpanStart <= current.GetFirstToken().SpanStart &&
ExtractMethod\CSharpSelectionValidator.cs (1)
319var blockSpan = TextSpan.FromBounds(block.OpenBraceToken.Span.End, block.CloseBraceToken.SpanStart);
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (1)
56elseKeyword.SpanStart,
Highlighting\KeywordHighlighters\RegionHighlighter.cs (1)
38directive.HashToken.SpanStart,
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
74var start = gotoStatement.GotoKeyword.SpanStart;
Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs (1)
55statement.YieldKeyword.SpanStart,
InlineHints\CSharpInlineTypeHintsService.cs (3)
60: new(type, new TextSpan(variableDesignation.Identifier.SpanStart, 0), textChange: null, trailingSpace: true); 76var span = new TextSpan(parameterNode.Identifier.SpanStart, 0); 108var span = new TextSpan(collectionExpression.OpenBracketToken.SpanStart, 0);
MoveToNamespace\CSharpMoveToNamespaceService.cs (2)
31var namespaceDeclarationStart = baseNamespace.NamespaceKeyword.SpanStart; 34NamespaceDeclarationSyntax namespaceDeclaration => namespaceDeclaration.OpenBraceToken.SpanStart,
Rename\CSharpRenameIssuesService.cs (1)
41triggerToken.SpanStart,
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
70expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (2)
65expression.ArgumentList.Span.Contains(token.SpanStart) && 139var position = openToken.SpanStart;
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (4)
232var position = openToken.SpanStart; 295return expression.ArgumentList.Span.Contains(token.SpanStart) && 329return node.RankSpecifiers.Span.Contains(token.SpanStart) && 380return expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProvider.cs (1)
34return TextSpan.FromBounds(genericIdentifier.SpanStart, nextToken.SpanStart);
SignatureHelp\GenericNameSignatureHelpProvider.cs (4)
73node.TypeArgumentList.Span.Contains(token.SpanStart) && 124.Sort(semanticModel, genericIdentifier.SpanStart); 154var offset = genericIdentifier.SpanStart - genericName.SpanStart; 175var position = lessThanToken.SpanStart;
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (2)
54=> expression.Span.Contains(token.SpanStart) && token != expression.CloseBraceToken; 74ConvertMethodGroupMethod(document, s, initializerExpression.OpenBraceToken.SpanStart, semanticModel)).ToList(),
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
61return expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (1)
58expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (2)
62expression.ArgumentList.Span.Contains(token.SpanStart) && 127var position = openToken.SpanStart;
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (3)
143position = targetExpression.GetFirstToken().SpanStart; 215tupleExpression.Arguments.FullSpan.Contains(token.SpanStart) && 232expr.FullSpan.Contains(token.SpanStart) &&
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
86new SnippetPlaceholder(identifier.ValueText, identifier.SpanStart),
Snippets\AbstractCSharpForLoopSnippetProvider.cs (1)
98placeholderBuilder.Add(declaratorIdentifier.ValueText, declaratorIdentifier.SpanStart);
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
101var indentationString = CSharpSnippetHelpers.GetBlockLikeIndentationString(document, typeDeclaration.OpenBraceToken.SpanStart, syntaxFormattingOptions, cancellationToken);
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
115arrayBuilder.Add(new SnippetPlaceholder(node.Identifier.ToString(), node.Identifier.SpanStart));
Snippets\CSharpIntMainSnippetProvider.cs (1)
58var indentationString = CSharpSnippetHelpers.GetBlockLikeIndentationString(document, body.OpenBraceToken.SpanStart, syntaxFormattingOptions, cancellationToken);
SplitStringLiteral\SimpleStringSplitter.cs (1)
41var prefix = Document.Text.GetSubText(TextSpan.FromBounds(_token.SpanStart, CursorPosition)).ToString();
SplitStringLiteral\StringSplitter.cs (1)
74position == token.SpanStart;
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
112var firstBraceLine = lines.GetLineFromPosition(firstBrace.SpanStart).LineNumber; 113var secondBraceLine = lines.GetLineFromPosition(secondBrace.SpanStart).LineNumber;
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (2)
74var colonLine = sourceText.Lines.GetLineFromPosition(colonToken.SpanStart); 75var thisBaseLine = sourceText.Lines.GetLineFromPosition(thisOrBaseKeyword.SpanStart);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (2)
32CastExpressionSyntax cast => TextSpan.FromBounds(cast.OpenParenToken.SpanStart, cast.CloseParenToken.Span.End), 33BinaryExpressionSyntax binary => TextSpan.FromBounds(binary.OperatorToken.SpanStart, node.Span.End),
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
47var fadeSpan = TextSpan.FromBounds(defaultExpression.OpenParenToken.SpanStart, defaultExpression.CloseParenToken.Span.End);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (5)
94var openBraceLine = document.Text.Lines.GetLineFromPosition(namespaceDeclaration.OpenBraceToken.SpanStart).LineNumber; 95var closeBraceLine = document.Text.Lines.GetLineFromPosition(namespaceDeclaration.CloseBraceToken.SpanStart).LineNumber; 116var semicolonLine = text.Lines.GetLineFromPosition(fileScopedNamespace.SemicolonToken.SpanStart).LineNumber; 202var openBraceLine = text.Lines.GetLineFromPosition(blockScopedNamespace.OpenBraceToken.SpanStart).LineNumber; 203var closeBraceLine = text.Lines.GetLineFromPosition(blockScopedNamespace.CloseBraceToken.SpanStart).LineNumber;
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
81var start = token.SpanStart;
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
83var start = token.SpanStart;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
638preferredIndentation, firstTokenOnLineIndentationString, token.SpanStart)); 716=> GetIndentationStringForPosition(token.SpanStart);
src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (1)
481return (node is SwitchExpressionSyntax switchExpression) ? switchExpression.SwitchKeyword.SpanStart : node.SpanStart;
Structure\CSharpStructureHelpers.cs (2)
246var startPosition = firstComment.HasValue ? firstComment.Value.FullSpan.Start : startToken.SpanStart; 247var endPosition = endToken.SpanStart;
Structure\Providers\ArgumentListStructureProvider.cs (2)
37var start = text.Lines.GetLinePosition(openToken.SpanStart).Line; 38var end = text.Lines.GetLinePosition(closeToken.SpanStart).Line;
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
91var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (1)
69var headerSpan = TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\LocalFunctionTests.cs (1)
8782Assert.False(model.LookupSymbols(nameofExpression.ArgumentList.CloseParenToken.SpanStart).ToTestDisplayStrings().Contains("parameter"));
Semantics\NullableReferenceTypesTests.cs (2)
113806model.GetSpeculativeTypeInfo(decl.Identifier.SpanStart, type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type.ToTestDisplayString(includeNonNullable: true)); 114030Assert.True(model.TryGetSpeculativeSemanticModel(decl.Identifier.SpanStart, type, out model, SpeculativeBindingOption.BindAsTypeOrNamespace));
Semantics\QueryTests.cs (1)
2300var info = semanticModel.GetSpeculativeTypeInfo(selectExpression.SpanStart, SyntaxFactory.ParseExpression("x"), SpeculativeBindingOption.BindAsExpression);
Semantics\RecordStructTests.cs (2)
10779Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _)); 10785Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutargs.ArgumentList.OpenParenToken.SpanStart, speculativeBase, out _));
Semantics\TargetTypedDefaultTests.cs (2)
2485var typeInfo = model.GetSpeculativeTypeInfo(digit.SpanStart, expressionSyntax, SpeculativeBindingOption.BindAsExpression); 2487var symbol = model.GetSpeculativeSymbolInfo(digit.SpanStart, expressionSyntax, SpeculativeBindingOption.BindAsExpression);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (11)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (6)
1558var constraintStart = constraintSyntax.WhereKeyword.SpanStart; 1714var namespaceStart = namespaceDecl.OpenBraceToken.SpanStart; 1715int typeDeclStart = typeDecl.OpenBraceToken.SpanStart; 1816var methodStart = methodDecl.Body.OpenBraceToken.SpanStart; 1872var methodStart = methodDecl.Body.OpenBraceToken.SpanStart; 2009var methodStart = methodDecl.Body.OpenBraceToken.SpanStart;
SymbolDisplay\SymbolDisplayTests.cs (2)
6754queryExpression.FromClause.Identifier.SpanStart, 8100symbol.ToMinimalDisplayParts(model, continuation.Identifier.SpanStart),
Symbols\Source\NullablePublicAPITests.cs (3)
3701Assert.True(model.TryGetSpeculativeSemanticModel(localFunctionBody.Body!.OpenBraceToken.SpanStart + 1, @return, out var specModel)); 3736Assert.True(model.TryGetSpeculativeSemanticModel(localFunctionBody.Block!.OpenBraceToken.SpanStart + 1, @return, out var specModel)); 4909.SpanStart;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\LambdaUtilitiesTests.cs (1)
59Assert.Equal("C", model.GetEnclosingSymbol(methodDef.ParameterList.CloseParenToken.SpanStart).ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Workspaces (56)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
324originalSemanticModel, namespaceId.Value, semanticModel.LookupNamespacesAndTypes(token.SpanStart).OfType<IAliasSymbol>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (3)
133var offset = token.SpanStart; 225i += ConvertTextAtIndexToRune(tokenSourceText, i, result, token.SpanStart); 257var offset = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
72if (conditionalDirectives.First().SpanStart <= block.OpenBraceToken.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (3)
168var tokenLine = text.Lines.IndexOf(token.SpanStart); 169var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart); 239var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (5)
66if (position <= declaration.OpenBraceToken.SpanStart) 76return position <= declaration.CloseBraceToken.SpanStart; 95(targetToken.IsKind(SyntaxKind.DotDotToken) && position == targetToken.SpanStart + 1) || 354for (int i = token.SpanStart, n = token.Span.End; i < n; i++) 427return token.SpanStart < position && token.Span.End > position;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (2)
103return TextSpan.FromBounds(_node.FullSpan.Start, pair.Item2.SpanStart); 111return TextSpan.FromBounds(pair.Item1.Span.End, pair.Item2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
120TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, nextToken.SpanStart) : TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, lastTokenOfLabel.FullSpan.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
335var textSpan = TextSpan.FromBounds(startToken.Span.End, endToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
188var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (4)
67_root, [TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)], _options.FormattingOptions, smartTokenformattingRules, cancellationToken); 103adjustedEndPosition = token.SpanStart; 108var adjustedStartPosition = previousToken.SpanStart; 115adjustedStartPosition = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1002=> TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (4)
354var positionBeforeRecordKeyword = previousToken.SpanStart; 441return leftToken.SpanStart < usingDirective.Alias.EqualsToken.SpanStart; 462return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken); 469return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (14)
1289position = token.SpanStart; 1845var tokenOnLeftOfStart = syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken); 1847syntaxTree.IsValidContextForFromClause(token.SpanStart, tokenOnLeftOfStart, cancellationToken)) 1854syntaxTree.IsValidContextForJoinClause(token.SpanStart, tokenOnLeftOfStart)) 1933var start = token.SpanStart; 1936IsNonConstantExpressionContext(syntaxTree, token.SpanStart, tokenOnLeftOfStart, cancellationToken) || 1937syntaxTree.IsStatementContext(token.SpanStart, tokenOnLeftOfStart, cancellationToken) || 1938syntaxTree.IsGlobalStatementContext(token.SpanStart, cancellationToken); 2011var position = targetToken.SpanStart; 2035syntaxTree.IsExpressionContext(token.SpanStart, syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken), false, cancellationToken)) 2860if (syntaxTree.IsLocalVariableDeclarationContext(token.SpanStart, syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken), cancellationToken)) 2886semanticModel, token.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (2)
29var end = GetEndToken(destination).SpanStart; 48end = GetEndToken(destination).SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
81token.SpanStart != firstNonWhitespacePosition)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (10)
94var startLine = sourceText.Lines.GetLineFromPosition(token.SpanStart); 233return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(embeddedStatementOwner.GetFirstToken(includeZeroWidth: true).SpanStart)); 275return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.GetFirstToken(includeZeroWidth: true).SpanStart), indenter.Options.FormattingOptions.IndentationSize); 289return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.GetFirstToken(includeZeroWidth: true).SpanStart)); 297return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(token.SpanStart)); 353return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(firstToken.SpanStart)); 385var firstTokenLine = sourceText.Lines.GetLineFromPosition(firstToken.SpanStart); 388var givenTokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart); 414if (firstToken.SpanStart <= clause.SpanStart) 472var givenTokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
430return InferTypes(previousToken.SpanStart); 830return InferTypes(previousToken.Value.SpanStart);
Microsoft.CodeAnalysis.Features (33)
BraceCompletion\AbstractBraceCompletionService.cs (1)
114=> token.SpanStart == position && IsValidOpeningBraceToken(token) && !ParentIsSkippedTokensTriviaOrNull(this.SyntaxFacts, token);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
109var indexOfLine = lines.IndexOf(containingStatement.GetFirstToken().SpanStart); 124indexOfLine = lines.IndexOf(containingStatement.GetLastToken().SpanStart);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
268suppressionTargetInfo.StartToken = root.FindToken(startToken.SpanStart); 269suppressionTargetInfo.EndToken = root.FindToken(endToken.SpanStart);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (4)
73var position = startToken.SpanStart; 94var containingType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(startToken.SpanStart, CancellationToken); 137if (token.SpanStart > position) 143if (IsOnStartLine(token.GetNextToken().SpanStart))
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
95position = targetToken.GetNextToken(includeZeroWidth: true).SpanStart;
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (2)
50quotedPathStart: stringLiteral.SpanStart, 55quotedPathStart: stringLiteral.SpanStart,
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (3)
86if (position != token.SpanStart) 212var startPosition = member.GetFirstToken().SpanStart; 336var startPosition = token.SpanStart;
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (1)
117tokens[TriviaLocation.AfterBeginningOfSpan].Span.End <= tokens[TriviaLocation.BeforeEndOfSpan].SpanStart);
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
115sourceText.Lines.GetLineFromPosition(declarationToken.SpanStart).LineNumber));
QuickInfo\CommonSemanticQuickInfoProvider.cs (2)
147var linkedToken = root.FindToken(token.SpanStart); 195var enclosingType = semanticModel.GetEnclosingNamedType(token.SpanStart, cancellationToken);
Rename\SymbolicRenameInfo.cs (2)
162var symbol = await RenameUtilities.TryGetRenamableSymbolAsync(document, triggerToken.SpanStart, cancellationToken: cancellationToken).ConfigureAwait(false); 175semanticModel, triggerToken.SpanStart, document.Project.Solution.Services, cancellationToken: cancellationToken).ConfigureAwait(false);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
116var foundSymbol = semanticModel.GetSpeculativeSymbolInfo(token.SpanStart, parsed, SpeculativeBindingOption.BindAsExpression).GetAnySymbol();
SignatureHelp\CommonSignatureHelpUtilities.cs (3)
60if (!closeToken.IsMissing && position > closeToken.SpanStart) 89return TextSpan.FromBounds(start, closeToken.SpanStart); 100return TextSpan.FromBounds(start, nextToken.SpanStart);
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (1)
39return [new SnippetPlaceholder(identifier.ValueText, identifier.SpanStart)];
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
131document, nameToken.SpanStart, options, passThroughOptions, cancellationToken: cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (1)
102var containingType = semanticModel.GetEnclosingNamedType(identifierToken.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
79ancestor.SpanStart < token.SpanStart)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (3)
207ContainingType = semanticModel.GetEnclosingNamedType(IdentifierToken.SpanStart, cancellationToken); 263ContainingType = semanticModel.GetEnclosingNamedType(IdentifierToken.SpanStart, cancellationToken); 308ContainingMethod = FindContainingMethodSymbol(IdentifierToken.SpanStart, semanticModel, cancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\ControlFlowGraphVerifier.cs (2)
698aggregate.AggregateKeyword.SpanStart < candidate.Syntax.SpanStart && 699aggregate.IntoKeyword.SpanStart > candidate.Syntax.SpanStart &&
Microsoft.CodeAnalysis.VisualBasic (12)
Binding\Binder_Utils.vb (2)
70Dim startLoc As Integer = Math.Min(badKeyword.SpanStart, friendToken.SpanStart)
Binding\MemberSemanticModel.vb (1)
1641If operatorKeyWord.SpanStart <= position AndAlso SyntaxFacts.InSpanOrEffectiveTrailingOfNode(operatorSyntax, position) Then
Compilation\SemanticModel.vb (2)
634If (position < token.SpanStart) Then 642If token.SpanStart < fullStart Then
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.vb (1)
105Dim statementSpanWithoutAttributes = TextSpan.FromBounds(firstModifierOrKeyword.SpanStart, methodStatement.Span.End)
Symbols\LexicalSortKey.vb (1)
148Me.New(DirectCast(token.SyntaxTree, VisualBasicSyntaxTree), token.SpanStart, compilation)
Symbols\Source\SourceMethodSymbol.vb (2)
178Dim startLoc As Integer = Math.Min(token.SpanStart, nextToken.SpanStart)
Syntax\SyntaxFacts.vb (3)
292afterBegin = position >= beginTerminator.SpanStart 312beforeEnd = position < followingToken.SpanStart 1116If p.GetLocation.SourceSpan.Start < token.SpanStart Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (2)
203Dim tokenLine = text.Lines.IndexOf(token.SpanStart) 204Dim previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Indentation\VisualBasicSmartTokenFormatter.vb (1)
40Dim spans = SpecializedCollections.SingletonEnumerable(TextSpan.FromBounds(previousToken.SpanStart, token.Span.End))
src\Workspaces\VisualBasic\Portable\Formatting\Rules\BaseFormattingRule.vb (1)
68Return TextSpan.FromBounds(spanStart, nextToken.SpanStart)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (1)
79AddIndentBlockOperation(operations, baseToken, startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (4)
249Return indenter.GetIndentationOfLine(indenter.LineToBeIndented.Text.Lines.GetLineFromPosition(token.SpanStart)) 267Dim currentTokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart) 289If IsCommaInParameters(token) AndAlso (token.Span.End <= position AndAlso position <= token.GetNextToken().SpanStart) Then 290Return GetIndentationOfCurrentPosition(indenter, token, token.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.vb (1)
59If token.Kind = SyntaxKind.None OrElse token.SpanStart <> firstNonWhitespacePosition Then
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (10)
EndConstructGeneration\EndConstructCommandHandler.vb (1)
180Return TextSpan.FromBounds(If(previousToken.Kind <> SyntaxKind.None, previousToken, firstToken).SpanStart,
EndConstructGeneration\VisualBasicEndConstructGenerationService.vb (2)
236Dim lineOfLastToken = subjectBuffer.CurrentSnapshot.GetLineNumberFromPosition(state.TokenToLeft.SpanStart) 273Dim span = TextSpan.FromBounds(asSingleLine.IfKeyword.SpanStart, asSingleLine.ThenKeyword.Span.End)
LineCommit\CommitFormatter.vb (1)
253Return operations.Where(Function(o) o.TextSpan.Contains(token.SpanStart)).Count()
LineCommit\ContainingStatementInfo.vb (2)
101If pointLineNumber <> snapshot.GetLineNumberFromPosition(token.SpanStart) Then 136If triviaStatement Is Nothing OrElse snapshot.GetLineNumberFromPosition(trivia.Token.SpanStart) <> pointLineNumber Then
TextStructureNavigation\VisualBasicTextStructureNavigatorProvider.vb (1)
44If position = token.SpanStart Then
Utilities\NavigationPointHelpers.vb (3)
36Return eventBlock.EventStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 44Return methodBlock.BlockStatement.Modifiers.First().SpanStart 46Return methodBlock.BlockStatement.DeclarationKeyword.SpanStart
Microsoft.CodeAnalysis.VisualBasic.Features (69)
BraceCompletion\BracketBraceCompletionService.vb (2)
42If position = token.SpanStart AndAlso 48If position < token.SpanStart Then
BraceCompletion\ParenthesisBraceCompletionService.vb (1)
38position <> token.SpanStart Then
BraceMatching\InterpolatedStringBraceMatcher.vb (1)
38New TextSpan(interpolatedString.DollarSignDoubleQuoteToken.SpanStart, 2),
BraceMatching\StringLiteralBraceMatcher.vb (2)
28If position = token.SpanStart OrElse position = token.Span.End - 1 Then 31New TextSpan(token.SpanStart, 1),
BraceMatching\VisualBasicDirectiveTriviaBraceMatcher.vb (1)
42Return TextSpan.FromBounds(directive.HashToken.SpanStart, keywordToken.Span.End)
ChangeSignature\ChangeSignatureFormattingRule.vb (2)
30New TextSpan(firstToken.SpanStart, lastToken.Span.End - firstToken.SpanStart),
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
113If tokenAfterContinueToken.IsSkipped() AndAlso text.Lines.IndexOf(tokenAfterContinueToken.SpanStart) = text.Lines.IndexOf(continueStatement.SpanStart) Then 145If tokenAfterExitToken.IsSkipped() AndAlso text.Lines.IndexOf(tokenAfterExitToken.SpanStart) = text.Lines.IndexOf(exitStatement.SpanStart) Then
Completion\CompletionProviders\AwaitCompletionProvider.vb (1)
40Return DirectCast(declaration, LambdaExpressionSyntax).SubOrFunctionHeader.SubOrFunctionKeyword.SpanStart
Completion\CompletionProviders\CrefCompletionProvider.vb (3)
166Return semanticModel.LookupSymbols(token.SpanStart) 168Return semanticModel.LookupNamespacesAndTypes(token.SpanStart) 182For Each symbol In semanticModel.LookupSymbols(token.SpanStart, container)
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (1)
135result = context.SemanticModel.LookupSymbols(token.SpanStart, type).
Completion\CompletionProviders\OverrideCompletionProvider.vb (2)
86Do While IsOnStartLine(token.SpanStart, text, startLine) 135If previousToken.Kind = SyntaxKind.None OrElse Not IsOnStartLine(previousToken.SpanStart, text, startLine) Then
Debugging\ProximityExpressionsGetter.vb (1)
74Dim info = semanticModel.GetSpeculativeSymbolInfo(token.SpanStart, expression, SpeculativeBindingOption.BindAsExpression)
EditAndContinue\BreakpointSpans.vb (7)
173If position >= asSingleLine.IfKeyword.SpanStart AndAlso position < asSingleLine.ThenKeyword.Span.End Then 174Return TextSpan.FromBounds(asSingleLine.IfKeyword.SpanStart, asSingleLine.ThenKeyword.Span.End) 237Return TextSpan.FromBounds(methodBase.DeclarationKeyword.SpanStart, methodBase.Span.End) 240Return TextSpan.FromBounds(methodBase.Modifiers.First().SpanStart, methodBase.Span.End) 326If position > list.GetSeparator(i).SpanStart Then 397If position < clause.ByKeyword.SpanStart Then 409If position >= clause.Keys.First.SpanStart AndAlso position < clause.IntoKeyword.SpanStart Then
EditAndContinue\SyntaxComparer.vb (1)
695nodeOpt.SpanStart < DirectCast(nodeOpt.Parent, GroupByClauseSyntax).ByKeyword.SpanStart Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (7)
332Return BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent, token.SpanStart, minLength:=token.Span.Length, span) 1289Return TextSpan.FromBounds(groupJoin.GroupKeyword.SpanStart, groupJoin.JoinKeyword.Span.End) 1304Return TextSpan.FromBounds(partition.SkipOrTakeKeyword.SpanStart, partition.WhileKeyword.Span.End) 1324Return TextSpan.FromBounds(node.NamespaceKeyword.SpanStart, node.Name.Span.End) 1334Return TextSpan.FromBounds(If(modifiers.Count <> 0, modifiers.First.SpanStart, start.SpanStart), 1399Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End) 1412Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)
ExtractMethod\VisualBasicSelectionResult.vb (2)
87Return firstToken.SpanStart <= current.GetFirstToken().SpanStart AndAlso
Highlighting\KeywordHighlighters\AccessorDeclarationHighlighter.vb (1)
39highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\ConditionalPreprocessorHighlighter.vb (3)
27highlights.Add(TextSpan.FromBounds(.HashToken.SpanStart, .IfOrElseIfKeyword.Span.End)) 34highlights.Add(TextSpan.FromBounds(.HashToken.SpanStart, .ElseKeyword.Span.End)) 38highlights.Add(TextSpan.FromBounds(.HashToken.SpanStart, .IfKeyword.Span.End))
Highlighting\KeywordHighlighters\ConstructorDeclarationHighlighter.vb (1)
31highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .NewKeyword.Span.End))
Highlighting\KeywordHighlighters\EventDeclarationHighlighter.vb (1)
32highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\ForLoopBlockHighlighter.vb (1)
38highlights.Add(TextSpan.FromBounds(.ForKeyword.SpanStart, .EachKeyword.Span.End))
Highlighting\KeywordHighlighters\MethodDeclarationHighlighter.vb (1)
37highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\OperatorDeclarationHighlighter.vb (1)
31highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\PropertyDeclarationHighlighter.vb (1)
32highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\RegionHighlighter.vb (2)
37highlights.Add(TextSpan.FromBounds(region.HashToken.SpanStart, region.RegionKeyword.Span.End)) 38highlights.Add(TextSpan.FromBounds(endRegion.HashToken.SpanStart, endRegion.RegionKeyword.Span.End))
Highlighting\KeywordHighlightingHelpers.vb (2)
89Dim previousLine = text.Lines.IndexOf(previousToken.SpanStart) 90Dim awaitLine = text.Lines.IndexOf(.AwaitKeyword.SpanStart)
SignatureHelp\AttributeSignatureHelpProvider.vb (1)
50node.ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\CastExpressionSignatureHelpProvider.vb (3)
49Return node.Span.Contains(token.SpanStart) AndAlso 50node.OpenParenToken.SpanStart <= token.SpanStart AndAlso
SignatureHelp\CollectionInitializerSignatureHelpProvider.vb (2)
45Return expression.Span.Contains(token.SpanStart) AndAlso token <> expression.CloseBraceToken 66addMethods.Select(Function(s) ConvertMemberGroupMember(document, s, collectionInitializer.OpenBraceToken.SpanStart, semanticModel)).ToList(),
SignatureHelp\ConditionalExpressionSignatureHelpProvider.vb (1)
36Return node.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
59Return node.TypeArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (1)
61node.ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\MidAssignmentSignatureHelpProvider.vb (1)
43DirectCast(node.Left, MidExpressionSyntax).ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.vb (1)
60node.ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (1)
59statement.ArgumentList.Span.Contains(token.SpanStart) AndAlso
src\Compilers\VisualBasic\Portable\Syntax\LambdaUtilities.vb (3)
290If rangeVariable.SpanStart < groupByClause.ByKeyword.SpanStart OrElse 291(rangeVariable.SpanStart = groupByClause.ByKeyword.SpanStart AndAlso rangeVariable Is groupByClause.Items.Last) Then 392If lambdaBody.SpanStart < groupByClause.ByKeyword.SpanStart Then
Structure\VisualBasicStructureHelpers.vb (2)
105startToken.SpanStart) 107Dim endPosition = endToken.SpanStart
Wrapping\SeparatedSyntaxList\VisualBasicArgumentWrapper.vb (1)
68Dim span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)
Wrapping\SeparatedSyntaxList\VisualBasicParameterWrapper.vb (1)
60Dim headerSpan = TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
FlowAnalysis\FlowTestBase.vb (2)
179Dim startPosition = startToken.SpanStart 190If nextToken.SpanStart >= region.End Then
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (17)
TestSyntaxNodes.vb (17)
359Assert.Equal(tree.SpanStart, tree.FullSpan.Start) 361VerifyListSpans(precedingTrivia, New TextSpan(tree.FullSpan.Start, (tree.SpanStart - tree.FullSpan.Start))) 486Assert.Equal(0, l(0).SpanStart) 495Assert.Equal(4, param.Modifiers(0).SpanStart) 503Assert.Equal(0, param.Modifiers(0).SpanStart) 521Assert.Equal(0, l(0).SpanStart) 523Assert.Equal(6, l(1).SpanStart) 525Assert.Equal(15, l(2).SpanStart) 536Assert.Equal(4, param.Modifiers(0).SpanStart) 538Assert.Equal(10, param.Modifiers(1).SpanStart) 540Assert.Equal(19, param.Modifiers(2).SpanStart) 550Assert.Equal(4, param.Modifiers(0).SpanStart) 552Assert.Equal(10, param.Modifiers(1).SpanStart) 554Assert.Equal(19, param.Modifiers(2).SpanStart) 686Assert.Equal(0, tok.SpanStart) 702Assert.Equal(0, tok.SpanStart) 730Assert.Equal(9, tok.SpanStart)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (15)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (2)
177semanticModel.SyntaxTree.IsExpressionContext(token.SpanStart, cancellationToken, semanticModel) Then 186If semanticModel.SyntaxTree.IsExpressionContext(token.SpanStart, cancellationToken, semanticModel) Then
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (1)
22Dim position = If(oldFunc.ParameterList IsNot Nothing, oldFunc.ParameterList.SpanStart, oldFunc.Identifier.SpanStart)
Formatting\Rules\BaseFormattingRule.vb (1)
68Return TextSpan.FromBounds(spanStart, nextToken.SpanStart)
Formatting\Rules\NodeBasedFormattingRule.vb (1)
79AddIndentBlockOperation(operations, baseToken, startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End))
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
156Dim startLineOfCurrentToken = text.Lines.GetLineFromPosition(identifier.SpanStart).LineNumber
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (2)
203Dim tokenLine = text.Lines.IndexOf(token.SpanStart) 204Dim previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Indentation\VisualBasicSmartTokenFormatter.vb (1)
40Dim spans = SpecializedCollections.SingletonEnumerable(TextSpan.FromBounds(previousToken.SpanStart, token.Span.End))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (4)
249Return indenter.GetIndentationOfLine(indenter.LineToBeIndented.Text.Lines.GetLineFromPosition(token.SpanStart)) 267Dim currentTokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart) 289If IsCommaInParameters(token) AndAlso (token.Span.End <= position AndAlso position <= token.GetNextToken().SpanStart) Then 290Return GetIndentationOfCurrentPosition(indenter, token, token.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.vb (1)
59If token.Kind = SyntaxKind.None OrElse token.SpanStart <> firstNonWhitespacePosition Then
Microsoft.CodeAnalysis.Workspaces (81)
CodeCleanup\AbstractCodeCleanerService.cs (8)
244return previousToken.GetNextToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true).SpanStart; 247return previousToken.SpanStart; 338var start = intervalTree.HasIntervalThatOverlapsWith(previousToken.SpanStart, previousToken.Span.Length) 339? previousToken.SpanStart 340: startToken.SpanStart; 343var end = intervalTree.HasIntervalThatOverlapsWith(nextToken.SpanStart, nextToken.Span.Length) 389if (startToken.Span.End <= endToken.SpanStart) 391return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
215var positionOfReferenceInTree = token.SpanStart + offsetOfReferenceInToken + 1;
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (2)
85var containingType = semanticModel.GetEnclosingNamedType(token.SpanStart, cancellationToken); 90var containingType = semanticModel.GetEnclosingNamedType(token.SpanStart, cancellationToken);
FindSymbols\FindReferences\FindReferenceCache.cs (1)
206nextIndex = Math.Max(nextIndex, token.SpanStart);
Recommendations\AbstractRecommendationService.cs (3)
46var enclosingSymbol = context.SemanticModel.GetEnclosingSymbol(context.LeftToken.SpanStart, cancellationToken); 113_context.SemanticModel.GetEnclosingNamedType(_context.LeftToken.SpanStart, _cancellationToken), 159var enclosingType = _context.SemanticModel.GetEnclosingNamedType(_context.LeftToken.SpanStart, _cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (4)
86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 91currentVC.Span.Start == token.SpanStart + 2, "First span should start on the second or third char of the string."); 162var offset = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (1)
86text.AreOnSameLine(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (5)
585if (token.Span.Length > 0 && token.SpanStart <= position) 624if (position < token.SpanStart) 663if (position <= token.SpanStart) 672while (position <= token.SpanStart && root.FullSpan.Start < token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
75if (token.SpanStart == position &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
126return position <= firstToken.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (4)
61position <= token.GetNextToken(includeZeroWidth: true).SpanStart) 132return GetIndentationOfCurrentPosition(root, list, token.SpanStart, /* extraSpaces */ 0, tokenColumnGetter, cancellationToken); 166var textLine = baseToken.SyntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(baseToken.SpanStart); 357if (operation.TextSpan.End == position && position == nextToken.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (3)
418=> GetBaseIndentation(token.SpanStart); 644var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End); 659var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (4)
59o => o.TextSpan.Contains(startToken.SpanStart) || 60o.TextSpan.Contains(endToken.SpanStart))); 69var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End); 146var startPosition = token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (3)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0))) 338var startPosition = this.TreeData.IsFirstToken(_startToken) ? this.TreeData.StartPosition : _startToken.SpanStart; 458var spanBetweenTokens = TextSpan.FromBounds(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
337var spanBetweenTokens = TextSpan.FromBounds(previousToken.Token.Span.End, currentToken.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
78var span = TextSpan.FromBounds(token1.RawKind == 0 ? this.TreeInfo.StartPosition : token1.Span.End, token2.RawKind == 0 ? this.TreeInfo.EndPosition : token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (2)
72var start = this.Token.SpanStart - other.Token.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (3)
211if (token1.Span.End > token2.SpanStart) 390Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 415Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (4)
28var line = _text.Lines.GetLineFromPosition(token.SpanStart); 30return line.GetColumnFromLineOffset(token.SpanStart - line.Start, tabSize); 38return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 47return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (1)
43var text = _trivia.ToFullString()[..(token.SpanStart - _trivia.FullSpan.Start)];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
305return TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End); 363if (headerFacts.IsOnIfStatementHeader(root, operation.BaseToken.SpanStart, out var conditionStatement) 364|| headerFacts.IsOnWhileStatementHeader(root, operation.BaseToken.SpanStart, out conditionStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (1)
43=> CreateSuppressOperation(startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End), option);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
219return this.Token2.SpanStart; 488if (ContainsOnlyWhitespace(firstToken.FullSpan.Start, firstToken.SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
131if (token.SpanStart >= LineToBeIndented.Start) 210=> GetIndentationOfPosition(token.SpanStart, addedSpaces);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (2)
169position <= token.SpanStart && 170text.AreOnSameLine(position, token.SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
221var orderedTokens = tokens.Distinct().OrderBy(t => t.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (10)
64if (currentOne.Item1.SpanStart <= previousOne.Item2.Span.End) 97if (textSpan.Start < startToken.SpanStart) 124Contract.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart); 143return root.FullSpan.End == startToken.SpanStart || startToken.FullSpan.End > endToken.FullSpan.Start; 151var startPosition = token.SpanStart; 158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 275return nextToken.SpanStart; 292return nextToken.SpanStart; 365var startPosition = startToken.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
51return TextSpan.FromBounds(start.SpanStart, end.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (5)
32var tokenLine = document.Text.Lines.GetLineFromPosition(token.SpanStart); 33if (tokenLine.Start != token.SpanStart) 37if (firstNonWhitespacePos.Value == token.SpanStart) 40return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart)); 56var newTokenLine = newDocument.Text.Lines.GetLineFromPosition(newRoot.GetAnnotatedTokens(annotation).Single().SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
172var affectedSpan = TextSpan.FromBounds(previousToken.SpanStart, FirstStatementAffectedInInnermostBlock.Span.End);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
CodeCleanup\Extensions.cs (1)
23return TextSpan.FromBounds(previousToken.SpanStart, endToken.Span.End);
Microsoft.VisualStudio.LanguageServices.CSharp (26)
CodeModel\CSharpCodeModelService.NodeLocator.cs (26)
153var openBraceLine = text.Lines.GetLineFromPosition(openBrace.SpanStart); 154var closeBraceLine = text.Lines.GetLineFromPosition(closeBrace.SpanStart); 157var nextPosition = tokenAfterOpenBrace.SpanStart; 174openBraceLine.LineNumber < text.Lines.IndexOf(tokenAfterOpenBrace.SpanStart)) 200if (closeBrace.SpanStart == nextPosition) 213var closeBraceLine = text.Lines.GetLineFromPosition(closeBrace.SpanStart); 214var textBeforeBrace = text.ToString(TextSpan.FromBounds(closeBraceLine.Start, closeBrace.SpanStart)); 218: new VirtualTreePoint(closeBrace.SyntaxTree, text, closeBrace.SpanStart); 261startPosition = node.GetFirstToken().SpanStart; 319startPosition = node.GetFirstTokenAfterAttributes().SpanStart; 331startPosition = node.GetFirstToken().SpanStart; 335startPosition = node.Identifier.SpanStart; 367startPosition = node.GetFirstTokenAfterAttributes().SpanStart; 379startPosition = node.GetFirstToken().SpanStart; 395startPosition = ((MethodDeclarationSyntax)node).Identifier.SpanStart; 398startPosition = ((ConstructorDeclarationSyntax)node).Identifier.SpanStart; 401startPosition = ((DestructorDeclarationSyntax)node).Identifier.SpanStart; 404startPosition = ((ConversionOperatorDeclarationSyntax)node).ImplicitOrExplicitKeyword.SpanStart; 407startPosition = ((OperatorDeclarationSyntax)node).OperatorToken.SpanStart; 410startPosition = node.GetFirstTokenAfterAttributes().SpanStart; 574startPosition = node.GetFirstToken().SpanStart; 628startPosition = node.GetFirstToken().SpanStart; 632startPosition = node.Identifier.SpanStart; 709startPosition = node.Identifier.SpanStart; 749startPosition = node.Identifier.SpanStart; 789startPosition = node.Identifier.SpanStart;
Microsoft.VisualStudio.LanguageServices.VisualBasic (26)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (25)
233startPosition = attributes.First().LessThanToken.SpanStart 286Return typeBlock.BlockStatement.Modifiers.First().SpanStart 288Return typeBlock.BlockStatement.DeclarationKeyword.SpanStart 294Return enumBlock.EnumStatement.Modifiers.First().SpanStart 296Return enumBlock.EnumStatement.EnumKeyword.SpanStart 305startPosition = typeBlock.BlockStatement.Identifier.SpanStart 391startPosition = enumBlock.EnumStatement.Identifier.SpanStart 464startPosition = DirectCast(methodBlock.BlockStatement, SubNewStatementSyntax).NewKeyword.SpanStart 467startPosition = DirectCast(methodBlock.BlockStatement, MethodStatementSyntax).Identifier.SpanStart 469startPosition = DirectCast(methodBlock.BlockStatement, OperatorStatementSyntax).OperatorToken.SpanStart 521startPosition = declareStatement.Identifier.SpanStart 535startPosition = declareStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 586startPosition = methodStatement.Identifier.SpanStart 600startPosition = methodStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 710startPosition = propertyStatement.Identifier.SpanStart 717startPosition = propertyStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 791startPosition = eventBlock.EventStatement.Identifier.SpanStart 831startPosition = eventStatement.Identifier.SpanStart 845startPosition = eventStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 912startPosition = delegateStatement.Identifier.SpanStart 926startPosition = delegateStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 1090startPosition = fieldDeclaration.Modifiers.First().SpanStart 1106startPosition = enumMember.Identifier.SpanStart 1118startPosition = enumMember.Identifier.SpanStart 1196startPosition = parameter.Modifiers.First().SpanStart
CodeModel\VisualBasicCodeModelService.vb (1)
4135text = text.Replace(TextSpan.FromBounds(methodStatement.HandlesClause.Events.GetSeparator(index - 1).SpanStart, clauseItemToRemove.Span.End), String.Empty)