1319 references to SpanStart
Microsoft.CodeAnalysis (1)
Syntax\SyntaxNodeOrToken.cs (1)
262return _nodeOrParent.SpanStart;
Microsoft.CodeAnalysis.CodeStyle (22)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
147foreach (var node in nodes.OrderBy(n => n.SpanStart))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
127var spanStart = firstBlock.Syntax.SpanStart;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
192_objectCreationExpression.SpanStart,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (4)
36syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, arguments[0].SpanStart)), 48syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, expression.SpanStart)),
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (2)
213if (expression != null && expression.SpanStart < _objectCreationExpression.SpanStart)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
155formatString, formatStringLiteralExpressionSyntax.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
606return declarationSyntax != null && position < declarationSyntax.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (7)
305Math.Min(fullSpan.Start, node.SpanStart), 321var end = endNode.SpanStart; 846=> x?.SpanStart == y?.SpanStart; 849=> obj.SpanStart; 926condDirectivesBuilder.Sort(static (n1, n2) => n1.SpanStart.CompareTo(n2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
100return node.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
85var spanStart = documentationComment.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
775!forEachExpression.Span.Contains(OriginalExpression.SpanStart)) 870newSymbol = this.OriginalSemanticModel.GetSpeculativeSymbolInfo(type.SpanStart, newType, bindingOption).Symbol;
Microsoft.CodeAnalysis.CodeStyle.Fixes (16)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
94var title = GetSubItemName(semanticModel, targetNode.SpanStart, conversionType);
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (2)
67return _syntaxFacts.GetContainingMemberDeclaration(root, node.SpanStart) ?? 68_syntaxFacts.GetContainingTypeDeclaration(root, node.SpanStart);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
87if (semanticModel.GetEnclosingSymbol(node.SpanStart, cancellationToken) is IMethodSymbol methodWithDiagnostic)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
67ContainingType = document.SemanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken); 91ContainingType = document.SemanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
59ContainingType = semanticModel.GetEnclosingNamedType(targetVariables.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
104ContainingType = semanticModel.GetEnclosingNamedType(methodDeclaration.SpanStart, cancellationToken); 153ContainingType = semanticModel.GetEnclosingNamedType(SimpleNameOpt.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
474var enclosingMethodSymbol = _document.SemanticModel.GetEnclosingSymbol<IMethodSymbol>(SimpleNameOrMemberAccessExpressionOpt.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
100.OrderByDescending(n => n.SpanStart)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
887memberDeclaration = syntaxFacts.GetContainingMemberDeclaration(root, memberDeclaration.SpanStart) ?? root;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
56var containingSymbol = semanticModel.GetRequiredEnclosingSymbol(ifStatement.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
205var afterMember = declarationList.LastOrDefault(m => m.SpanStart <= info.Context.AfterThisLocation.SourceSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
256var containedNamespace = model.GetEnclosingNamespace(node.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
92=> semanticModel.LookupSymbols(location.SpanStart).Concat(semanticModel.GetExistingSymbols(container, cancellationToken));
Microsoft.CodeAnalysis.CSharp (21)
Binder\Binder_Expressions.cs (2)
2213if (node.SpanStart >= declarator.SpanStart) 9138location = expr.Syntax.SyntaxTree.GetLocation(TextSpan.FromBounds(expr.Syntax.SpanStart, conditional.OperatorToken.Span.End));
Binder\BinderFactory.cs (2)
111int position = node.SpanStart; 192Binder result = visitor.VisitNamespaceDeclaration((BaseNamespaceDeclarationSyntax)unit, unit.SpanStart, inBody: true, inUsing: false);
Compilation\CSharpSemanticModel.cs (2)
442if (position == node.SpanStart) 1315var position = node.SpanStart;
Compilation\MemberSemanticModel.cs (1)
1650CSharpSyntaxNode enclosingLambdaOrQuery = GetInnermostLambdaOrQuery(lambdaOrQuery, lambdaOrQuery.SpanStart, allowStarting: false);
FlowAnalysis\AbstractFlowPass.cs (1)
202int startLocation = firstInRegion.Syntax.SpanStart;
FlowAnalysis\NullableWalker.cs (2)
9544conversionOpt.Syntax.SpanStart != convertedNode.Syntax.SpanStart)
FlowAnalysis\NullableWalker.SnapshotManager.cs (2)
111int nodePosition = node.Syntax.SpanStart; 217_incrementalSnapshots[node.Syntax.SpanStart] = new Snapshot(currentState.CreateSnapshot(), _currentWalkerSlot);
FlowAnalysis\RegionAnalysisContext.cs (1)
45firstInRegion.Syntax.SpanStart > lastInRegion.Syntax.Span.End;
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
228int syntaxOffset = CurrentMethod.CalculateLocalSyntaxOffset(node.SpanStart, node.SyntaxTree);
Operations\CSharpOperationFactory.cs (1)
2077legacyMode ? null : new SynthesizedLocal((_semanticModel.GetEnclosingSymbol(boundLockStatement.Syntax.SpanStart) as IMethodSymbol).GetSymbol(),
Symbols\LexicalSortKey.cs (1)
83: this(node.SyntaxTree, node.SpanStart, compilation)
Symbols\Source\SourceConstructorSymbolBase.cs (1)
184if (position == ctorSyntax.SpanStart)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4035Debug.Assert(node.SpanStart > initializers.Last().Syntax.Span.Start);
Symbols\Source\SourceMemberMethodSymbol.cs (1)
1153return localPosition - bodySyntax.SpanStart;
Syntax\LambdaUtilities.cs (1)
481return (node is SwitchExpressionSyntax switchExpression) ? switchExpression.SwitchKeyword.SpanStart : node.SpanStart;
Syntax\LookupPosition.cs (1)
90return IsBeforeToken(position, firstExcluded) && position >= node.SpanStart;
Microsoft.CodeAnalysis.CSharp.CodeStyle (48)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
55: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.SemicolonToken.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
155if (localDeclarator.SpanStart >= argumentNode.SpanStart)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
184var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
224var startReportSpan = TextSpan.FromBounds(anonymousFunction.SpanStart, invokedExpression.SpanStart);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
127|| !possibleNullableImpactIntervalTree.HasIntervalThatOverlapsWith(currentOptionsDirective.Span.End, nullableDirectiveTrivia.SpanStart - currentOptionsDirective.Span.End)) 205positionOfFirstReducingNullableDirective = directive.SpanStart;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
52if (_ignoredSpans.HasIntervalThatContains(node.SpanStart, node.Span.Length))
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
75return firstUnreachableStatement != null && firstUnreachableStatement.SpanStart == node.SpanStart
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
219expression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
62invocationExpression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
303text.Lines.GetLineFromPosition(expression.SpanStart).LineNumber + 1 == text.Lines.GetLineFromPosition(expression.Span.End).LineNumber &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
87objectCreationExpression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
71expression.SpanStart, 111expression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
207var reservedNames = semanticModel.LookupSymbols(container.SpanStart)
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
105TextSpan.FromBounds(declaration.SpanStart, declaration.ArrowToken.Span.End));
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
55var fadeSpan = TextSpan.FromBounds(nameColon.Name.SpanStart, nameColon.ColonToken.Span.End); 81var fadeSpan = TextSpan.FromBounds(nameEquals.Name.SpanStart, nameEquals.EqualsToken.Span.End);
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
244var anonymousFunctionStart = anonymousFunction.SpanStart; 401var localEnclosingSymbol = semanticModel.GetEnclosingSymbol(localDeclaration.SpanStart, cancellationToken);
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (2)
94var position = argument.Expression.SpanStart; 102var symbols = semanticModel.LookupSymbols(argument.Expression.SpanStart, name: stringValue);
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
62if (operation.SemanticModel.TryGetSpeculativeSemanticModel(typeSyntax.SpanStart, dummyStatement, out var speculativeModel))
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (5)
256if (node.SpanStart < _localStatement.Span.End) 260if (node.Span.End >= _comparison.SpanStart) 351var localStatementStart = _localStatement.SpanStart; 352var comparisonSpanStart = _comparison.SpanStart; 359var descendentNodeSpanStart = descendentNode.SpanStart;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (5)
166var localStatementStart = localStatement.SpanStart; 167var comparisonSpanStart = comparison.SpanStart; 171var descendentNodeSpanStart = descendentNode.SpanStart; 212var descendentNodeSpanStart = descendentNode.SpanStart; 233var descendentNodeSpanStart = descendentNode.SpanStart;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
574var symbols = semanticModel.LookupSymbols(operation.Syntax.SpanStart, name: parameter.Name);
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
124var span = TextSpan.FromBounds(elements[0].Syntax.SpanStart, elements[^1].Syntax.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
72if (conditionalDirectives.First().SpanStart <= block.OpenBraceToken.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
334var potentialType = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
125return semanticModel.LookupSymbols(expr.SpanStart, container: symbol, name: name, includeReducedExtensionMethods: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
573if (!textSpan.Contains(directives[0].SpanStart) || 574!textSpan.Contains(directives.Last().SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
75if (trivia.Span.End == currentParent.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
961var member = GetContainingMemberDeclaration(node, node.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
118var position = originalNode.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
106var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (1)
119.OrderBy(n => n.SpanStart).ToList();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (31)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (1)
32return semanticModel.GetSpeculativeSymbolInfo(newInvocation.SpanStart, newInvocation, SpeculativeBindingOption.BindAsExpression);
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\AttributeArgumentFixer.cs (1)
32return semanticModel.GetSpeculativeSymbolInfo(newAttribute.SpanStart, newAttribute);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
415var outerIndentation = document.Text.GetLeadingWhitespaceOfLineAtPosition(fileScopedNamespace.SpanStart);
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
57var currentType = semanticModel.GetEnclosingNamedType(constructorInitializer.SpanStart, cancellationToken);
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
156if (semanticModel.SyntaxTree.IsNameOfContext(expression.SpanStart, semanticModel, cancellationToken))
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
105type.ToMinimalDisplayString(model, node.SpanStart), 106ienumerableGenericSymbol.ToMinimalDisplayString(model, node.SpanStart));
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
94edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
96edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
551var startLine = document.Text.Lines.GetLineFromPosition(GetAnchorNode(expression).SpanStart); 845var lineToConsider = text.Lines.GetLineFromPosition(expressionToReplace.SpanStart);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
99foreach (var (localDeclaration, anonymousFunction, references) in nodesFromDiagnostics.OrderByDescending(nodes => nodes.function.SpanStart))
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
56foreach (var typeArgumentList in nameofInvocation.DescendantNodes().OfType<TypeArgumentListSyntax>().OrderByDescending(t => t.SpanStart))
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
120.Where(a => a.Initializer?.ElementValues.FirstOrDefault()?.Syntax.SpanStart == diagnostic.Location.SourceSpan.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
42var start = usings.First().SpanStart; 51var start = rootUsings.First().SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (5)
882if (firstConstructorConstraint == null || firstConstructorConstraint.SpanStart > token.Span.End) 1372return IsAtStartOfPattern(syntaxTree, parenthesizedExpression.GetFirstToken().GetPreviousToken(), parenthesizedExpression.SpanStart); 1564=> node.FindTokenOnLeftOfPosition(node.SpanStart); 2896var tokenBeforeName = syntaxTree.FindTokenOnLeftOfPosition(nameExpr.SpanStart, cancellationToken); 2902if (syntaxTree.IsExpressionContext(nameExpr.SpanStart, tokenBeforeName, attributes: false, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
177name.SpanStart, name, SpeculativeBindingOption.BindAsExpression); 180name.SpanStart, name, SpeculativeBindingOption.BindAsExpression).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
36var end = destination.Members.First().SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
414if (firstToken.SpanStart <= clause.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
63spansToFormat.Add(TextSpan.FromBounds(0, firstMemberA.SpanStart)); 67spansToFormat.Add(TextSpan.FromBounds(baseNamespace.Name.Span.End, firstMemberB.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
43var visibleSymbols = semanticModel.LookupSymbols(location.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
261return InferTypes(expression.SpanStart); 1296=> InferTypes(implicitArray.SpanStart); 2217if (descendant.SpanStart <= afterNode.Span.End)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (16)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (2)
615CatchClauseSyntax catchClauseNode => catchClauseNode.Block.SpanStart, 616FinallyClauseSyntax finallyClauseNode => finallyClauseNode.Block.SpanStart,
CompleteStatement\CompleteStatementCommandHandler.cs (3)
439return caretPosition > condition.SpanStart && caretPosition <= condition.Span.End; 489if (caret.Position <= currentNode.SpanStart + 1) 492else if (caret.Position <= currentNode.SpanStart)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
275var stringExpressionAfterPaste = FindContainingSupportedStringExpression(rootAfterPaste, stringExpressionBeforePaste.SpanStart);
StringCopyPaste\StringInfo.cs (10)
86var start = literal.SpanStart; 89var delimiterQuoteCount = start - literal.SpanStart; 104startDelimiterSpan: TextSpan.FromBounds(literal.SpanStart, start), 145TextSpan.FromBounds(literal.SpanStart, rawStart), 158var start = literal.SpanStart; 175startDelimiterSpan: TextSpan.FromBounds(literal.SpanStart, start), 187var start = interpolatedString.SpanStart; 190var delimiterDollarCount = start - interpolatedString.SpanStart; 209result.Add(TextSpan.FromBounds(currentPosition, content.SpanStart)); 219startDelimiterSpan: TextSpan.FromBounds(interpolatedString.SpanStart, interpolatedString.StringStartToken.Span.End),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (1)
85statement.SpanStart, replacement,
TypeInferrer\TypeInferrerTests.cs (1)
35var position = node?.SpanStart ?? textSpan.Start;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenDeconstructTests.cs (8)
3583Assert.Same(symbol, model.LookupSymbols(decl.SpanStart, name: decl.Identifier.ValueText).Single()); 3584Assert.True(model.LookupNames(decl.SpanStart).Contains(decl.Identifier.ValueText)); 3603Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: decl.Identifier.ValueText).Single()); 3604Assert.True(model.LookupNames(reference.SpanStart).Contains(decl.Identifier.ValueText)); 3615Assert.Same(field, model.LookupSymbols(decl.SpanStart, name: decl.Identifier.ValueText).Single()); 3617Assert.True(model.LookupNames(decl.SpanStart).Contains(decl.Identifier.ValueText)); 3622Assert.Same(field, model.LookupSymbols(reference.SpanStart, name: decl.Identifier.ValueText).Single()); 3623Assert.True(model.LookupNames(reference.SpanStart).Contains(decl.Identifier.ValueText));
CodeGen\CodeGenTupleTest.cs (3)
12695var m1Tuple = model.LookupSymbols(node.SpanStart, name: "v1").OfType<ILocalSymbol>().Single().Type.GetSymbol<NamedTypeSymbol>(); 12696var m2Tuple = model.LookupSymbols(node.SpanStart, name: "v2").OfType<ILocalSymbol>().Single().Type.GetSymbol<NamedTypeSymbol>(); 12697var m6Tuple = model.LookupSymbols(node.SpanStart, name: "v6").OfType<ILocalSymbol>().Single().Type.GetSymbol<NamedTypeSymbol>();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (265)
FieldKeywordTests.cs (2)
10494Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(previousAccessor.Body.SpanStart, modifiedAccessor, out var speculativeModel)); 10528Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(previousAccessor.Body.SpanStart, modifiedAccessor, out var speculativeModel));
FirstClassSpanTests.cs (1)
5006var lookupResult = model.LookupSymbols(d1Access.Name.SpanStart, aSymbol.Type, "M", includeReducedExtensionMethods: true);
FlowAnalysis\FlowTestBase.cs (4)
127if (expr.SpanStart >= start && expr.Span.End <= end) 148if (expr.SpanStart >= start && expr.Span.End <= end) 180if (expr.SpanStart >= start && expr.Span.End <= end) 201if (firstStatement == null && stmt.SpanStart >= start)
Semantics\OutVarTests.cs (53)
973var other = model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText).Single(); 983Assert.True(model.LookupNames(decl.SpanStart).Contains(decl.Identifier().ValueText)); 992Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: decl.Identifier().ValueText).Single()); 993Assert.True(model.LookupNames(reference.SpanStart).Contains(decl.Identifier().ValueText)); 1145Assert.NotEqual(symbol, model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText).Single()); 1146Assert.True(model.LookupNames(decl.SpanStart).Contains(decl.Identifier().ValueText)); 1156Assert.False(model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Any()); 1157Assert.False(model.LookupNames(reference.SpanStart).Contains(reference.Identifier.ValueText)); 1166Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 1167Assert.True(model.LookupNames(reference.SpanStart).Contains(reference.Identifier.ValueText)); 1197Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 1198Assert.True(model.LookupNames(reference.SpanStart).Contains(reference.Identifier.ValueText)); 1210if (dataFlowParent.Span.Contains(reference.Span) && reference.SpanStart > decl.SpanStart) 1299(containingReturnOrThrow == null || containingReturnOrThrow.Span.Contains(reference.SpanStart)) && 1300(reference.SpanStart > decl.SpanStart || 3464bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, initializer, out model); 3505bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, initializer, out model); 4004bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 5110bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 8804bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 9643bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 9654Assert.Equal("System.Int64 y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 10211bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 10222Assert.Equal("System.Boolean y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 10860bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 13340bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 13739bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 15260bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 16538bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 17097bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 17533bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 21299bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 21311var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single(); 22704Assert.False(model.LookupSymbols(decl.SpanStart, name: identifierText).Any()); 22706Assert.False(model.LookupNames(decl.SpanStart).Contains(identifierText)); 22719Assert.False(model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Any()); 22720Assert.DoesNotContain(reference.Identifier.ValueText, model.LookupNames(reference.SpanStart)); 32738var symbols = model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText); 32739var names = model.LookupNames(decl.SpanStart); 32766symbols = model.LookupSymbols(reference.SpanStart, name: decl.Identifier().ValueText); 32782Assert.True(model.LookupNames(reference.SpanStart).Contains(decl.Identifier().ValueText)); 35666bool success = model.TryGetSpeculativeSemanticModel(statementBefore.SpanStart, statementAfter, out model); 36364Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36371Assert.True(model.TryGetSpeculativeSemanticModel(method.Body.SpanStart + 1, method.DescendantNodes().OfType<AttributeSyntax>().Single(), out speculativeModel)); 36410Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36450Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36458Assert.True(model.TryGetSpeculativeSemanticModel(equalsValue.Value.SpanStart, equalsValue, out speculativeModel)); 36492Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36527Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36536Assert.True(model.TryGetSpeculativeSemanticModel(equalsValue.Value.SpanStart, equalsValue, out speculativeModel)); 36565Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel));
Semantics\PatternMatchingTestBase.cs (25)
87var other = model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single(); 97Assert.True(model.LookupNames(designation.SpanStart).Contains(designation.Identifier.ValueText)); 126Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: designation.Identifier.ValueText).Single()); 127Assert.True(model.LookupNames(reference.SpanStart).Contains(designation.Identifier.ValueText)); 147Assert.NotEqual(symbol, model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single()); 148Assert.True(model.LookupNames(designation.SpanStart).Contains(designation.Identifier.ValueText)); 173Assert.NotEqual(symbol, model.LookupSymbols(declarator.SpanStart, name: declarator.Identifier.ValueText).Single()); 174Assert.True(model.LookupNames(declarator.SpanStart).Contains(declarator.Identifier.ValueText)); 187Assert.NotEqual(symbol, model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single()); 188Assert.True(model.LookupNames(designation.SpanStart).Contains(designation.Identifier.ValueText)); 197Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 198Assert.True(model.LookupNames(reference.SpanStart).Contains(reference.Identifier.ValueText)); 210var other = model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single(); 212Assert.True(model.LookupNames(reference.SpanStart).Contains(reference.Identifier.ValueText)); 218Assert.False(model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Any()); 219Assert.False(model.LookupNames(reference.SpanStart).Contains(reference.Identifier.ValueText)); 250var symbols = model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText); 251var names = model.LookupNames(designation.SpanStart); 302symbols = model.LookupSymbols(reference.SpanStart, name: designation.Identifier.ValueText); 318Assert.True(model.LookupNames(reference.SpanStart).Contains(designation.Identifier.ValueText)); 377Assert.False(model.LookupSymbols(designation.SpanStart, name: identifierText).Any()); 379Assert.False(model.LookupNames(designation.SpanStart).Contains(identifierText)); 420Assert.False(model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Any()); 421Assert.DoesNotContain(reference.Identifier.ValueText, model.LookupNames(reference.SpanStart)); 461var binder = model.GetEnclosingBinder(node.SpanStart);
Semantics\PatternMatchingTests_Scope.cs (16)
408GetReferences(tree, "SpeculateHere").Single().SpanStart, 713tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, 982tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, 1286GetReferences(tree, "SpeculateHere").Single().SpanStart, 5342GetReferences(tree, "SpeculateHere").Single().SpanStart, 6472GetReferences(tree, "SpeculateHere").Single().SpanStart, 6484Assert.Equal("System.Int64 y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 6884bool success = model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, statement, out model); 6895Assert.Equal("System.Boolean y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 7212GetReferences(tree, "SpeculateHere").Single().SpanStart, 7535GetReferences(tree, "SpeculateHere").Single().SpanStart, 9641GetReferences(tree, "SpeculateHere").Single().SpanStart, 10204GetReferences(tree, "SpeculateHere").Single().SpanStart, 10720tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, 12146bool success = model.TryGetSpeculativeSemanticModel(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model); 12158var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single();
Semantics\PatternMatchingTests4.cs (11)
4019var binder = model.GetEnclosingBinder(@switch.SpanStart); 4088var binder = model.GetEnclosingBinder(@switch.SpanStart); 4161var binder = model.GetEnclosingBinder(@switch.SpanStart); 4233var binder = model.GetEnclosingBinder(@is.SpanStart); 4277var binder = model.GetEnclosingBinder(@switch.SpanStart); 4324var binder = model.GetEnclosingBinder(@switch.SpanStart); 4406var binder = model.GetEnclosingBinder(@switch.SpanStart); 4488var binder = model.GetEnclosingBinder(@switch.SpanStart); 4570var binder = model.GetEnclosingBinder(@switch.SpanStart); 4652var binder = model.GetEnclosingBinder(@switch.SpanStart); 4736var binder = model.GetEnclosingBinder(@switch.SpanStart);
Semantics\PrimaryConstructorTests.cs (82)
1013Assert.Same(symbol, model.LookupSymbols(x.SpanStart, name: "X").Single()); 1014Assert.Contains("X", model.LookupNames(x.SpanStart)); 1080Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1081Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 1082Assert.Contains("X", model.LookupNames(x.SpanStart)); 1307Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1308Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 1309Assert.Contains("X", model.LookupNames(x.SpanStart)); 1320Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1321Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "y")); 1322Assert.Contains("y", model.LookupNames(x.SpanStart)); 1331Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "Test")); 1332Assert.Contains("Test", model.LookupNames(x.SpanStart)); 1372Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1373Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1374Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1418Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1419Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1420Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1478Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1479Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1480Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1536Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1537Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 1538Assert.Contains("X", model.LookupNames(x.SpanStart)); 1547Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1548Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1549Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1625Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1626Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 1627Assert.Contains("X", model.LookupNames(x.SpanStart)); 1636Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1637Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1638Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1821Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1822Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1823Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1861Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1862Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 1863Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 1902Assert.Equal("C..ctor(System.Int32 X)", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 1903Assert.Equal("System.Int32 X", model.LookupSymbols(x.SpanStart, name: "X").Single().ToTestDisplayString()); 1904Assert.Contains("X", model.LookupNames(x.SpanStart)); 1974Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 1975Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 1976Assert.Contains("X", model.LookupNames(x.SpanStart)); 2173Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, 2176var otherBasePosition = ((BaseListSyntax)baseWithargs.Parent).Types[1].SpanStart; 2179Assert.True(model.TryGetSpeculativeSemanticModel(baseWithargs.SpanStart, speculativePrimaryInitializer, out speculativeModel)); 2204symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2207symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer); 2325Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, 2328var otherBasePosition = ((BaseListSyntax)baseWithargs.Parent).Types[1].SpanStart; 2331Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.SpanStart, speculativePrimaryInitializer, out _)); 2343symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2346symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer); 2432Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2433Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 2434Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 2492Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutParens.SpanStart + 2, speculativeBase, out _)); 2648Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2649Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2650Assert.Contains("X", model.LookupNames(x.SpanStart)); 2686Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2687Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2688Assert.Contains("X", model.LookupNames(x.SpanStart)); 2723Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2724Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2725Assert.Contains("X", model.LookupNames(x.SpanStart)); 2759Assert.Equal("lambda expression", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2760Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2761Assert.Contains("X", model.LookupNames(x.SpanStart)); 6862Assert.Contains("System.Int32 y", model.LookupSymbols(mCall.SpanStart).Select(s => s.ToTestDisplayString())); 6864Assert.DoesNotContain("System.Int32 y", model.LookupSymbols(mDefinition.SpanStart).Select(s => s.ToTestDisplayString())); 7805Assert.Empty(model.LookupSymbols(p1.SpanStart, name: "p1")); 7806Assert.DoesNotContain("p1", model.LookupNames(p1.SpanStart)); 7833Assert.Same(symbol, model.LookupSymbols(p1.SpanStart, name: "p1").Single()); 7834Assert.Contains("p1", model.LookupNames(p1.SpanStart)); 8764Assert.Contains("p1", model.LookupNames(p1.SpanStart)); 8765Assert.Contains(symbol, model.LookupSymbols(p1.SpanStart, name: "p1")); 9170Assert.Contains("p1", model.LookupNames(p1.SpanStart)); 9171Assert.Contains(symbol, model.LookupSymbols(p1.SpanStart, name: "p1"));
Semantics\RecordTests.cs (71)
21197Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21198Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 21199Assert.Contains("X", model.LookupNames(x.SpanStart)); 21426Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21427Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 21428Assert.Contains("X", model.LookupNames(x.SpanStart)); 21439Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21440Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "y")); 21441Assert.Contains("y", model.LookupNames(x.SpanStart)); 21450Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "Test")); 21451Assert.Contains("Test", model.LookupNames(x.SpanStart)); 21491Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21492Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21493Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 21537Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21538Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21539Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 21597Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21598Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21599Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 21655Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21656Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 21657Assert.Contains("X", model.LookupNames(x.SpanStart)); 21666Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21667Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21668Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 21744Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 21745Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 21746Assert.Contains("X", model.LookupNames(x.SpanStart)); 21755Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21756Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21757Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 21940Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21941Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21942Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 21977Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 21978Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 21979Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 22015Assert.Equal("C..ctor(System.Int32 X)", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 22016Assert.Equal("System.Int32 X", model.LookupSymbols(x.SpanStart, name: "X").Single().ToTestDisplayString()); 22017Assert.Contains("X", model.LookupNames(x.SpanStart)); 22052Assert.Same("<global namespace>", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 22053Assert.Empty(model.LookupSymbols(x.SpanStart, name: "X")); 22054Assert.DoesNotContain("X", model.LookupNames(x.SpanStart)); 22131Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); 22132Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 22133Assert.Contains("X", model.LookupNames(x.SpanStart)); 22330Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, 22333var otherBasePosition = ((BaseListSyntax)baseWithargs.Parent!).Types[1].SpanStart; 22336Assert.True(model.TryGetSpeculativeSemanticModel(baseWithargs.SpanStart, speculativePrimaryInitializer, out speculativeModel!)); 22361symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22364symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer); 22482Assert.False(model.TryGetSpeculativeSemanticModel(tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, 22485var otherBasePosition = ((BaseListSyntax)baseWithargs.Parent!).Types[1].SpanStart; 22488Assert.False(model.TryGetSpeculativeSemanticModel(baseWithargs.SpanStart, speculativePrimaryInitializer, out _)); 22500symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22503symbolInfo = CSharpExtensions.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer); 24695Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 24696Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 24697Assert.Contains("X", model.LookupNames(x.SpanStart)); 24730Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 24731Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 24732Assert.Contains("X", model.LookupNames(x.SpanStart)); 24764Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 24765Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 24766Assert.Contains("X", model.LookupNames(x.SpanStart)); 24799Assert.Equal("lambda expression", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 24800Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 24801Assert.Contains("X", model.LookupNames(x.SpanStart)); 30444Assert.Contains("System.Int32 y", model.LookupSymbols(mCall.SpanStart).Select(s => s.ToTestDisplayString())); 30446Assert.DoesNotContain("System.Int32 y", model.LookupSymbols(mDefinition.SpanStart).Select(s => s.ToTestDisplayString()));
Microsoft.CodeAnalysis.CSharp.Features (158)
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (1)
63return IsSemanticTypeArgumentAsync(document, node.SpanStart, identifier, cancellationToken);
ChangeSignature\CSharpChangeSignatureService.cs (6)
221matchingNode.SpanStart; 431originalNode.SpanStart, 453originalNode.SpanStart, 469originalNode.SpanStart, 485originalNode.SpanStart, 506originalNode.SpanStart,
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
100if (identifier.SpanStart < variableDeclarator.SpanStart)
Completion\CompletionProviders\AwaitCompletionProvider.cs (4)
44MethodDeclarationSyntax method => method.ReturnType.SpanStart, 45LocalFunctionStatementSyntax local => local.ReturnType.SpanStart, 50ParenthesizedLambdaExpressionSyntax parenthesizedLambda => (parenthesizedLambda.ReturnType as SyntaxNode ?? parenthesizedLambda.ParameterList).SpanStart, 51SimpleLambdaExpressionSyntax simpleLambda => simpleLambda.Parameter.SpanStart,
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
138position = token.Parent.SpanStart;
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
147var type = typeInferenceService.InferType(semanticModel, argument.SpanStart, objectAsDefault: false, cancellationToken: cancellationToken);
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
124var namePosition = name.SpanStart;
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
94return (dotToken, expression.SpanStart);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
95builder.Add(new TextChange(new TextSpan(expression.SpanStart, 0), castText));
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
90if (token.SpanStart < parentMember.SpanStart)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
290statement.SpanStart, cancellationToken), memberDeclarationSymbol)).Count();
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
780declaredSymbol = _semanticModel.GetEnclosingSymbol(node.SpanStart, _cancellationToken);
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (1)
75if (position < baseDeclaration.SpanStart)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (4)
244var startLine = document.Text.Lines.GetLineFromPosition(GetAnchorNode(document, stringExpression).SpanStart); 358var interpolationLine = text.Lines.GetLineFromPosition(interpolation.SpanStart); 364interpolationLine.GetFirstNonWhitespacePosition() == interpolation.SpanStart) 367return GetIndentationStringForPosition(text, formattingOptions, interpolation.SpanStart);
EditAndContinue\BreakpointSpans.cs (3)
116=> TextSpan.FromBounds(node.SpanStart, token.Span.End); 213if (position <= typeDeclaration.ParameterList.SpanStart) 810position = variableDeclaration.SpanStart;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (11)
217position = body.SpanStart; 261Debug.Assert(position == ((PropertyDeclarationSyntax)node).Initializer!.SpanStart); 312Debug.Assert(position == ((SwitchExpressionArmSyntax)node).Expression.SpanStart); 344position < node.Expression.SpanStart ? ForEachPart.In : 351ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Type.SpanStart, node.Identifier.Span.End), 361ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Variable.SpanStart, node.Variable.Span.End), 643BreakpointSpans.TryGetClosestBreakpointSpan(node, propertyDeclaration.Initializer.SpanStart, minLength, out span)) 683return BreakpointSpans.TryGetClosestBreakpointSpan(node, node.SpanStart, minLength, out span); 1412return model.GetEnclosingSymbol(node.SpanStart, cancellationToken); 1417return model.GetEnclosingSymbol(primaryCtorBase.ArgumentList.SpanStart, cancellationToken); 2696tryStatement.Catches.First().SpanStart,
ExtractMethod\CSharpMethodExtractor.cs (2)
181!methodDefinition.FindTokenOnLeftOfPosition(methodDefinition.SpanStart).IsKind(SyntaxKind.OpenBraceToken)) 187if (!originalMethodDefinition.FindTokenOnLeftOfPosition(originalMethodDefinition.SpanStart).TrailingTrivia.Any(SyntaxKind.EndOfLineTrivia))
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
160var postProcessor = new PostProcessor(semanticModel, insertionPointNode.SpanStart); 522var postProcessor = new PostProcessor(semanticModel, insertionPointNode.SpanStart);
ExtractMethod\CSharpSelectionValidator.cs (1)
330var expressionBodiedMemberBody = TextSpan.FromBounds(expressionBodiedMember.Expression.SpanStart, expressionBodiedMember.Expression.Span.End);
GenerateType\CSharpGenerateTypeService.cs (3)
183var start = nameOrMemberAccessExpression.SpanStart; 510=> semanticModel.GetEnclosingNamedType(simpleName.SpanStart, cancellationToken); 746if (await IsWithinTheImportingNamespaceAsync(document, simpleName.SpanStart, includeUsingsOrImports, cancellationToken).ConfigureAwait(false))
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
84return target.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax()?.SpanStart;
InlineHints\CSharpInlineTypeHintsService.cs (1)
121=> type.ToMinimalDisplayString(semanticModel, node.SpanStart, s_minimalTypeStyle);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
37var typeDisplayString = oldType.ToMinimalDisplayString(document.SemanticModel, expression.SpanStart);
NavigationBar\CSharpNavigationBarItemService.cs (2)
227var spanStart = declaringNode.SpanStart; 258var start = enumMember.SpanStart;
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
98var nullableContext = semanticModel.GetNullableContext(node.SpanStart);
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (3)
74var spanStart = parent.SpanStart; 88spanStart = parent.Parent!.SpanStart; 152.TakeWhile(d => d.SpanStart < directiveTrivia.SpanStart)
SignatureHelp\AttributeSignatureHelpProvider.cs (2)
97.Sort(semanticModel, attribute.SpanStart); 137var position = attribute.SpanStart;
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (9)
103.Sort(semanticModel, expression.SpanStart); 146currentSpan.Start != expression.SpanStart) 163offset = expression.SpanStart - conditionalAccessExpression.SpanStart; 173offset = expression.SpanStart - elementAccessExpression.SpanStart; 344return TextSpan.FromBounds(expression.SpanStart, openBracket.Parent.Span.End); 391(c, elementBindingExpression) => c.SpanStart < elementBindingExpression.SpanStart, elementBindingExpression)!;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
41var position = invocationExpression.SpanStart;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (4)
30document, method, invocationExpression.SpanStart, semanticModel)); 61semanticModel.LookupSymbols(throughExpression.SpanStart, name: throughSymbol?.Name).Any(static s => s is not INamedTypeSymbol) || 62(throughSymbol is not INamespaceOrTypeSymbol && semanticModel.LookupSymbols(throughExpression.SpanStart, container: throughSymbol?.ContainingType).Any(static s => s is not INamedTypeSymbol)); 66semanticModel.LookupNamespacesAndTypes(throughExpression.SpanStart, name: throughSymbol?.Name).Any(static (t, throughType) => Equals(t.GetSymbolType(), throughType), throughType));
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_DelegateType.cs (1)
24objectCreationExpression.SpanStart,
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_NormalType.cs (1)
25var position = objectCreationExpression.SpanStart;
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
93.Sort(semanticModel, baseTypeSyntax.SpanStart);
SignatureHelp\SignatureHelpUtilities.cs (1)
94=> CommonSignatureHelpUtilities.GetSignatureHelpSpan(initializer, initializer.SpanStart, s_getInitializerExpressionCloseToken);
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (4)
50if (currentSpan.Start == parenthesizedExpression.SpanStart) 76position = expression.SpanStart; 95position = expression.SpanStart; 135var inferredTypes = typeInferrer.InferTypes(semanticModel, targetExpression!.SpanStart, cancellationToken);
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
85new SnippetPlaceholder(type.ToString(), type.SpanStart),
Snippets\AbstractCSharpForLoopSnippetProvider.cs (2)
102placeholderBuilder.Add(left.ToString(), left.SpanStart); 107placeholderBuilder.Add(operand.ToString(), operand.SpanStart);
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
118arrayBuilder.Add(new SnippetPlaceholder(node.Expression.ToString(), node.Expression.SpanStart));
Snippets\CSharpForLoopSnippetProvider.cs (1)
38placeholderBuilder.Add(rightOfCondition.ToString(), rightOfCondition.SpanStart);
Snippets\CSharpLockSnippetProvider.cs (1)
31return [new SnippetPlaceholder(expression.ToString(), expression.SpanStart)];
Snippets\CSharpReversedForLoopSnippetProvider.cs (1)
44placeholderBuilder.Add(left.ToString(), left.SpanStart);
Snippets\CSharpSnippetHelpers.cs (1)
53var indentationString = GetBlockLikeIndentationString(document, block.SpanStart, syntaxFormattingOptions, cancellationToken);
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
58beforeSplitContents.Add(CreateInterpolatedStringText(content.SpanStart, CursorPosition));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
55: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.SemicolonToken.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
155if (localDeclarator.SpanStart >= argumentNode.SpanStart)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
184var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
224var startReportSpan = TextSpan.FromBounds(anonymousFunction.SpanStart, invokedExpression.SpanStart);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
127|| !possibleNullableImpactIntervalTree.HasIntervalThatOverlapsWith(currentOptionsDirective.Span.End, nullableDirectiveTrivia.SpanStart - currentOptionsDirective.Span.End)) 205positionOfFirstReducingNullableDirective = directive.SpanStart;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
52if (_ignoredSpans.HasIntervalThatContains(node.SpanStart, node.Span.Length))
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
75return firstUnreachableStatement != null && firstUnreachableStatement.SpanStart == node.SpanStart
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
219expression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
62invocationExpression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
303text.Lines.GetLineFromPosition(expression.SpanStart).LineNumber + 1 == text.Lines.GetLineFromPosition(expression.Span.End).LineNumber &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
87objectCreationExpression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
71expression.SpanStart, 111expression.SpanStart,
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
207var reservedNames = semanticModel.LookupSymbols(container.SpanStart)
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
105TextSpan.FromBounds(declaration.SpanStart, declaration.ArrowToken.Span.End));
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
55var fadeSpan = TextSpan.FromBounds(nameColon.Name.SpanStart, nameColon.ColonToken.Span.End); 81var fadeSpan = TextSpan.FromBounds(nameEquals.Name.SpanStart, nameEquals.EqualsToken.Span.End);
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
244var anonymousFunctionStart = anonymousFunction.SpanStart; 401var localEnclosingSymbol = semanticModel.GetEnclosingSymbol(localDeclaration.SpanStart, cancellationToken);
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (2)
94var position = argument.Expression.SpanStart; 102var symbols = semanticModel.LookupSymbols(argument.Expression.SpanStart, name: stringValue);
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
62if (operation.SemanticModel.TryGetSpeculativeSemanticModel(typeSyntax.SpanStart, dummyStatement, out var speculativeModel))
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (5)
256if (node.SpanStart < _localStatement.Span.End) 260if (node.Span.End >= _comparison.SpanStart) 351var localStatementStart = _localStatement.SpanStart; 352var comparisonSpanStart = _comparison.SpanStart; 359var descendentNodeSpanStart = descendentNode.SpanStart;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (5)
166var localStatementStart = localStatement.SpanStart; 167var comparisonSpanStart = comparison.SpanStart; 171var descendentNodeSpanStart = descendentNode.SpanStart; 212var descendentNodeSpanStart = descendentNode.SpanStart; 233var descendentNodeSpanStart = descendentNode.SpanStart;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
574var symbols = semanticModel.LookupSymbols(operation.Syntax.SpanStart, name: parameter.Name);
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
124var span = TextSpan.FromBounds(elements[0].Syntax.SpanStart, elements[^1].Syntax.Span.End);
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (1)
32return semanticModel.GetSpeculativeSymbolInfo(newInvocation.SpanStart, newInvocation, SpeculativeBindingOption.BindAsExpression);
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\AttributeArgumentFixer.cs (1)
32return semanticModel.GetSpeculativeSymbolInfo(newAttribute.SpanStart, newAttribute);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
415var outerIndentation = document.Text.GetLeadingWhitespaceOfLineAtPosition(fileScopedNamespace.SpanStart);
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
57var currentType = semanticModel.GetEnclosingNamedType(constructorInitializer.SpanStart, cancellationToken);
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
156if (semanticModel.SyntaxTree.IsNameOfContext(expression.SpanStart, semanticModel, cancellationToken))
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
105type.ToMinimalDisplayString(model, node.SpanStart), 106ienumerableGenericSymbol.ToMinimalDisplayString(model, node.SpanStart));
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
94edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
96edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
551var startLine = document.Text.Lines.GetLineFromPosition(GetAnchorNode(expression).SpanStart); 845var lineToConsider = text.Lines.GetLineFromPosition(expressionToReplace.SpanStart);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
99foreach (var (localDeclaration, anonymousFunction, references) in nodesFromDiagnostics.OrderByDescending(nodes => nodes.function.SpanStart))
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
56foreach (var typeArgumentList in nameofInvocation.DescendantNodes().OfType<TypeArgumentListSyntax>().OrderByDescending(t => t.SpanStart))
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
120.Where(a => a.Initializer?.ElementValues.FirstOrDefault()?.Syntax.SpanStart == diagnostic.Location.SourceSpan.Start)
src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (1)
481return (node is SwitchExpressionSyntax switchExpression) ? switchExpression.SwitchKeyword.SpanStart : node.SpanStart;
StringIndentation\CSharpStringIndentationService.cs (2)
142var holeStartLine = text.Lines.GetLineFromPosition(interpolation.SpanStart).LineNumber; 171var firstLine = text.Lines.GetLineFromPosition(expression.SpanStart);
Structure\CSharpStructureHelpers.cs (2)
383return TextSpan.FromBounds(node.SpanStart, endPos); 455var hintSpanStart = syntaxList.First().SpanStart;
Structure\Providers\CollectionExpressionStructureProvider.cs (1)
42var textSpan = TextSpan.FromBounds(node.SpanStart, end);
Structure\Providers\CompilationUnitStructureProvider.cs (2)
30externsAndUsings.Sort((node1, node2) => node1.SpanStart.CompareTo(node2.SpanStart));
Structure\Providers\DocumentationCommentStructureProvider.cs (1)
34var endPos = documentationComment.SpanStart + documentationComment.ToString().TrimEnd().Length;
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (2)
42var startLineNumber = text.Lines.GetLineFromPosition(directive.SpanStart).LineNumber + 1; 43var endLineNumber = text.Lines.GetLineFromPosition(nextDirective.SpanStart).LineNumber - 1;
Structure\Providers\InitializerExpressionStructureProvider.cs (2)
46textSpan: TextSpan.FromBounds(node.SpanStart, end), 47hintSpan: TextSpan.FromBounds(node.SpanStart, end),
Structure\Providers\NamespaceDeclarationStructureProvider.cs (1)
39.OrderBy(node => node.SpanStart)
Structure\Providers\RegionDirectiveStructureProvider.cs (1)
54textSpan: TextSpan.FromBounds(regionDirective.SpanStart, match.Span.End),
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
140.LookupSymbols(isExpression.SpanStart)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
EditAndContinue\SyntaxUtilitiesTests.cs (2)
87var leftPosition = leftRoot.DescendantNodes().OfType<LiteralExpressionSyntax>().ElementAt(2).SpanStart; // 0 within Console.WriteLine(0) 134var leftPosition = leftRoot.DescendantNodes().OfType<LiteralExpressionSyntax>().ElementAt(5).SpanStart; // 3 within Console.WriteLine(3)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests.cs (1)
621bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].SpanStart, speculatedBlock, out speculativeModel);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (236)
Semantics\BindingTests.cs (8)
3383var names = model.LookupNames(node1.SpanStart); 3391Assert.True(model.LookupSymbols(node1.SpanStart, name: "MathMin").IsEmpty); 3392Assert.Equal(1, model.LookupSymbols(node1.SpanStart, name: "MathMax").Length); 3393Assert.Equal(1, model.LookupSymbols(node1.SpanStart, name: "F1").Length); 3394Assert.True(model.LookupSymbols(node1.SpanStart, name: "F2").IsEmpty); 3395Assert.True(model.LookupSymbols(node1.SpanStart, name: "MathMax2").IsEmpty); 3396Assert.True(model.LookupSymbols(node1.SpanStart, name: "MathMax3").IsEmpty); 3398var symbols = model.LookupSymbols(node1.SpanStart);
Semantics\DelegateTypeTests.cs (1)
12111int position = syntax.SpanStart;
Semantics\ExpressionBodiedMemberTests.cs (1)
1027Assert.Equal($"System.Int32 y{i}", model.LookupSymbols(nodes[i].SpanStart, name: $"y{i}").Single().ToTestDisplayString());
Semantics\InitOnlyMemberTests.cs (1)
3147accessorDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel);
Semantics\LambdaTests.cs (9)
945invocation.SpanStart, 1126.OrderByDescending(s => s.SpanStart); 3043var lambda = (IMethodSymbol)model.GetEnclosingSymbol(contentType.SpanStart); 3050lambda = (IMethodSymbol)model.GetEnclosingSymbol(b.SpanStart); 3055Assert.Equal("void Program.method1()", model.GetEnclosingSymbol(parameterSyntax.SpanStart).ToTestDisplayString()); 3988Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(m.Body.SpanStart, m, out model)); 8086Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(m2Syntax.Body.SpanStart, newMethod, out var speculativeModel)); 8166var methodBinder = getBinder<BlockBinder>(methodModel.GetEnclosingBinder(methodSyntax.Body.SpanStart)); 8167var defaultValueBinder = getBinder<BlockBinder>(defaultValueModel.GetEnclosingBinder(defaultValue.SpanStart));
Semantics\LocalFunctionTests.cs (9)
351Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(m.Body.SpanStart, m, out model)); 407Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(m.Body.SpanStart, m, out model)); 446Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(mMethod.Body.SpanStart, mMethod, out var newModel)); 1783Assert.Empty(model.LookupNamespacesAndTypes(a.SpanStart, name: "A")); 1807model.LookupNamespacesAndTypes(clsCompliant.SpanStart, name: "CLSCompliantAttribute").Single()); 1858Assert.Empty(model.LookupNamespacesAndTypes(a.SpanStart, name: "A")); 1882model.LookupNamespacesAndTypes(clsCompliant.SpanStart, name: "CLSCompliantAttribute").Single()); 7451return tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(i => i.Identifier.ValueText == identifier).Single().SpanStart; 8740Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel));
Semantics\LookupTests.cs (1)
684var baseExprLocation = baseExprNode.SpanStart;
Semantics\NullableContextTests.cs (6)
67var classDeclPosition = syntaxTree.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single().SpanStart; 68var methodDeclPosition = syntaxTree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single().SpanStart; 102var classDecl1 = syntaxTree1.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single().SpanStart; 103var classDecl2 = syntaxTree2.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single().SpanStart; 585var actualState = tree.GetNullableContextState(syntax.SpanStart); 2230Assert.True(model.TryGetSpeculativeSemanticModel(typeOf.Type.SpanStart, type, out model, SpeculativeBindingOption.BindAsTypeOrNamespace));
Semantics\NullableReferenceTypesTests.cs (15)
65897Assert.True(model1.TryGetSpeculativeSemanticModel(function1.SpanStart, function2, out var model2)); 146460ifStatement.SpanStart, 158065var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158234var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158272Assert.True(model.LookupNames(item.SpanStart, i3.GetPublicSymbol()).Contains("Item")); 158274var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158312Assert.True(model.LookupNames(item.SpanStart, i3.GetPublicSymbol()).Contains("Item")); 158315var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158348Assert.True(model.LookupNames(item.SpanStart, t.GetPublicSymbol()).Contains("Item")); 158350var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158482Assert.True(model.LookupNames(item.SpanStart, i3.GetPublicSymbol()).Contains("Get")); 158484var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Get"); 158526var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158570var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158607var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item");
Semantics\OperatorTests.cs (2)
7332var binder = model.GetEnclosingBinder(methodBody.SpanStart); 8815var binder = model.GetEnclosingBinder(methodBody.SpanStart);
Semantics\QueryTests.cs (2)
3515bool success = model.TryGetSpeculativeSemanticModel(methodM.Body.SpanStart, queryStatement, out speculativeModel); 3602bool success = model.TryGetSpeculativeSemanticModel(methodM.Body.SpanStart, queryStatement, out speculativeModel);
Semantics\RecordStructTests.cs (13)
2601Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2602Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2603Assert.Contains("X", model.LookupNames(x.SpanStart)); 2636Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2637Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2638Assert.Contains("X", model.LookupNames(x.SpanStart)); 2670Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2671Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2672Assert.Contains("X", model.LookupNames(x.SpanStart)); 2705Assert.Equal("lambda expression", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString()); 2706Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); 2707Assert.Contains("X", model.LookupNames(x.SpanStart)); 10790Assert.False(model.TryGetSpeculativeSemanticModel(baseWithoutParens.SpanStart + 2, speculativeBase, out _));
Semantics\SemanticErrorTests.cs (1)
3332var callPosition = callExpr.SpanStart;
Semantics\SuppressAccessibilityChecksTests.cs (1)
222accessorDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel);
Semantics\TopLevelStatementsTests.cs (162)
197Assert.Contains(refSymbol.Name, model1.LookupNames(localRef.SpanStart)); 198Assert.Contains(refSymbol, model1.LookupSymbols(localRef.SpanStart)); 199Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 240Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 241Assert.Contains(declSymbol, model1.LookupSymbols(localDecl.SpanStart)); 242Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 325Assert.DoesNotContain(name, model1.LookupNames(localRef.SpanStart)); 326Assert.Empty(model1.LookupSymbols(localRef.SpanStart).Where(s => s.Name == name)); 327Assert.Empty(model1.LookupSymbols(localRef.SpanStart, name: name)); 363Assert.Contains(declSymbol.Name, model2.LookupNames(localDecl.SpanStart)); 364Assert.Contains(declSymbol, model2.LookupSymbols(localDecl.SpanStart)); 365Assert.Same(declSymbol, model2.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 484Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 485Assert.Contains(declSymbol, model1.LookupSymbols(localDecl.SpanStart)); 486Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 493Assert.Contains(declSymbol.Name, model1.LookupNames(localFuncRef.SpanStart)); 494Assert.Contains(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart)); 495Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 504Assert.DoesNotContain(name, model2.LookupNames(localRef.SpanStart)); 505Assert.Empty(model2.LookupSymbols(localRef.SpanStart).Where(s => s.Name == name)); 506Assert.Empty(model2.LookupSymbols(localRef.SpanStart, name: name)); 536Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 537Assert.Contains(declSymbol, model1.LookupSymbols(localDecl.SpanStart)); 538Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 547Assert.Contains(declSymbol.Name, model1.LookupNames(localRef.SpanStart)); 548Assert.Contains(declSymbol, model1.LookupSymbols(localRef.SpanStart)); 549Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 576Assert.Contains(declSymbol.Name, model1.LookupNames(localDecl.SpanStart)); 577Assert.Contains(declSymbol, model1.LookupSymbols(localDecl.SpanStart)); 578Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 585Assert.Contains(declSymbol.Name, model1.LookupNames(localFuncRef.SpanStart)); 586Assert.Contains(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart)); 587Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 594Assert.Contains(refSymbol.Name, model1.LookupNames(localRef.SpanStart)); 595Assert.Contains(refSymbol, model1.LookupSymbols(localRef.SpanStart)); 596Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 1688var names = model1.LookupNames(localDecl.SpanStart); 1690var symbols = model1.LookupSymbols(localDecl.SpanStart); 1692Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1697Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 1699symbols = model1.LookupNamespacesAndTypes(localDecl.SpanStart); 1702Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 1720names = model.LookupNames(nameRef.SpanStart); 1724symbols = model.LookupSymbols(nameRef.SpanStart); 1726Assert.Empty(model.LookupSymbols(nameRef.SpanStart, name: getHashCode.Name)); 1730Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1735Assert.DoesNotContain(getHashCode.Name, model.LookupNames(nameRef.SpanStart)); 1751Assert.DoesNotContain(getHashCode.Name, model.LookupNames(nameRef.SpanStart)); 1761var names = model.LookupNames(nameRef.SpanStart); 1764var symbols = model.LookupSymbols(nameRef.SpanStart); 1767Assert.Same(declSymbol, model.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1769symbols = model.LookupNamespacesAndTypes(nameRef.SpanStart); 1772Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 1861var names = model1.LookupNames(localDecl.SpanStart); 1863var symbols = model1.LookupSymbols(localDecl.SpanStart); 1865Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1870Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 1872symbols = model1.LookupNamespacesAndTypes(localDecl.SpanStart); 1875Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 1888names = model2.LookupNames(nameRef.SpanStart); 1892symbols = model2.LookupSymbols(nameRef.SpanStart); 1894Assert.Empty(model2.LookupSymbols(nameRef.SpanStart, name: getHashCode.Name)); 1898Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1903Assert.DoesNotContain(getHashCode.Name, model2.LookupNames(nameRef.SpanStart)); 1919Assert.DoesNotContain(getHashCode.Name, model2.LookupNames(nameRef.SpanStart)); 1929var names = model2.LookupNames(nameRef.SpanStart); 1932var symbols = model2.LookupSymbols(nameRef.SpanStart); 1935Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1937symbols = model2.LookupNamespacesAndTypes(nameRef.SpanStart); 1940Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2087var names = model1.LookupNames(localDecl.SpanStart); 2088var symbols = model1.LookupSymbols(localDecl.SpanStart); 2093Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 2095symbols = model1.LookupNamespacesAndTypes(localDecl.SpanStart); 2098Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 2106names = model1.LookupNames(nameRef.SpanStart); 2109symbols = model1.LookupSymbols(nameRef.SpanStart); 2113Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2142var names = model2.LookupNames(nameRef.SpanStart); 2145var symbols = model2.LookupSymbols(nameRef.SpanStart); 2148Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2150symbols = model2.LookupNamespacesAndTypes(nameRef.SpanStart); 2153Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2251var names = model1.LookupNames(localDecl.SpanStart); 2252var symbols = model1.LookupSymbols(localDecl.SpanStart); 2257Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 2259symbols = model1.LookupNamespacesAndTypes(localDecl.SpanStart); 2262Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 2272names = model2.LookupNames(nameRef.SpanStart); 2275symbols = model2.LookupSymbols(nameRef.SpanStart); 2279Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2308var names = model2.LookupNames(nameRef.SpanStart); 2311var symbols = model2.LookupSymbols(nameRef.SpanStart); 2314Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2316symbols = model2.LookupNamespacesAndTypes(nameRef.SpanStart); 2319Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2430var names = model1.LookupNames(labelDecl.SpanStart); 2431var symbols = model1.LookupSymbols(labelDecl.SpanStart); 2436Assert.Same(testType, model1.LookupSymbols(labelDecl.SpanStart, name: "Test").Single()); 2438symbols = model1.LookupNamespacesAndTypes(labelDecl.SpanStart); 2441Assert.Same(testType, model1.LookupNamespacesAndTypes(labelDecl.SpanStart, name: "Test").Single()); 2443Assert.Same(declSymbol, model1.LookupLabels(labelDecl.SpanStart).Single()); 2444Assert.Same(declSymbol, model1.LookupLabels(labelDecl.SpanStart, name: "Test").Single()); 2452names = model1.LookupNames(nameRef.SpanStart); 2455symbols = model1.LookupSymbols(nameRef.SpanStart); 2459Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2460Assert.Empty(model1.LookupLabels(nameRef.SpanStart)); 2461Assert.Empty(model1.LookupLabels(nameRef.SpanStart, name: "Test")); 2467names = model1.LookupNames(nameRef.SpanStart); 2470symbols = model1.LookupSymbols(nameRef.SpanStart); 2474Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2475Assert.Same(declSymbol, model1.LookupLabels(nameRef.SpanStart).Single()); 2476Assert.Same(declSymbol, model1.LookupLabels(nameRef.SpanStart, name: "Test").Single()); 2505var names = model2.LookupNames(nameRef.SpanStart); 2508var symbols = model2.LookupSymbols(nameRef.SpanStart); 2511Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2513symbols = model2.LookupNamespacesAndTypes(nameRef.SpanStart); 2516Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2518Assert.Empty(model2.LookupLabels(nameRef.SpanStart)); 2519Assert.Empty(model2.LookupLabels(nameRef.SpanStart, name: "Test")); 2921Assert.NotEmpty(model1.LookupNamespacesAndTypes(nameRef.SpanStart, name: "alias1")); 2922Assert.Empty(model1.LookupNamespacesAndTypes(nameRef.SpanStart, name: "alias2")); 2943Assert.Empty(model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "alias1")); 2944Assert.NotEmpty(model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "alias2")); 3947var names = model.LookupNames(nameRef.SpanStart); 3950var symbols = model.LookupSymbols(nameRef.SpanStart); 3953Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 3961names = model.LookupNames(nameRef.SpanStart); 3964symbols = model.LookupSymbols(nameRef.SpanStart); 3967Assert.Same(parameter, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 3969symbols = model.LookupNamespacesAndTypes(nameRef.SpanStart); 3972Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4001var names = model.LookupNames(nameRef.SpanStart); 4004var symbols = model.LookupSymbols(nameRef.SpanStart); 4007Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4009symbols = model.LookupNamespacesAndTypes(nameRef.SpanStart); 4012Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4096var names = model.LookupNames(nameRef.SpanStart); 4099var symbols = model.LookupSymbols(nameRef.SpanStart); 4102Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4131var names = model.LookupNames(nameRef.SpanStart); 4134var symbols = model.LookupSymbols(nameRef.SpanStart); 4137Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4139symbols = model.LookupNamespacesAndTypes(nameRef.SpanStart); 4142Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 6041Assert.Contains(declSymbol.Name, model1.LookupNames(localRef.SpanStart)); 6042Assert.Contains(declSymbol, model1.LookupSymbols(localRef.SpanStart)); 6043Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 6240Assert.Empty(semanticModel.LookupSymbols(invocation.SpanStart, container: a, name: "M")); 6246Assert.NotEmpty(semanticModel.LookupSymbols(invocation.SpanStart, container: a, name: "M")); 6282Assert.Same(x, semanticModel.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6284Assert.Same(x, semanticModel.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6327Assert.Same(xDecl, semanticModel1.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6329Assert.Same(xRef, semanticModel1.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6378Assert.Same(xDecl, semanticModel1.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6384Assert.Same(xRef, semanticModel2.LookupSymbols(localRef.SpanStart, name: "x").Single()); 8582symbols = model.LookupSymbols(invocations[0].SpanStart, name: "args"); 8587symbols = model.LookupSymbols(invocations[1].SpanStart, name: "args"); 8592symbols = model.LookupSymbols(invocations[2].SpanStart, name: "args"); 8653for (int i = id.SpanStart; i <= id.Span.End; i++) 8675for (int i = id.SpanStart; i <= id.Span.End; i++) 8697for (int i = id.SpanStart; i <= id.Span.End; i++)
Semantics\UnsafeTests.cs (2)
5200var binder = ((CSharpSemanticModel)model).GetEnclosingBinder(methodBody.SpanStart); 7297model.GetSpeculativeTypeInfo(syntax.SpanStart, SyntaxFactory.ParseTypeName("S*"), SpeculativeBindingOption.BindAsTypeOrNamespace);
Semantics\UsingStatementTests.cs (2)
75var lookupSymbol = model.LookupSymbols(memberAccessExpression.SpanStart, name: declaredLocal.Name).Single(); 1896var actualSymbol = model.LookupSymbols(usingStatements[index - 1].SpanStart, name: symbol.Name).Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (249)
Compilation\GetSemanticInfoTests.cs (10)
1135Assert.NotEqual(0, root.SpanStart); 1712var lookupSymbols = model.LookupSymbols(exprSyntaxToBind.SpanStart, name: "x"); 1747var lookupSymbols = model.LookupSymbols(exprSyntaxToBind.SpanStart, name: "value"); 2229return model.LookupSymbols(exprSyntaxToBind.SpanStart, typeParameter, memberName); 4069var info2 = model.GetSpeculativeSymbolInfo(originalSyntax.SpanStart, speculativeSyntax, SpeculativeBindingOption.BindAsExpression); 4214var info = model.GetSpeculativeSymbolInfo(syntax.SpanStart, syntax, SpeculativeBindingOption.BindAsTypeOrNamespace); 4244var info = model.GetSpeculativeTypeInfo(syntax.SpanStart, syntax, SpeculativeBindingOption.BindAsTypeOrNamespace); 4274var info = model.GetSpeculativeTypeInfo(syntax.SpanStart, syntax, SpeculativeBindingOption.BindAsTypeOrNamespace); 4687int position = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First().SpanStart; 4732int position = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First().SpanStart;
Compilation\SemanticModelAPITests.cs (65)
49model.TryGetSpeculativeSemanticModelForMethodBody(indexerAccess.SpanStart, m2, out var speculativeModel); 730var symbolInfo = model.GetSpeculativeSymbolInfo(xdecl.SpanStart, speculate, SpeculativeBindingOption.BindAsTypeOrNamespace); 1365var info = model.GetSpeculativeSymbolInfo(oldSyntax.SpanStart, newSyntax); 1422int position = varDecl.Initializer.SpanStart; 1465bool success = model.TryGetSpeculativeSemanticModel(equalsValue.SpanStart, newEqualsValue, out speculativeModel); 1480model.TryGetSpeculativeSemanticModel(equalsValue.SpanStart, newEqualsValue, out speculativeModel); 1514bool success = model.TryGetSpeculativeSemanticModel(equalsValue.SpanStart, newEqualsValue, out speculativeModel); 1562bool success = model.TryGetSpeculativeSemanticModel(equalsValue.SpanStart, newEqualsValue, out speculativeModel); 1602bool success = model.TryGetSpeculativeSemanticModel(equalsValue.SpanStart, newEqualsValue, out speculativeModel); 1681int position = expressionBody.SpanStart; 1781bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel); 1835bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel); 1848success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel); 1882bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].SpanStart, labeledStatement, out statModel); 1995bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel); 2028var position = oldSyntax.SpanStart; 2034bool success = model.TryGetSpeculativeSemanticModel(oldSyntax.SpanStart, 2048thisSyntax.SpanStart, 2077bool success = parentModel.TryGetSpeculativeSemanticModel(oldSyntax.SpanStart, newSyntax, out speculativeModel); 2094success = parentModel.TryGetSpeculativeSemanticModel(oldSyntax.SpanStart, newSyntax, out speculativeModel); 2110success = parentModel.TryGetSpeculativeSemanticModel(oldSyntax.SpanStart, newSyntax, out speculativeModel); 2146bool success = parentModel.TryGetSpeculativeSemanticModel(oldSyntax.SpanStart, newSyntax, out speculativeModel); 2181Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(statement.SpanStart, statement: null, speculativeModel: out speculativeModel)); 2182Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(statement.SpanStart, constructorInitializer: (ConstructorInitializerSyntax)null, speculativeModel: out speculativeModel)); 2183Assert.Throws<ArgumentNullException>(() => model.TryGetSpeculativeSemanticModel(statement.SpanStart, attribute: null, speculativeModel: out speculativeModel)); 2186Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(statement.SpanStart, statement: statement, speculativeModel: out speculativeModel)); 2187Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(ctorInitializer.SpanStart, constructorInitializer: ctorInitializer, speculativeModel: out speculativeModel)); 2188Assert.Throws<ArgumentException>(() => model.TryGetSpeculativeSemanticModel(attribute.SpanStart, attribute: attribute, speculativeModel: out speculativeModel)); 2192model.TryGetSpeculativeSemanticModel(statement.SpanStart, speculatedStatement, speculativeModel: out speculativeModel); 2193Assert.Throws<InvalidOperationException>(() => speculativeModel.TryGetSpeculativeSemanticModel(speculatedStatement.SpanStart, speculatedStatement, speculativeModel: out speculativeModel)); 2227var success = model.TryGetSpeculativeSemanticModel(statement.SpanStart, speculatedStatement, out speculativeModel); 2235Assert.Throws<InvalidOperationException>(() => speculativeModel.TryGetSpeculativeSemanticModel(speculatedStatement.SpanStart, newSpeculatedStatement, out newModel)); 2239Assert.Throws<InvalidOperationException>(() => speculativeModel.TryGetSpeculativeSemanticModel(speculatedStatement.SpanStart, newSpeculatedStatement, out newModel)); 2271var binder = ((CSharpSemanticModel)speculativeModel).GetEnclosingBinder(initializer.SpanStart); 2320var success = model.TryGetSpeculativeSemanticModel(statementSyntax.SpanStart, speculativeSyntax, out speculativeModel); 2356var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2452var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2494var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2539var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2571var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2586success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2600success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2643var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2779var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].SpanStart, speculatedMethod, out speculativeModel); 2836TestGetSpeculativeSemanticModelForTypeSyntax_Common(model, baseList.SpanStart, 2841model.TryGetSpeculativeSemanticModel(baseList.SpanStart, speculatedTypeExpression, out speculativeModel); 2867TestGetSpeculativeSemanticModelForTypeSyntax_Common(model, fieldDecl.SpanStart, 2870TestGetSpeculativeSemanticModelForTypeSyntax_Common(model, methodDecl.ReturnType.SpanStart, 2873TestGetSpeculativeSemanticModelForTypeSyntax_Common(model, methodDecl.ParameterList.Parameters.First().SpanStart, 2898var success = model.TryGetSpeculativeSemanticModel(fieldDecl.SpanStart, speculatedAliasName, out speculativeModel); 2932var success = model.TryGetSpeculativeSemanticModel(cref.SpanStart, speculatedCref, out speculativeModel); 2942symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 2972var success = model.TryGetSpeculativeSemanticModel(cref.SpanStart, speculatedCref, out speculativeModel); 2982symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 3017var success = model.TryGetSpeculativeSemanticModel(cref.SpanStart, speculatedCref, out speculativeModel); 3037symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 3045success = model.TryGetSpeculativeSemanticModel(cref.SpanStart, speculatedCref, out speculativeModel); 3065symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 3094var success = model.TryGetSpeculativeSemanticModel(typeDecl.SpanStart, speculatedCref, out speculativeModel); 3097success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.SpanStart, speculatedCref, out speculativeModel); 3101var symbolInfo = model.GetSpeculativeSymbolInfo(methodDecl.Body.SpanStart, speculatedCref); 3621var speculativeSymbolInfo = semanticModel.GetSpeculativeSymbolInfo(crefSyntax.SpanStart, speculatedName, SpeculativeBindingOption.BindAsExpression); 3789Assert.True(model.TryGetSpeculativeSemanticModel(localFunctionBody.Block!.Statements[0].SpanStart + 1, @return, out var specModel)); 3848var symbol = model.LookupSymbols(syntax.SpanStart, name: "Alias").Single(); 4430Assert.True(model.TryGetSpeculativeSemanticModel(ifStatement.SpanStart, replacementIfStatement, out var specModel));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (26)
1058var symbols = model.LookupSymbols(memberDecl.SpanStart, null, "DateTime"); 1088var symbols = model.LookupSymbols(methodDecl.SpanStart, null, "B"); 1092symbols = model.LookupSymbols(localDecl.SpanStart, null, "B"); 1127int positionInB = someMemberInB.SpanStart; 1135int positionInC = someMemberInC.SpanStart; 1178var symbols = model.LookupNamespacesAndTypes(localDecl.SpanStart, name: "B"); 1213int positionInC = someMemberInC.SpanStart; 1224var namesInM = model.LookupNames(methodM.Body.SpanStart); 1250var namesInA = model.LookupNames(someMemberInA.SpanStart); 1284var namesInC = model.LookupNames(someMemberInC.SpanStart); 1335var names = model.LookupNames(methodDecl.SpanStart, paramSymbol.Type); 1347names = model.LookupNames(methodDecl.SpanStart, paramSymbol.Type); 1383int positionInC = someMemberInC.SpanStart; 1438var symbols = model.LookupSymbols(methodDecl.SpanStart, paramSymbol.Type); 1452symbols = model.LookupSymbols(methodDecl.SpanStart, paramSymbol.Type); 1598var symbols = model.LookupNamespacesAndTypes(someMemberInC.SpanStart); 1631int position = someMemberInC.SpanStart; 1670var symbols = model.LookupStaticMembers(someMemberInC.SpanStart, container: symbolC); 1716int statementStart = statement.SpanStart; 2056var symbols = model.LookupNamespacesAndTypes(someStatementInM.SpanStart, name: ""); 4001var typeofArgPosition = typeofArgSyntax.SpanStart; 4446var lookupSymbols = model.LookupSymbols(conversionDecl.DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, name: WellKnownMemberNames.ImplicitConversionName); 4477var lookupSymbols = model.LookupSymbols(conversionDecl.DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, name: WellKnownMemberNames.ExplicitConversionName); 4508var lookupSymbols = model.LookupSymbols(operatorDecl.DescendantNodes().OfType<ReturnStatementSyntax>().Single().SpanStart, name: WellKnownMemberNames.AdditionOperatorName); 5177var symbols = model.LookupStaticMembers(methodDeclM.Body.SpanStart); 5207var symbols = model.LookupStaticMembers(node.SpanStart);
Compilation\SemanticModelGetSemanticInfoTests.cs (11)
1120symbols = model.LookupSymbols(expr.SpanStart, container: null, name: "F", includeReducedExtensionMethods: true); 1124symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1155symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1183symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1213symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1239symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1267symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1294symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1321symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1365symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true); 1401symbols = model.LookupSymbols(expr.SpanStart, container: type, name: "F", includeReducedExtensionMethods: true);
DeclarationTests.cs (1)
918var token = _countedSyntaxTree.GetCompilationUnitRoot(cancellationToken).FindToken(nodeInUnderlying.SpanStart);
DocumentationComments\CrefTests.cs (8)
6053var members = model.LookupSymbols(typeParameterSyntax.SpanStart, (ITypeSymbol)typeParameterSymbol); 6077var members = model.LookupSymbols(methodNameSyntax.SpanStart, ((IMethodSymbol)methodSymbol).ReturnType); 6330var crefPosition = cref.SpanStart; 6331var crefReturnTypePosition = crefReturnType.SpanStart; 6332var crefParameterTypePosition = crefParameterType.SpanStart; 6437Assert.Equal(0, model.LookupSymbols(syntax.SpanStart, derivedInterface).Length); 6475Assert.Equal(0, model.LookupSymbols(syntax.SpanStart, symbol).Length); 6677Assert.Empty(model.LookupSymbols(name.SpanStart, typeParameter, "GetAwaiter"));
SymbolDisplay\SymbolDisplayTests.cs (10)
6063int position = methodDecl.Body.SpanStart; 6075position = methodDecl.Body.SpanStart; 6848declarator.SpanStart, 6881declarator.SpanStart, 6893declarator.SpanStart, 6926declarator.SpanStart, 6940declarator.SpanStart, 7913symbol.ToMinimalDisplayParts(model, variable.SpanStart), 8008symbol.ToMinimalDisplayParts(model, constructor.SpanStart, format), 8068symbol.ToMinimalDisplayParts(model, constructor.SpanStart, format),
Symbols\CheckedUserDefinedOperatorsTests.cs (16)
7219Assert.Equal("System.Int64 C0.op_CheckedExplicit(C0 x)", model.ClassifyConversion(xNode.SpanStart, xNode, int64, isExplicitInSource: false).Method.ToTestDisplayString()); 7220Assert.Equal("System.Int64 C0.op_CheckedExplicit(C0 x)", model.ClassifyConversion(xNode.SpanStart, xNode, int64, isExplicitInSource: true).Method.ToTestDisplayString()); 7222Assert.Equal("System.Int64 C0.op_CheckedExplicit(C0 x)", model.ClassifyConversion(yNode.SpanStart, yNode, int64, isExplicitInSource: false).Method.ToTestDisplayString()); 7223Assert.Equal("System.Int64 C0.op_CheckedExplicit(C0 x)", model.ClassifyConversion(yNode.SpanStart, yNode, int64, isExplicitInSource: true).Method.ToTestDisplayString()); 7291Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(xNode.SpanStart, xNode, int64, isExplicitInSource: false).Method.ToTestDisplayString()); 7292Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(xNode.SpanStart, xNode, int64, isExplicitInSource: true).Method.ToTestDisplayString()); 7293Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(yNode.SpanStart, yNode, int64, isExplicitInSource: false).Method.ToTestDisplayString()); 7294Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(yNode.SpanStart, yNode, int64, isExplicitInSource: true).Method.ToTestDisplayString()); 7362Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(xNode.SpanStart, xNode, int64, isExplicitInSource: false).Method.ToTestDisplayString()); 7363Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(xNode.SpanStart, xNode, int64, isExplicitInSource: true).Method.ToTestDisplayString()); 7365Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(yNode.SpanStart, yNode, int64, isExplicitInSource: false).Method.ToTestDisplayString()); 7366Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.ClassifyConversion(yNode.SpanStart, yNode, int64, isExplicitInSource: true).Method.ToTestDisplayString()); 7435Assert.Equal("C0 C0.op_CheckedUnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(xNode.SpanStart, xNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 7436Assert.Equal("C0 C0.op_CheckedUnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(yNode.SpanStart, yNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 7499Assert.Equal("C0 C0.op_UnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(xNode.SpanStart, xNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 7500Assert.Equal("C0 C0.op_UnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(yNode.SpanStart, yNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString());
Symbols\DestructorTests.cs (1)
420var lookupSymbols = model.LookupSymbols(finalizeSyntax.SpanStart, name: WellKnownMemberNames.DestructorName);
Symbols\ExtensionMethodTests.cs (2)
2955memberAccess.SpanStart, 2963memberAccess.SpanStart,
Symbols\Source\BaseClassTests.cs (2)
273int positionInA = someMemberInA.SpanStart; 310int positionInA = someMemberInA.SpanStart;
Symbols\Source\NullablePublicAPITests.cs (42)
1169Assert.True(syntaxContext.SemanticModel.TryGetSpeculativeSemanticModel(syntaxContext.Node.SpanStart, newSource, out var specModel)); 1376verifySpeculativeModel(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1379verifySpeculativeModel(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1382verifySpeculativeModel(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1385verifySpeculativeModel(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1388verifySpeculativeModel(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1391verifySpeculativeModel(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1403var referenceTypeInfo = speculativeModel.GetSpeculativeTypeInfo(whenTrue.SpanStart, newReference, SpeculativeBindingOption.BindAsExpression); 1405var coalesceTypeInfo = speculativeModel.GetSpeculativeTypeInfo(whenTrue.SpanStart, newCoalesce, SpeculativeBindingOption.BindAsExpression); 1410referenceTypeInfo = speculativeModel.GetSpeculativeTypeInfo(whenFalse.SpanStart, newReference, SpeculativeBindingOption.BindAsExpression); 1413coalesceTypeInfo = speculativeModel.GetSpeculativeTypeInfo(whenFalse.SpanStart, newCoalesce, SpeculativeBindingOption.BindAsExpression); 1444Assert.True(model.TryGetSpeculativeSemanticModel(returnStatement.SpanStart, newSource, out var specModel)); 1520verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1521verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1523verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1524verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1526verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1527verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1576verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1577verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1579verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1580verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1582verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1583verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 2138Assert.True(model.TryGetSpeculativeSemanticModel(s2Assignment.SpanStart, newDeclaration, out var specModel)); 2142Assert.True(model.TryGetSpeculativeSemanticModel(lastDeclaration.SpanStart, newDeclaration, out specModel)); 3781Assert.True(model.TryGetSpeculativeSemanticModel(lambda.Body.SpanStart, newStatement, out var speculativeModel)); 4066Assert.True(model.TryGetSpeculativeSemanticModel(localFunction.SpanStart, speculativeAttribute, out var speculativeModel)); 4071Assert.True(model.TryGetSpeculativeSemanticModel(localFunction.ParameterList.Parameters[0].Default.SpanStart, speculativeInitializer, out speculativeModel)); 4214Assert.True(model.TryGetSpeculativeSemanticModel(attributeUsage.SpanStart, newAttributeUsage, out var specModel)); 4244model.TryGetSpeculativeSemanticModel(typeOf.Type.SpanStart, type, out model, SpeculativeBindingOption.BindAsTypeOrNamespace); 4368Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4396Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4426Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4456Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4486Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4518Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(type.SpanStart, methodDeclaration, out var speculativeModel)); 4551Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(type.SpanStart, methodDeclaration, out var speculativeModel)); 4579Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, arrow, out var speculativeModel)); 4609Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, arrow, out var speculativeModel)); 4640Assert.True(model.TryGetSpeculativeSemanticModel(initializer.SpanStart, newInitializer, out var speculativeModel)); 4673Assert.True(model.TryGetSpeculativeSemanticModel(initializer.SpanStart, newInitializer, out var speculativeModel));
Symbols\Source\UsingAliasTests.cs (10)
312var symbolInfo = model.GetSpeculativeSymbolInfo(base2.SpanStart, base2, SpeculativeBindingOption.BindAsTypeOrNamespace); 318symbolInfo = model.GetSpeculativeSymbolInfo(base3.SpanStart, base3, SpeculativeBindingOption.BindAsTypeOrNamespace); 324symbolInfo = model.GetSpeculativeSymbolInfo(base4.SpanStart, base4, SpeculativeBindingOption.BindAsTypeOrNamespace); 358var symbolInfo = model.GetSpeculativeSymbolInfo(base2.SpanStart, base2, SpeculativeBindingOption.BindAsTypeOrNamespace); 364symbolInfo = model.GetSpeculativeSymbolInfo(base3.SpanStart, base3, SpeculativeBindingOption.BindAsTypeOrNamespace); 370symbolInfo = model.GetSpeculativeSymbolInfo(base4.SpanStart, base4, SpeculativeBindingOption.BindAsTypeOrNamespace); 448var names = model.LookupNames(root.Members[0].SpanStart); 467var names = model.LookupNames(root.Members[0].SpanStart); 486var symbols = model.LookupSymbols(root.Members[0].SpanStart, name: "O"); 507var symbols = model.LookupSymbols(root.Members[0].SpanStart, name: "O");
Symbols\StaticAbstractMembersInInterfacesTests.cs (45)
8466Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8467Assert.Contains("void I1.M01()", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 8468Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8469Assert.Contains("void I1.M01()", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 8471Assert.Equal("void I1.M01()", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 8472Assert.Contains("void I1.M01()", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 8473Assert.Equal("void I1.M01()", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 8474Assert.Contains("void I1.M01()", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 8476Assert.Contains("M01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 13192Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13193Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13194Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13195Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13197Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13198Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13199Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13200Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13202Assert.Contains("P01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 13278Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13279Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13280Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13281Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13283Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13284Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13285Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13286Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13288Assert.Contains("P01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 13400Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13401Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13402Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13403Assert.Contains("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 13405Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13406Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13407Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13408Assert.Contains("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 13410Assert.Contains("P01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol())); 14110Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14111Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14112Assert.Contains("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 14113Assert.Contains("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0]).ToTestDisplayStrings()); 14115Assert.Equal("event System.Action I1.E01", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14116Assert.Equal("event System.Action I1.E01", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14117Assert.Contains("event System.Action I1.E01", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 14118Assert.Contains("event System.Action I1.E01", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()).ToTestDisplayStrings()); 14120Assert.Contains("E01", model.LookupNames(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol()));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Syntax\LambdaUtilitiesTests.cs (2)
58Assert.Equal("C", model.GetEnclosingSymbol(methodDef.SpanStart).ToTestDisplayString()); 60Assert.Equal("void C.M()", model.GetEnclosingSymbol(methodDef.Body.SpanStart).ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
SemanticModelTestBase.cs (2)
23return GetSyntaxNodeForBinding(GetSyntaxNodeList(tree)).SpanStart; 103return model.GetSpeculativeSymbolInfo(constructorInitializer.SpanStart, constructorInitializer);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (3)
CodeGen\WinRTCollectionTests.cs (3)
7433Assert.True(model.LookupNames(add.SpanStart, jsonObjType).Contains("Add")); 7434Assert.True(model.LookupSymbols(add.SpanStart, jsonObjType, "Add").Contains(addMethod)); 7435Assert.True(model.LookupSymbols(add.SpanStart, jsonObjType).Contains(addMethod));
Microsoft.CodeAnalysis.CSharp.Workspaces (57)
Recommendations\CSharpRecommendationServiceRunner.cs (9)
293alias.SpanStart, 523return parameterReference.Span.Start >= containingStaticFunction.SpanStart; 543return new RecommendedSymbols(_context.SemanticModel.LookupSymbols(position: name.SpanStart, container: symbol)); 549position: name.SpanStart, 589var reinterpretedBinding = semanticModel.GetSpeculativeSymbolInfo(identifier.SpanStart, identifier, SpeculativeBindingOption.BindAsTypeOrNamespace); 717reinterpretedBinding = semanticModel.GetSpeculativeSymbolInfo(identifier.SpanStart, identifier, SpeculativeBindingOption.BindAsExpression); 729reinterpretedBinding = semanticModel.GetSpeculativeSymbolInfo(identifier.SpanStart, identifier, SpeculativeBindingOption.BindAsTypeOrNamespace); 781!_context.SemanticModel.IsEventUsableAsField(originalExpression.SpanStart, ev)) 839var symbols = GetMemberSymbols(containerSymbol, position: originalExpression.SpanStart, excludeInstance, useBaseReferenceAccessibility, unwrapNullable, isForDereference);
Rename\CSharpRenameRewriterLanguageService.cs (1)
1275var position = nodeToSpeculate.SpanStart;
SemanticModelReuse\CSharpSemanticModelReuseLanguageService.cs (2)
60previousSemanticModel.TryGetSpeculativeSemanticModelForMethodBody(previousBaseMethod.Body.SpanStart, currentBaseMethod, out var speculativeModel)) 68previousSemanticModel.TryGetSpeculativeSemanticModelForMethodBody(previousAccessorDeclaration.Body.SpanStart, currentAccessorDeclaration, out speculativeModel))
Simplification\CSharpSimplificationService.Expander.cs (4)
673_semanticModel.SyntaxTree.IsNameOfContext(originalSimpleName.SpanStart, _semanticModel, _cancellationToken)) 691if (!Equals(_semanticModel.GetEnclosingNamedType(originalSimpleName.SpanStart, _cancellationToken), symbol.ContainingType)) 1077var speculationPosition = originalNode.SpanStart; 1081var binding = _semanticModel.GetSpeculativeSymbolInfo(originalNode.SpanStart, expression, SpeculativeBindingOption.BindAsExpression);
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
116node.SpanStart,
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (6)
123var aliasTypeInfo = semanticModel.GetSpeculativeAliasInfo(node.SpanStart, aliasIdentifier, SpeculativeBindingOption.BindAsTypeOrNamespace); 226var scopes = model.GetImportScopes(firstMember.SpanStart, cancellationToken); 284var symbolInfo = semanticModel.GetSpeculativeSymbolInfo(node.SpanStart, aliasIdentifier, SpeculativeBindingOption.BindAsExpression); 289var typeInfo = semanticModel.GetSpeculativeTypeInfo(node.SpanStart, aliasIdentifier, SpeculativeBindingOption.BindAsExpression); 297var boundSymbols = semanticModel.LookupNamespacesAndTypes(node.SpanStart, name: aliasName); 408var symbols = semanticModel.LookupSymbols(expression.SpanStart, name: identifierName.Identifier.ValueText);
Simplification\Simplifiers\ExpressionSimplifier.cs (5)
232? semanticModel.LookupSymbols(memberAccess.SpanStart, name: memberAccess.Name.Identifier.ValueText) 235? semanticModel.LookupNamespacesAndTypes(memberAccess.SpanStart, name: memberAccess.Name.Identifier.ValueText) 347var enclosingNamedType = semanticModel.GetEnclosingNamedType(memberAccess.SpanStart, cancellationToken); 370if (ancestorInvocation?.SpanStart == memberAccess.SpanStart)
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (1)
89var newSymbol = semanticModel.GetSpeculativeSymbolInfo(crefSyntax.SpanStart, replacement, speculativeBindingOption).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
72if (conditionalDirectives.First().SpanStart <= block.OpenBraceToken.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
334var potentialType = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
125return semanticModel.LookupSymbols(expr.SpanStart, container: symbol, name: name, includeReducedExtensionMethods: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
573if (!textSpan.Contains(directives[0].SpanStart) || 574!textSpan.Contains(directives.Last().SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
75if (trivia.Span.End == currentParent.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
961var member = GetContainingMemberDeclaration(node, node.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
118var position = originalNode.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
106var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (1)
119.OrderBy(n => n.SpanStart).ToList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
42var start = usings.First().SpanStart; 51var start = rootUsings.First().SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (6)
359return syntaxTree.IsLocalFunctionDeclarationContext(token.Parent.SpanStart, validModifiers, cancellationToken); 882if (firstConstructorConstraint == null || firstConstructorConstraint.SpanStart > token.Span.End) 1372return IsAtStartOfPattern(syntaxTree, parenthesizedExpression.GetFirstToken().GetPreviousToken(), parenthesizedExpression.SpanStart); 1564=> node.FindTokenOnLeftOfPosition(node.SpanStart); 2896var tokenBeforeName = syntaxTree.FindTokenOnLeftOfPosition(nameExpr.SpanStart, cancellationToken); 2902if (syntaxTree.IsExpressionContext(nameExpr.SpanStart, tokenBeforeName, attributes: false, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (2)
177name.SpanStart, name, SpeculativeBindingOption.BindAsExpression); 180name.SpanStart, name, SpeculativeBindingOption.BindAsExpression).Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
36var end = destination.Members.First().SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
414if (firstToken.SpanStart <= clause.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
63spansToFormat.Add(TextSpan.FromBounds(0, firstMemberA.SpanStart)); 67spansToFormat.Add(TextSpan.FromBounds(baseNamespace.Name.Span.End, firstMemberB.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
43var visibleSymbols = semanticModel.LookupSymbols(location.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
261return InferTypes(expression.SpanStart); 1296=> InferTypes(implicitArray.SpanStart); 2217if (descendant.SpanStart <= afterNode.Span.End)
Microsoft.CodeAnalysis.EditorFeatures (1)
Editor\GoToAdjacentMemberCommandHandler.cs (1)
143return node.SpanStart;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Structure\AbstractSyntaxNodeStructureProviderTests.cs (2)
33if ((position == node.SpanStart && position == node.Parent.SpanStart) ||
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
Expansion\AbstractExpansionTest.vb (2)
59While Not node Is Nothing And Not node.Parent Is Nothing And node.Parent.SpanStart = node.SpanStart
Simplification\AbstractSimplificationTests.vb (2)
134While Not node Is Nothing And Not node.Parent Is Nothing And node.Parent.SpanStart = node.SpanStart
Microsoft.CodeAnalysis.Features (49)
AddImport\SymbolReferenceFinder.cs (1)
82for (var containingNamespace = _semanticModel.GetEnclosingNamespace(_node.SpanStart, cancellationToken);
ChangeSignature\AbstractChangeSignatureService.cs (1)
171positionForTypeBinding = syntax.SpanStart;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
295var targetMemberNode = syntaxFacts.GetContainingMemberDeclaration(root, nodeWithTokens.SpanStart);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (1)
105return type?.IsAwaitableNonDynamic(model, node.SpanStart) == true;
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
50var nullableContext = semanticModel.GetNullableContext(from.SpanStart);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
232if (targetMember.SpanStart < documentationComment.SpanStart)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
134/// In case there are multiple breakpoint spans starting at the <see cref="SyntaxNode.SpanStart"/> of the <paramref name="node"/>,
ExtractMethod\MethodExtractor.cs (1)
264var currentType = semanticModel.GetSpeculativeTypeInfo(contextNode.SpanStart, typeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
ExtractMethod\UniqueNameGenerator.cs (1)
28n => _semanticModel.LookupSymbols(contextNode.SpanStart, container: null, n).Length == 0);
FullyQualify\AbstractFullyQualifyService.cs (1)
200var containerName = container.ToMinimalDisplayString(semanticModel, simpleName.SpanStart);
GenerateType\AbstractGenerateTypeService.cs (3)
141var containingNamespace = semanticDocument.SemanticModel.GetEnclosingNamespace(node.SpanStart, cancellationToken); 162var containingNamespace = document.SemanticModel.GetEnclosingNamespace(node.SpanStart, cancellationToken); 248var outerTypeSymbol = semanticModel.GetEnclosingNamedType(state.SimpleName.SpanStart, cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
389_state.SimpleName.SpanStart, _cancellationToken);
GenerateType\AbstractGenerateTypeService.State.cs (5)
129if (!semanticFacts.IsTypeContext(semanticModel, NameOrMemberAccessExpression.SpanStart, cancellationToken) && 130!semanticFacts.IsExpressionContext(semanticModel, NameOrMemberAccessExpression.SpanStart, cancellationToken) && 131!semanticFacts.IsStatementContext(semanticModel, NameOrMemberAccessExpression.SpanStart, cancellationToken) && 133!semanticFacts.IsNamespaceContext(semanticModel, NameOrMemberAccessExpression.SpanStart, cancellationToken)) 362var namespaceSymbol = semanticModel.GetEnclosingNamespace(SimpleName.SpanStart, cancellationToken);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
387|| callerMethodSymbol.IsAwaitableNonDynamic(semanticModel, callerDeclarationNode.SpanStart)))
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
270var declaringType = semanticModel.GetEnclosingNamedType(expression.SpanStart, cancellationToken);
InvertIf\AbstractInvertIfCodeRefactoringProvider.StatementRange.cs (2)
24Debug.Assert(firstStatement.SpanStart <= lastStatement.SpanStart);
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
97IteratePotentialTypeNodes(root).OrderBy(t => Math.Abs(t.expression.SpanStart - position)),
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
114actionsToPerform.Add((node.SpanStart, () => RemoveOrReplaceNode(syntaxEditor, node, blockFacts)));
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
168var position = initializer.SpanStart;
Snippets\SnippetProviders\AbstractConditionalBlockSnippetProvider.cs (1)
29return [new SnippetPlaceholder(condition.ToString(), condition.SpanStart)];
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
103if (nearestExpression.SpanStart != position)
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (1)
156var typeInfo = semanticModel.GetSpeculativeTypeInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsExpression);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
147foreach (var node in nodes.OrderBy(n => n.SpanStart))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
127var spanStart = firstBlock.Syntax.SpanStart;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
192_objectCreationExpression.SpanStart,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (3)
36syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, arguments[0].SpanStart)), 48syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, expression.SpanStart)),
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (2)
213if (expression != null && expression.SpanStart < _objectCreationExpression.SpanStart)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
155formatString, formatStringLiteralExpressionSyntax.SpanStart);
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
94var title = GetSubItemName(semanticModel, targetNode.SpanStart, conversionType);
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (2)
67return _syntaxFacts.GetContainingMemberDeclaration(root, node.SpanStart) ?? 68_syntaxFacts.GetContainingTypeDeclaration(root, node.SpanStart);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
67ContainingType = document.SemanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken); 91ContainingType = document.SemanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
59ContainingType = semanticModel.GetEnclosingNamedType(targetVariables.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
104ContainingType = semanticModel.GetEnclosingNamedType(methodDeclaration.SpanStart, cancellationToken); 153ContainingType = semanticModel.GetEnclosingNamedType(SimpleNameOpt.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
474var enclosingMethodSymbol = _document.SemanticModel.GetEnclosingSymbol<IMethodSymbol>(SimpleNameOrMemberAccessExpressionOpt.SpanStart, cancellationToken);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
887memberDeclaration = syntaxFacts.GetContainingMemberDeclaration(root, memberDeclaration.SpanStart) ?? root;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
56var containingSymbol = semanticModel.GetRequiredEnclosingSymbol(ifStatement.SpanStart, cancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\ControlFlowGraphVerifier.cs (2)
698aggregate.AggregateKeyword.SpanStart < candidate.Syntax.SpanStart && 699aggregate.IntoKeyword.SpanStart > candidate.Syntax.SpanStart &&
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1258return _controlFlowGraphMapOpt.Values.OrderBy(flowGraphAndSymbol => flowGraphAndSymbol.Graph.OriginalOperation.Syntax.SpanStart).ToImmutableArray();
Microsoft.CodeAnalysis.VisualBasic (19)
Analysis\FlowAnalysis\DataFlowPass.vb (1)
1194If isImplicitlyDeclared OrElse firstLocation Is Nothing OrElse firstLocation.SourceSpan.Start < node.SpanStart Then
Binding\MemberSemanticModel.vb (1)
97Dim binder = GetEnclosingBinderInternal(Me.RootBinder, Me.Root, node, node.SpanStart)
Compilation\SemanticModel.vb (6)
1120Dim binder As Binder = If(binderOpt, GetEnclosingBinder(boundNodes.LowestBoundNode.Syntax.SpanStart)) 1482Dim binder As Binder = If(binderOpt, GetEnclosingBinder(lowestBoundNode.Syntax.SpanStart)) 2998Dim binder = Me.GetEnclosingBinder(Root.SpanStart) ' should never return null. 3012Dim binder = Me.GetEnclosingBinder(Root.SpanStart) ' should never return null. 3026Dim binder = Me.GetEnclosingBinder(Root.SpanStart) ' should never return null. 3040Dim binder = Me.GetEnclosingBinder(Root.SpanStart) ' should never return null.
Compilation\SyntaxTreeSemanticModel.vb (1)
173Return GetMemberSemanticModel(node.SpanStart)
Emit\EditAndContinue\VisualBasicLambdaSyntaxFacts.vb (1)
25Return node.SpanStart
Lowering\Instrumentation\DebugInfoInjector.vb (1)
138sequencePointSpan = TextSpan.FromBounds(original.Syntax.SpanStart, original.Syntax.Span.End)
Lowering\LambdaRewriter\LambdaRewriter.vb (2)
1009Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree) 1058Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(lambdaOrLambdaBodySyntax.SpanStart, lambdaOrLambdaBodySyntax.SyntaxTree)
Lowering\StateMachineRewriter\StateMachineRewriter.StateMachineMethodToClassRewriter.vb (1)
182Dim syntaxOffset = CurrentMethod.CalculateLocalSyntaxOffset(node.SpanStart, node.SyntaxTree)
Lowering\StateMachineRewriter\StateMachineRewriter.vb (1)
300Dim syntaxOffset As Integer = Me.Method.CalculateLocalSyntaxOffset(declaratorSyntax.SpanStart, declaratorSyntax.SyntaxTree)
Symbols\LexicalSortKey.vb (2)
217Dim firstKey = New LexicalSortKey(first.SyntaxTree, first.SpanStart, compilation) 218Dim secondKey = New LexicalSortKey(second.SyntaxTree, second.SpanStart, compilation)
Syntax\LambdaUtilities.vb (1)
392If lambdaBody.SpanStart < groupByClause.ByKeyword.SpanStart Then
Syntax\SyntaxFacts.vb (1)
194Return position < node.SpanStart OrElse InSpanOrEffectiveTrailingOfNode(node, position)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (3)
814Dim member = GetContainingMemberDeclaration(node, node.SpanStart) 886Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 891Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (1)
112Dim position = originalNode.SpanStart
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\ArgumentFixer.vb (2)
39Return semanticModel.GetSpeculativeSymbolInfo(parent.SpanStart, DirectCast(parent, AttributeSyntax)) 41Return semanticModel.GetSpeculativeSymbolInfo(parent.SpanStart, parent, SpeculativeBindingOption.BindAsExpression)
Microsoft.CodeAnalysis.VisualBasic.Features (25)
AddImport\VisualBasicAddImportFeatureService.vb (1)
335leftExpressionType = semanticModel.GetEnclosingNamedType(expression.SpanStart, cancellationToken)
ChangeSignature\VisualBasicChangeSignatureService.vb (5)
181matchingNode.SpanStart) 349originalNode.SpanStart, 384originalNode.SpanStart, 409originalNode.SpanStart, 430originalNode.SpanStart,
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
97Dim enclosingDeclaration = document.SemanticModel.GetEnclosingSymbol(node.SpanStart, cancellationToken) 129Dim enclosingDeclaration = document.SemanticModel.GetEnclosingSymbol(node.SpanStart, cancellationToken)
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
143Return overridesToken.Kind = SyntaxKind.OverridesKeyword AndAlso IsOnStartLine(overridesToken.Parent.SpanStart, text, startLine)
EditAndContinue\BreakpointSpans.vb (2)
92Return TextSpan.FromBounds(node.SpanStart, node.Span.End) 100Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
EditAndContinue\DeclarationBody\FieldOrPropertyDeclarationBody.vb (1)
88If span.Start = InitializerActiveStatement.SpanStart Then
EditAndContinue\SyntaxComparer.vb (1)
695nodeOpt.SpanStart < DirectCast(nodeOpt.Parent, GroupByClauseSyntax).ByKeyword.SpanStart Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (3)
140position = body.SpanStart 157While node.Span.Length < span.Length AndAlso node.Parent.SpanStart = position 336Return BreakpointSpans.TryGetClosestBreakpointSpan(node, node.SpanStart, minLength, span)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (2)
116Dim postProcessor = New PostProcessor(semanticModel, insertionPointNode.SpanStart) 297Dim postProcessor = New PostProcessor(semanticModel, insertionPointNode.SpanStart)
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (1)
214Dim position = expression.SpanStart
SignatureHelp\AbstractIntrinsicOperatorSignatureHelpProvider.vb (3)
43Dim signatureHelpItem = GetSignatureHelpItemForIntrinsicOperator(document, semanticModel, node.SpanStart, documentation, cancellationToken) 47Dim textSpan = CommonSignatureHelpUtilities.GetSignatureHelpSpan(node, node.SpanStart, Function(n) n.ChildTokens.FirstOrDefault(Function(c) c.Kind = SyntaxKind.CloseParenToken)) 107currentSpan.Start = node.SpanStart Then
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\ArgumentFixer.vb (2)
39Return semanticModel.GetSpeculativeSymbolInfo(parent.SpanStart, DirectCast(parent, AttributeSyntax)) 41Return semanticModel.GetSpeculativeSymbolInfo(parent.SpanStart, parent, SpeculativeBindingOption.BindAsExpression)
src\Compilers\VisualBasic\Portable\Syntax\LambdaUtilities.vb (1)
392If lambdaBody.SpanStart < groupByClause.ByKeyword.SpanStart Then
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
FlowAnalysis\FlowTestBase.vb (3)
181If startPosition <= startNode.SpanStart Then startPosition = startNode.SpanStart 182While startNode IsNot Nothing AndAlso startNode.SpanStart = startPosition
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (8)
TestSyntaxNodes.vb (8)
334Assert.Equal(tree.SpanStart, tree.FullSpan.Start) 336VerifyListSpans(precedingTrivia, New TextSpan(tree.FullSpan.Start, (tree.SpanStart - tree.FullSpan.Start))) 638Assert.Equal(0, sepList(0).SpanStart) 640Assert.Equal(6, sepList(1).SpanStart) 642Assert.Equal(12, sepList(2).SpanStart) 662Assert.Equal(9 + 0, sepList(0).SpanStart) 664Assert.Equal(9 + 6, sepList(1).SpanStart) 666Assert.Equal(9 + 12, sepList(2).SpanStart)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
ParserTestUtilities.vb (3)
452Assert.True(node.SpanStart >= node.Parent.SpanStart AndAlso 857Assert.True(node.SpanStart >= node.Parent.SpanStart AndAlso
SemanticModelTestBase.vb (1)
89Return " Syntax.SpanStart : " & syntax.SpanStart &
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (3)
814Dim member = GetContainingMemberDeclaration(node, node.SpanStart) 886Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 891Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (1)
112Dim position = originalNode.SpanStart
Microsoft.CodeAnalysis.Workspaces (25)
CodeCleanup\AbstractCodeCleanerService.cs (2)
193return TryCreateTextSpan(node.SpanStart, GetNextTokenEndPosition(nextTokenMarker.Type, nextToken), out span); 219span = TextSpan.FromBounds(node.SpanStart, GetNextTokenEndPosition(nextTokenMarker.Type, nextToken));
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (2)
759syntaxFacts.GetContainingTypeDeclaration(node, node.SpanStart), 763syntaxFacts.GetContainingMemberDeclaration(node, node.SpanStart),
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
220var location = state.SyntaxTree.GetLocation(new TextSpan(indexerReference.SpanStart, 0));
ReassignedVariable\AbstractReassignedVariableService.cs (1)
313if (current.SpanStart <= localOrParameterDeclarationSpan.Start)
Recommendations\AbstractRecommendationServiceRunner.cs (2)
280semanticModel.GetEnclosingNamespace(declarationSyntax.SpanStart, _cancellationToken)); 282var symbols = semanticModel.LookupNamespacesAndTypes(declarationSyntax.SpanStart, containingNamespaceSymbol)
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (2)
74if (previousBodyNode.SpanStart != currentBodyNode.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
606return declarationSyntax != null && position < declarationSyntax.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (7)
305Math.Min(fullSpan.Start, node.SpanStart), 321var end = endNode.SpanStart; 846=> x?.SpanStart == y?.SpanStart; 849=> obj.SpanStart; 926condDirectivesBuilder.Sort(static (n1, n2) => n1.SpanStart.CompareTo(n2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
100return node.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
85var spanStart = documentationComment.SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (2)
775!forEachExpression.Span.Contains(OriginalExpression.SpanStart)) 870newSymbol = this.OriginalSemanticModel.GetSpeculativeSymbolInfo(type.SpanStart, newType, bindingOption).Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
205var afterMember = declarationList.LastOrDefault(m => m.SpanStart <= info.Context.AfterThisLocation.SourceSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
256var containedNamespace = model.GetEnclosingNamespace(node.SpanStart, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
92=> semanticModel.LookupSymbols(location.SpanStart).Concat(semanticModel.GetExistingSymbols(container, cancellationToken));
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (2)
123operation.TargetMethod.ToMinimalDisplayString(operation.SemanticModel, operation.Syntax.SpanStart), 124targetType.ToMinimalDisplayString(operation.SemanticModel, operation.Syntax.SpanStart)));
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
158var entryPointTypeSymbol = (INamedTypeSymbol)model.GetEnclosingSymbol(node.SpanStart, ct);
Microsoft.VisualStudio.LanguageServices.CSharp (19)
CodeModel\CSharpCodeModelService.cs (3)
2799var deletionStart = attributeList.SpanStart; 2848var deletionStart = node.SpanStart; 3691var position = typeDeclaration.SpanStart;
CodeModel\CSharpCodeModelService.NodeLocator.cs (16)
228startPosition = node.SpanStart; 232startPosition = node.Expression.SpanStart; 265startPosition = node.Name.SpanStart; 295startPosition = node.SpanStart; 385var line = text.Lines.GetLineFromPosition(node.SpanStart); 465startPosition = node.SpanStart; 472var line = text.Lines.GetLineFromPosition(firstAccessorNode.SpanStart); 492var line = text.Lines.GetLineFromPosition(node.SpanStart); 525startPosition = node.SpanStart; 531var line = text.Lines.GetLineFromPosition(node.SpanStart); 578startPosition = node.Name.SpanStart; 664startPosition = node.SpanStart; 668startPosition = node.Name.SpanStart; 702startPosition = field.SpanStart; 742startPosition = node.SpanStart; 782startPosition = node.SpanStart;
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
1280Dim deletionStart = node.SpanStart