119 references to Contains
Microsoft.CodeAnalysis (7)
Syntax\ChildSyntaxList.cs (1)
224Debug.Assert(node.FullSpan.Contains(targetPosition));
Syntax\SyntaxNode.cs (6)
758if (!FullSpan.Contains(position)) 764Debug.Assert(childNodeOrToken.FullSpan.Contains(position), "ChildThatContainsPosition's return value does not contain the requested position."); 1102if (this.FullSpan.Contains(position)) 1452if (!this.FullSpan.Contains(position)) 1486Debug.Assert(curNode.FullSpan.Contains(position)); 1551if (trivia.FullSpan.Contains(position))
Microsoft.CodeAnalysis.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
79if ((token.Span.Contains(position) || token.Span.End == position) && predicate(token))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (2)
290if (list.Any(o => o != null && o.TextSpan.Contains(position))) 329if (operation.TextSpan.Contains(position))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (3)
59o => o.TextSpan.Contains(startToken.SpanStart) || 60o.TextSpan.Contains(endToken.SpanStart))); 171if (!operation.TextSpan.Contains(tuple.startPosition))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
59if (holes.Any(static (h, position) => h.Span.Contains(position) && position > h.Span.Start, position))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
775!forEachExpression.Span.Contains(OriginalExpression.SpanStart))
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
191var tokenToRight = tokenOnLocation.Span.Contains(location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (1)
75if (node.FullSpan.Contains(selection.Start))
Microsoft.CodeAnalysis.CSharp (6)
Compilation\MemberSemanticModel.cs (3)
1580if (!this.Root.FullSpan.Contains(position)) 1859if (value.Syntax.FullSpan.Contains(position)) 1864if (expr.Syntax.FullSpan.Contains(position))
FlowAnalysis\AbstractFlowPass.cs (1)
303return RegionSpan.Contains(span.Start);
Symbols\Source\SourceConstructorSymbolBase.cs (1)
200if (span.Contains(position))
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1258if (precedingInitializerIndex >= 0 && initializers[precedingInitializerIndex].Syntax.Span.Contains(position))
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
560if (!textSpan.Contains(matchSpan.Start)) 573if (!textSpan.Contains(directives[0].SpanStart) || 574!textSpan.Contains(directives.Last().SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
431return token.Span.Contains(position);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
718if (useFullSpan || node.Span.Contains(position))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
519lockStatement.Statement.Span.Contains(position))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (11)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (11)
643&& !tryStatementNode.Block.Span.Contains(caretPosition); 648&& !catchClauseSyntax.Block.Span.Contains(caretPosition); 653&& !finallyClauseNode.Block.Span.Contains(caretPosition); 657&& !checkedStatementNode.Block.Span.Contains(caretPosition); 664&& doStatementNode.DoKeyword.FullSpan.Contains(caretPosition); 742return TextSpan.FromBounds(openBrace.SpanStart, closeBrace.Span.End).Contains(caretPosition); 749return baseMethodBody.Span.Contains(caretPosition); 754return localFunctionBody.Span.Contains(caretPosition); 803&& accessorDeclarationNode.Body.Span.Contains(caretPosition); 815return accessorList.Span.Contains(caretPosition) && accessorList.Accessors.IsEmpty(); 830&& accessorList.Span.Contains(caretPosition)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
FlowAnalysis\FlowTestBase.cs (2)
218return GetSyntaxNodeList(tree).OfType<T>().Where(n => n.Span.Contains(offset)).FirstOrDefault(); 224return GetSyntaxNodeList(tree).OfType<T>().Where(n => n.Span.Contains(offset)).Last();
Semantics\OutVarTests.cs (2)
1278forStatement.Incrementors.Span.Contains(decl.Position) && 1299(containingReturnOrThrow == null || containingReturnOrThrow.Span.Contains(reference.SpanStart)) &&
Microsoft.CodeAnalysis.CSharp.Features (19)
BraceMatching\BlockCommentBraceMatcher.cs (1)
45if (trivia.FullSpan.Contains(position))
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
79return node.Span.Contains(position);
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
351var interpolation = stringExpression.Contents.OfType<InterpolationSyntax>().Single(i => i.Span.Contains(start));
Debugging\LocationInfoGetter.cs (1)
46if (declarator.FullSpan.Contains(position))
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
214if (!body.FullSpan.Contains(position))
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
70expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
65expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (3)
295return expression.ArgumentList.Span.Contains(token.SpanStart) && 329return node.RankSpecifiers.Span.Contains(token.SpanStart) && 380return expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
73node.TypeArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
54=> expression.Span.Contains(token.SpanStart) && token != expression.CloseBraceToken;
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
61return expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (1)
58expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
62expression.ArgumentList.Span.Contains(token.SpanStart) &&
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (2)
215tupleExpression.Arguments.FullSpan.Contains(token.SpanStart) && 232expr.FullSpan.Contains(token.SpanStart) &&
Wrapping\SeparatedSyntaxList\CSharpCollectionExpressionWrapper.cs (1)
53return listSyntax.Span.Contains(position);
Wrapping\SeparatedSyntaxList\CSharpInitializerExpressionWrapper.cs (1)
53return listSyntax.Span.Contains(position);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
694Assert.True(token.FullSpan.Contains(i));
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (3)
560if (!textSpan.Contains(matchSpan.Start)) 573if (!textSpan.Contains(directives[0].SpanStart) || 574!textSpan.Contains(directives.Last().SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
431return token.Span.Contains(position);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
718if (useFullSpan || node.Span.Contains(position))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
519lockStatement.Statement.Span.Contains(position))
Microsoft.CodeAnalysis.EditorFeatures (1)
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (1)
109if (token.Span.Length > 0 && token.Span.Contains(position) && !_provider.IsWithinNaturalLanguage(token, position))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Formatting\CoreFormatterTestsBase.cs (1)
97if (workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>() is TestFormattingRuleFactoryServiceFactory.Factory factory && factory.BaseIndentation != 0 && factory.TextSpan.Contains(p.Position))
Workspaces\EditorTestWorkspace.cs (1)
383(matchingSpan.Contains(documentWithSpan.CursorPosition.Value) || matchingSpan.End == documentWithSpan.CursorPosition.Value))
Microsoft.CodeAnalysis.Features (2)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
1366if (!newEncompassingAncestor.Span.Contains(newStatementSyntaxSpan.Start))
EditAndContinue\ActiveStatementsMap.cs (1)
201oldRoot.FullSpan.Contains(unmappedSpan.Start) &&
Microsoft.CodeAnalysis.UnitTests (4)
Text\TextSpanTest.cs (4)
132Assert.True(span.Contains(3)); 133Assert.False(span.Contains(30)); 134Assert.False(span.Contains(11)); 135Assert.False(span.Contains(-1));
Microsoft.CodeAnalysis.VisualBasic (8)
Analysis\FlowAnalysis\AbstractFlowPass.Regions.vb (1)
56Return Me._region.Contains(span.Start)
Scanner\Blender.vb (3)
113If Not node.FullSpan.Contains(position) Then 390If range.Contains(start) Then 440If _curNodeSpan.Contains(_affectedRange.Span.Start) Then
Symbols\Source\SourceMemberContainerTypeSymbol.vb (1)
3307If index >= 0 AndAlso initializers(index).Syntax.Span.Contains(position) Then
Symbols\Source\SourceMethodSymbol.vb (1)
1216If span.Contains(localPosition) Then
Syntax\SyntaxFacts.vb (2)
203If span.Contains(position) Then 212If trivia.FullSpan.Contains(position) Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
415If Not textSpan.Contains(matchSpan.Start) Then 424If Not textSpan.Contains(directives(0).SpanStart) OrElse
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
352Return directive.FullSpan.Contains(position) OrElse
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (2)
768If useFullSpan OrElse node.Span.Contains(position) Then 885Return outerSpan.Contains(innerSpan.Start)
Microsoft.CodeAnalysis.VisualBasic.Features (11)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
138If Not body.FullSpan.Contains(position) Then
SignatureHelp\AttributeSignatureHelpProvider.vb (1)
50node.ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\CastExpressionSignatureHelpProvider.vb (1)
49Return node.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\CollectionInitializerSignatureHelpProvider.vb (1)
45Return expression.Span.Contains(token.SpanStart) AndAlso token <> expression.CloseBraceToken
SignatureHelp\ConditionalExpressionSignatureHelpProvider.vb (1)
36Return node.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
59Return node.TypeArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (1)
61node.ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\MidAssignmentSignatureHelpProvider.vb (1)
43DirectCast(node.Left, MidExpressionSyntax).ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.vb (1)
60node.ArgumentList.Span.Contains(token.SpanStart) AndAlso
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (1)
59statement.ArgumentList.Span.Contains(token.SpanStart) AndAlso
Wrapping\SeparatedSyntaxList\VisualBasicCollectionCreationExpressionWrapper.vb (1)
66Return listSyntax.Span.Contains(position)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
TestSyntaxNodes.vb (1)
2337Assert.Equal(True, token.FullSpan.Contains(i))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
415If Not textSpan.Contains(matchSpan.Start) Then 424If Not textSpan.Contains(directives(0).SpanStart) OrElse
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
352Return directive.FullSpan.Contains(position) OrElse
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (2)
768If useFullSpan OrElse node.Span.Contains(position) Then 885Return outerSpan.Contains(innerSpan.Start)
Microsoft.CodeAnalysis.Workspaces (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
79if ((token.Span.Contains(position) || token.Span.End == position) && predicate(token))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (2)
290if (list.Any(o => o != null && o.TextSpan.Contains(position))) 329if (operation.TextSpan.Contains(position))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (3)
59o => o.TextSpan.Contains(startToken.SpanStart) || 60o.TextSpan.Contains(endToken.SpanStart))); 171if (!operation.TextSpan.Contains(tuple.startPosition))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
59if (holes.Any(static (h, position) => h.Span.Contains(position) && position > h.Span.Start, position))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
775!forEachExpression.Span.Contains(OriginalExpression.SpanStart))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
191var tokenToRight = tokenOnLocation.Span.Contains(location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (1)
75if (node.FullSpan.Contains(selection.Start))