2038 references to Contract
IdeCoreBenchmarks (1)
AbstractCloudCachePersistentStorageService.cs (1)
31Contract.ThrowIfTrue(string.IsNullOrWhiteSpace(workingFolderPath));
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (1)
AbstractUserDiagnosticTest.cs (1)
93Contract.ThrowIfTrue(parameters.testHost == TestHost.OutOfProcess, $"Out-of-proc testing is not supported since {analyzer} can't be serialized.");
Microsoft.CodeAnalysis.CSharp.EditorFeatures (14)
BlockCommentEditing\BlockCommentEditingCommandHandler.cs (2)
45Contract.ThrowIfNull(undoHistoryRegistry); 46Contract.ThrowIfNull(editorOperationsFactoryService);
DecompiledSource\AssemblyResolver.cs (1)
176Contract.ThrowIfNull(fileName);
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (3)
128Contract.ThrowIfNull(document, "Event Hookup could not find the document for the IBufferView."); 139Contract.ThrowIfNull(solutionWithEventHandler, "Event Hookup could not create solution with event handler."); 143Contract.ThrowIfFalse(workspace.TryApplyChanges(solutionWithEventHandler), "Event Hookup could not update the solution.");
StringCopyPaste\AbstractPasteProcessor.cs (3)
123Contract.ThrowIfTrue(StringExpressionBeforePasteInfo.ContentSpans.IsEmpty); 145Contract.ThrowIfFalse(IsAnyRawStringExpression(StringExpressionBeforePaste)); 160Contract.ThrowIfFalse(IsAnyRawStringExpression(StringExpressionBeforePaste));
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
94Contract.ThrowIfFalse(_threadingContext.HasMainThread);
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (1)
49Contract.ThrowIfFalse(_threadingContext.HasMainThread);
StringCopyPaste\StringCopyPasteHelpers.cs (1)
547Contract.ThrowIfTrue(spans.Length == 0);
StringCopyPaste\StringInfo.cs (2)
134Contract.ThrowIfFalse(SyntaxFacts.IsNewLine(text[rawStart])); 149Contract.ThrowIfFalse(SyntaxFacts.IsNewLine(text[rawEnd - 1]));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
440Contract.ThrowIfNull(n);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (6)
2480Contract.ThrowIfNull(testDocument.CursorPosition); 2737Contract.ThrowIfNull(testDocument.CursorPosition); 2793Contract.ThrowIfNull(testDocument.CursorPosition); 3083Contract.ThrowIfNull(testDocument.CursorPosition); 3221Contract.ThrowIfNull(testDocument.CursorPosition); 3275Contract.ThrowIfNull(testDocument.CursorPosition);
CSharpRemoveRedundantNullableDirectiveTests.cs (1)
255Contract.ThrowIfNull(compilationOptions);
CSharpRemoveUnnecessaryNullableDirectiveTests.cs (1)
242Contract.ThrowIfNull(compilationOptions);
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
49Contract.ThrowIfNull(service); 105Contract.ThrowIfNull(service); 257Contract.ThrowIfNull(service);
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (2)
128Contract.ThrowIfNull(pasteText); 130Contract.ThrowIfNull(json);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\Json\CSharpJsonParserTests_NstTests.cs (1)
19Roslyn.Utilities.Contract.ThrowIfNull(tree);
Microsoft.CodeAnalysis.CSharp.Features (158)
AbstractAssignOutParametersCodeFixProvider.cs (1)
111Contract.ThrowIfNull(parameterList);
AnalyzedPattern.cs (1)
31Contract.ThrowIfNull(operation.SemanticModel);
ArrowExpressionClausePlacementCodeFixProvider.cs (1)
59Contract.ThrowIfTrue(arrowToken.Kind() != SyntaxKind.EqualsGreaterThanToken);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
338Contract.ThrowIfNull(syntaxRoot);
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (1)
242Contract.ThrowIfNull(attributeType);
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
76Contract.ThrowIfNull(semanticModel);
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
91Contract.ThrowIfNull(typeInferenceService, nameof(typeInferenceService));
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
110Contract.ThrowIfNull(namedType);
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
110Contract.ThrowIfNull(directive);
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
48Contract.ThrowIfNull(context);
ConditionalExpressionPlacementCodeFixProvider.cs (1)
59Contract.ThrowIfTrue(questionToken.Kind() != SyntaxKind.QuestionToken);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
50Contract.ThrowIfNull(newRoot); 54Contract.ThrowIfNull(newRoot);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (3)
33Contract.ThrowIfNull(typeDeclaration); // checked by analyzer 185Contract.ThrowIfNull(methodDeclaration.Body); // checked by analyzer 258Contract.ThrowIfNull(field);
ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
113Contract.ThrowIfNull(nextStatement);
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (7)
94Contract.ThrowIfNull(_assignmentTarget); 105Contract.ThrowIfFalse(_assignmentTarget is IdentifierNameSyntax); 210Contract.ThrowIfNull(result); 237Contract.ThrowIfNull(armExpression); 279Contract.ThrowIfNull(node.Expression); 285Contract.ThrowIfNull(node.Expression); 294Contract.ThrowIfNull(result);
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (3)
45Contract.ThrowIfNull(dataFlow); 64Contract.ThrowIfNull(declaration); 70Contract.ThrowIfNull(beforeSwitch);
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (3)
198Contract.ThrowIfFalse(span.IntersectsWith(token.Span)); 199Contract.ThrowIfFalse(token.Kind() == SyntaxKind.StringLiteralToken); 274Contract.ThrowIfTrue(characters.IsDefaultOrEmpty);
CSharpAddBracesDiagnosticAnalyzer.cs (1)
58Contract.ThrowIfNull(embeddedStatement);
CSharpAsAndMemberAccessCodeFixProvider.cs (2)
66Contract.ThrowIfNull(parent); 126Contract.ThrowIfNull(binaryExpression);
CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
133Contract.ThrowIfNull(isPatternExpression);
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (7)
35Contract.ThrowIfNull(semanticModel); 36Contract.ThrowIfNull(localSymbol); 37Contract.ThrowIfNull(comparison); 38Contract.ThrowIfNull(operand); 283Contract.ThrowIfNull(statement); 309Contract.ThrowIfNull(scope); 377Contract.ThrowIfNull(dataFlow);
CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
35Contract.ThrowIfNull(typeSymbol);
CSharpForEachCastCodeFixProvider.cs (1)
33Contract.ThrowIfNull(result);
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
260Contract.ThrowIfNull(nextStatement); 265Contract.ThrowIfNull(dataFlow);
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
128Contract.ThrowIfNull(semanticModel);
CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
79Contract.ThrowIfNull(currentAccessorList);
CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
53Contract.ThrowIfFalse(nodes.Any());
CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
125Contract.ThrowIfNull(currentOptionsDirective); 157Contract.ThrowIfNull(currentOptionsDirective);
CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
38Contract.ThrowIfNull(options);
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
46Contract.ThrowIfNull(compilationOptions);
CSharpUpgradeProjectCodeFixProvider.cs (2)
95Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(newVersion, out var parsedNewVersion)); 109Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(newVersion, out var parsedNewVersion));
CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
59Contract.ThrowIfFalse(CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.GetWhenTrueAssignment(
CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
199Contract.ThrowIfNull(semanticModel);
CSharpUseNameofInAttributeCodeFixProvider.cs (1)
52Contract.ThrowIfNull(name);
CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
91Contract.ThrowIfNull(semanticModel);
CSharpUseRangeOperatorCodeFixProvider.cs (2)
147Contract.ThrowIfNull(instance); 199Contract.ThrowIfNull(result.Op2);
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (4)
85Contract.ThrowIfNull(semanticModel); 148Contract.ThrowIfNull(invocation.Instance); 165Contract.ThrowIfNull(invocation.Instance); 214Contract.ThrowIfNull(invocation.Instance);
EditAndContinue\BreakpointSpans.cs (2)
246Contract.ThrowIfNull(property.AccessorList); 261Contract.ThrowIfNull(indexer.AccessorList);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (10)
569Contract.ThrowIfNull(oldDeclaration.Parent); 570Contract.ThrowIfNull(newDeclaration.Parent); 1167Contract.ThrowIfFalse(node.Parent is (kind: 1259Contract.ThrowIfNull(oldNode); 1287Contract.ThrowIfNull(oldNode); 1288Contract.ThrowIfNull(newNode); 1289Contract.ThrowIfNull(oldModel); 1411Contract.ThrowIfNull(oldNode); 1412Contract.ThrowIfNull(newNode); 1413Contract.ThrowIfNull(oldModel);
EditAndContinue\SyntaxComparer.cs (1)
914Contract.ThrowIfFalse(rightName.HasValue == leftName.HasValue);
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
59Contract.ThrowIfTrue(variable.UseAsReturnValue);
ExtractMethod\CSharpMethodExtractor.cs (4)
40Contract.ThrowIfFalse(originalSpanStart >= 0); 100Contract.ThrowIfNull(memberNode); 101Contract.ThrowIfTrue(memberNode.Kind() == SyntaxKind.NamespaceDeclaration); 174Contract.ThrowIfNull(type);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (16)
37Contract.ThrowIfNull(outmostCallSiteContainer); 38Contract.ThrowIfNull(variableToRemoveMap); 39Contract.ThrowIfNull(firstStatementOrFieldToReplace); 40Contract.ThrowIfNull(lastStatementOrFieldToReplace); 41Contract.ThrowIfNull(statementsOrFieldToInsert); 42Contract.ThrowIfTrue(statementsOrFieldToInsert.IsEmpty()); 52Contract.ThrowIfFalse(_firstStatementOrFieldToReplace.Parent == _lastStatementOrFieldToReplace.Parent 72Contract.ThrowIfFalse(variable.Initializer == null); 280Contract.ThrowIfNull(statement); 305Contract.ThrowIfFalse(firstIndex >= 0); 308Contract.ThrowIfFalse(lastIndex >= 0); 310Contract.ThrowIfFalse(firstIndex <= lastIndex); 333Contract.ThrowIfFalse(firstMemberIndex >= 0); 336Contract.ThrowIfFalse(lastMemberIndex >= 0); 338Contract.ThrowIfFalse(firstMemberIndex <= lastMemberIndex); 377Contract.ThrowIfFalse(_firstStatementOrFieldToReplace == _lastStatementOrFieldToReplace);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (6)
88Contract.ThrowIfFalse(SemanticDocument == selectionResult.SemanticDocument); 133Contract.ThrowIfFalse(firstStatementToRemove.Parent == lastStatementToRemove.Parent 195Contract.ThrowIfTrue(AnalyzerResult.MethodTypeParametersInDeclaration.Count == 0); 217Contract.ThrowIfNull(declStatement); 218Contract.ThrowIfFalse(declStatement.Parent.IsStatementContainerNode()); 740Contract.ThrowIfTrue(AnalyzerResult.HasVariableToUseAsReturnValue);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (4)
101Contract.ThrowIfFalse(IsExtractMethodOnExpression(CSharpSelectionResult)); 161Contract.ThrowIfNull(container); 162Contract.ThrowIfFalse(container.IsStatementContainerNode() || 194Contract.ThrowIfTrue(
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (3)
50Contract.ThrowIfFalse(CSharpSyntaxFacts.Instance.AreStatementsInSameContainer(firstUnderContainer, lastUnderContainer)); 112Contract.ThrowIfNull(node); 113Contract.ThrowIfFalse(node.IsStatementContainerNode());
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs (1)
49Contract.ThrowIfFalse(IsExtractMethodOnSingleStatement(CSharpSelectionResult));
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (5)
26Contract.ThrowIfNull(semanticModel); 116Contract.ThrowIfNull(statement); 119Contract.ThrowIfNull(type); 129Contract.ThrowIfFalse(keyValuePair.Value.Count > 0); 153Contract.ThrowIfNull(statement);
ExtractMethod\CSharpSelectionResult.cs (10)
35Contract.ThrowIfNull(status); 36Contract.ThrowIfNull(document); 110Contract.ThrowIfTrue(SelectionInExpression); 114Contract.ThrowIfNull(statement); 121Contract.ThrowIfTrue(SelectionInExpression); 126Contract.ThrowIfNull(statement); 128Contract.ThrowIfFalse(CSharpSyntaxFacts.Instance.AreStatementsInSameContainer(statement, firstStatementUnderContainer)); 135Contract.ThrowIfFalse(SelectionInExpression); 173Contract.ThrowIfFalse(last.IsParentKind(SyntaxKind.GlobalStatement)); 174Contract.ThrowIfFalse(last.Parent.IsParentKind(SyntaxKind.CompilationUnit));
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (2)
41Contract.ThrowIfNull(SemanticDocument); 42Contract.ThrowIfFalse(SelectionInExpression);
ExtractMethod\CSharpSelectionResult.StatementResult.cs (3)
51Contract.ThrowIfNull(SemanticDocument); 52Contract.ThrowIfTrue(SelectionInExpression); 71Contract.ThrowIfTrue(SelectionInExpression);
ExtractMethod\CSharpSelectionValidator.cs (1)
509Contract.ThrowIfFalse(line.LineNumber > 0);
ExtractMethod\Extensions.cs (3)
34Contract.ThrowIfNull(node); 69Contract.ThrowIfNull(node); 100Contract.ThrowIfNull(node);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
60Contract.ThrowIfNull(member);
InlineHints\CSharpInlineTypeHintsService.cs (1)
135Contract.ThrowIfFalse(displayAllOverride);
LineSeparators\CSharpLineSeparatorService.cs (2)
247Contract.ThrowIfNull(spans); 262Contract.ThrowIfNull(spans);
MakeLocalFunctionStaticCodeFixHelper.cs (1)
219Contract.ThrowIfNull(symbolType);
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
250Contract.ThrowIfNull(rewritten);
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
303Contract.ThrowIfFalse(openBracket.Parent is BracketedArgumentListSyntax && 345Contract.ThrowIfFalse(openBracket.Parent is ArrayRankSpecifierSyntax && openBracket.Parent.Parent is ArrayTypeSyntax);
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProvider.cs (1)
33Contract.ThrowIfTrue(nextToken.Kind() == 0);
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
164Contract.ThrowIfFalse(lessThanToken.Parent is TypeArgumentListSyntax && lessThanToken.Parent.Parent is GenericNameSyntax);
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
68Contract.ThrowIfFalse(includeInstance || includeStatic);
StringIndentation\CSharpStringIndentationService.cs (2)
174Contract.ThrowIfNull(offsetOpt); 185Contract.ThrowIfTrue(lastLine.LineNumber - firstLine.LineNumber < 2);
Structure\CSharpStructureHelpers.cs (3)
134Contract.ThrowIfNull(text); 135Contract.ThrowIfNull(prefix); 143Contract.ThrowIfFalse(comment.IsSingleLineComment() || comment.IsMultiLineComment());
Structure\Providers\DisabledTextTriviaStructureProvider.cs (1)
21Contract.ThrowIfNull(trivia.SyntaxTree);
UseExpressionBodyHelper`1.cs (1)
84Contract.ThrowIfNull(body);
UseUtf8StringLiteralCodeFixProvider.cs (3)
53Contract.ThrowIfNull(readOnlySpanType); 61Contract.ThrowIfNull(arrayOp.Initializer); 150Contract.ThrowIfFalse(UseUtf8StringLiteralDiagnosticAnalyzer.TryConvertToUtf8String(builder, initializer.ElementValues));
UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
87Contract.ThrowIfNull(semanticModel);
Microsoft.CodeAnalysis.CSharp.Workspaces (81)
BlockSyntaxExtensions.cs (1)
110Contract.ThrowIfFalse(preference == ExpressionBodyPreference.WhenOnSingleLine);
CastSimplifier.cs (1)
176Contract.ThrowIfTrue(castNode.WalkUpParentheses().ContainsDiagnostics);
CodeGeneration\CSharpSyntaxGenerator.cs (6)
831Contract.ThrowIfNull(type); 1227Contract.ThrowIfNull(result); 2083Contract.ThrowIfNull(vd.Parent); 2986Contract.ThrowIfTrue(ReferenceEquals(root, node)); 3007Contract.ThrowIfTrue(ReferenceEquals(root, declaration)); 3159Contract.ThrowIfNull(expression);
CSharpAddImportsService.cs (1)
140Contract.ThrowIfNull(rewritten);
CSharpCodeGenerationHelpers.cs (2)
114Contract.ThrowIfNull(syntax); 268Contract.ThrowIfNull(symbol);
CSharpIndentationService.cs (2)
54Contract.ThrowIfNull(formattingRules); 55Contract.ThrowIfNull(root);
CSharpIndentationService.Indenter.cs (5)
76Contract.ThrowIfNull(indenter.Tree); 77Contract.ThrowIfTrue(token.Kind() == SyntaxKind.None); 127Contract.ThrowIfNull(interpolatedExpression); 272Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???"); 285Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???");
CSharpInferredMemberNameSimplifier.cs (2)
64Contract.ThrowIfNull(toRemove.NameColon); 86Contract.ThrowIfNull(toRemove.NameEquals);
CSharpRemoveUnnecessaryImportsService.cs (1)
57Contract.ThrowIfNull(formattingOptions);
CSharpSmartTokenFormatter.cs (4)
36Contract.ThrowIfNull(root); 48Contract.ThrowIfTrue(startToken.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken); 49Contract.ThrowIfTrue(endToken.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken); 80Contract.ThrowIfTrue(token.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken);
CSharpTriviaFormatter.cs (1)
225Contract.ThrowIfFalse(multilineCommentTrivia.Count == 1);
CSharpTypeInferenceService.TypeInferrer.cs (4)
952Contract.ThrowIfTrue(previousToken.HasValue && previousToken.Value != operatorToken); 1128Contract.ThrowIfTrue(previousToken.HasValue && previousToken.Value != coalesceExpression.OperatorToken); 1945Contract.ThrowIfTrue(previousToken.HasValue && previousToken.Value != prefixUnaryExpression.OperatorToken); 2001Contract.ThrowIfTrue(previousToken.HasValue && previousToken.Value != awaitExpression.AwaitKeyword);
CSharpVirtualCharService.cs (3)
140Contract.ThrowIfFalse(tokenText is [.., 'u' or 'U', '8']); 146Contract.ThrowIfFalse(tokenText[0] == '"'); 151Contract.ThrowIfFalse(tokenText[endIndexExclusive - 1] == '"');
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
275Contract.ThrowIfTrue(node is TypeDeclarationSyntax);
FormattingHelpers.cs (1)
486Contract.ThrowIfNull(node);
FormattingRangeHelper.cs (1)
22Contract.ThrowIfTrue(endToken.Kind() == SyntaxKind.None);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
79Contract.ThrowIfTrue(sourceText == null && includePreviousTokenTrailingTriviaOnlyIfOnSameLine, "If we are including previous token trailing trivia, we need the text too.");
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
489Contract.ThrowIfNull(syntaxTree);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
41Contract.ThrowIfFalse(genericIdentifier.Kind() == SyntaxKind.IdentifierToken); 45Contract.ThrowIfFalse(token.Kind() == SyntaxKind.LessThanToken);
NamedTypeGenerator.cs (1)
228Contract.ThrowIfNull(invokeMethod);
NullableSyntaxAnnotationEx.cs (2)
29Contract.ThrowIfFalse(ReferenceEquals(Oblivious, NullableSyntaxAnnotation.Oblivious)); 30Contract.ThrowIfFalse(ReferenceEquals(AnnotatedOrNotAnnotated, NullableSyntaxAnnotation.AnnotatedOrNotAnnotated));
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
60Contract.ThrowIfNull(node);
ReassignedVariable\CSharpReassignedVariableService.cs (1)
51Contract.ThrowIfNull(current, "Couldn't find a suitable parent of this local declaration");
Rename\CSharpRenameRewriterLanguageService.cs (1)
875Contract.ThrowIfNull(tree);
SemanticModelExtensions.cs (1)
170Contract.ThrowIfNull(@using.NamespaceOrType);
SemanticModelReuse\CSharpSemanticModelReuseLanguageService.cs (2)
35Contract.ThrowIfFalse(accessor.Parent is AccessorListSyntax); 36Contract.ThrowIfFalse(accessor.Parent.Parent is BasePropertyDeclarationSyntax);
Simplification\CSharpSimplificationService.cs (3)
81Contract.ThrowIfNull(token.Parent); 174Contract.ThrowIfNull(syntaxNodeToSpeculate); 175Contract.ThrowIfFalse(SpeculationAnalyzer.CanSpeculateOnNode(nodeToSpeculate));
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (7)
42Contract.ThrowIfNull(options); 65Contract.ThrowIfNull(ParseOptions); 66Contract.ThrowIfNull(Options); 67Contract.ThrowIfNull(SemanticModel); 90Contract.ThrowIfNull(lastExpression.Parent); 105Contract.ThrowIfNull(lastPattern.Parent); 116Contract.ThrowIfNull(topMostCref.Parent);
SyntaxTriviaExtensions.cs (2)
121Contract.ThrowIfNull(trivia); 137Contract.ThrowIfNull(trivia);
TriviaDataFactory.Analyzer.cs (1)
128Contract.ThrowIfFalse(SyntaxFacts.IsPreprocessorDirective(trivia.Kind()));
TriviaDataFactory.CodeShapeAnalyzer.cs (3)
38Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 39Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.SkippedTokensTrivia); 40Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.PreprocessingMessageTrivia);
TriviaDataFactory.ComplexTrivia.cs (1)
63Contract.ThrowIfFalse(triviaList.Count > 0);
TriviaDataFactory.cs (1)
108Contract.ThrowIfFalse(space >= -1);
TriviaDataFactory.FormattedComplexTrivia.cs (3)
32Contract.ThrowIfNull(context); 33Contract.ThrowIfNull(formattingRules); 34Contract.ThrowIfNull(originalString);
TriviaDataFactory.ModifiedComplexTrivia.cs (3)
24Contract.ThrowIfNull(original); 74Contract.ThrowIfFalse(this.SecondTokenIsFirstTokenOnLine); 80Contract.ThrowIfFalse(triviaList.Count > 0);
TriviaRewriter.cs (2)
34Contract.ThrowIfNull(node); 35Contract.ThrowIfNull(map);
TypeDeclarationSyntaxExtensions.cs (1)
71Contract.ThrowIfNull(typeNode);
TypeStyleHelper.cs (1)
133Contract.ThrowIfNull(containingType);
UsingsAndExternAliasesDirectiveComparer.cs (2)
128Contract.ThrowIfNull(using1!.Name); 129Contract.ThrowIfNull(using2!.Name);
UsingsAndExternAliasesOrganizer.cs (2)
84Contract.ThrowIfNull(using1.Name); 85Contract.ThrowIfNull(using2.Name);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
50Contract.ThrowIfNull(tokens);
Microsoft.CodeAnalysis.EditorFeatures (136)
AutomaticCompletion\BraceCompletionSessionProvider.BraceCompletionSession.cs (2)
433Contract.ThrowIfFalse(SubjectBuffer.CurrentSnapshot[OpeningPoint.GetPosition(SubjectBuffer.CurrentSnapshot)] == OpeningBrace, 435Contract.ThrowIfFalse(SubjectBuffer.CurrentSnapshot[ClosingPoint.GetPosition(SubjectBuffer.CurrentSnapshot) - 1] == ClosingBrace,
BracePairs\BracePairsTaggerProvider.cs (1)
64Contract.ThrowIfNull(textView);
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (2)
62Contract.ThrowIfNull(textView); 82Contract.ThrowIfNull(textView);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (2)
272Contract.ThrowIfTrue(snapshots.IsDefault || snapshots.IsEmpty); 388Contract.ThrowIfNull(lastProcessedSnapshot);
CodeDefinitionWindow\DefinitionContextTracker.cs (4)
71Contract.ThrowIfFalse(_threadingContext.JoinableTaskContext.IsOnMainThread); 85Contract.ThrowIfFalse(_threadingContext.JoinableTaskContext.IsOnMainThread); 100Contract.ThrowIfFalse(_threadingContext.JoinableTaskContext.IsOnMainThread); 107Contract.ThrowIfFalse(_threadingContext.JoinableTaskContext.IsOnMainThread);
CommentSelection\AbstractCommentSelectionBase.cs (2)
56Contract.ThrowIfNull(undoHistoryRegistry); 57Contract.ThrowIfNull(editorOperationsFactoryService);
Diagnostics\DiagnosticsSquiggleTaggerProvider.cs (2)
131Contract.ThrowIfFalse(tag1 is RoslynErrorTag); 132Contract.ThrowIfFalse(tag2 is RoslynErrorTag);
Diagnostics\DiagnosticsSuggestionTaggerProvider.cs (2)
67Contract.ThrowIfFalse(tag1 is RoslynErrorTag); 68Contract.ThrowIfFalse(tag2 is RoslynErrorTag);
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (3)
41Contract.ThrowIfNull(uiThreadOperationExecutor); 42Contract.ThrowIfNull(undoHistoryRegistry); 43Contract.ThrowIfNull(editorOperationsFactoryService);
EditAndContinue\ActiveStatementTaggerProvider.cs (1)
108Contract.ThrowIfFalse(tag1 == tag2, "ActiveStatementTag is a supposed to be a singleton");
EditAndContinue\ActiveStatementTrackingService.cs (5)
74Contract.Fail("Can only track active statements for a single edit session."); 86Contract.ThrowIfNull(session, "Active statement tracking not started."); 270Contract.ThrowIfFalse(oldSpan.Flags == newSpan.Flags); 271Contract.ThrowIfFalse(oldSpan.Ordinal == newSpan.Ordinal); 357Contract.ThrowIfTrue(activeStatementSpans.IsDefault);
EditAndContinue\EditAndContinueLanguageService.cs (4)
90Contract.ThrowIfNull(debuggingSession); 219Contract.ThrowIfNull(committedDesignTimeSolution); 247Contract.ThrowIfNull(Interlocked.Exchange(ref _pendingUpdatedDesignTimeSolution, null)); 309Contract.ThrowIfNull(_committedDesignTimeSolution);
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
80Contract.ThrowIfNull(oldDocument.FilePath);
Editor\TextBufferAssociatedViewService.cs (1)
153Contract.ThrowIfTrue(set.Contains(view));
EditorConfigSettings\Data\CodeStyleSetting`1.cs (1)
35Contract.ThrowIfFalse(possibleValues.Length == valueDescriptions.Length);
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (1)
87Contract.ThrowIfNull(document);
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (1)
88Contract.ThrowIfNull(symbolItem.Location.OtherDocumentInfo);
Extensibility\NavigationBar\NavigationBarItem.cs (1)
75Contract.ThrowIfNull(item.TextVersion, "This should only be called for locations the caller knows to be in the open file");
ExternalAccess\VSTypeScript\VSTypeScriptInProcLanguageClient.cs (1)
91Contract.ThrowIfNull(typeScriptServerCapabilities);
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
78Contract.ThrowIfTrue(item.Spans.IsEmpty);
ExtractMethod\ExtractMethodCommandHandler.cs (4)
61Contract.ThrowIfNull(threadingContext); 62Contract.ThrowIfNull(undoManager); 63Contract.ThrowIfNull(renameService); 152Contract.ThrowIfNull(result);
FindReferences\FindReferencesCommandHandler.cs (1)
47Contract.ThrowIfNull(listenerProvider);
FindUsages\BufferedFindUsagesContext.cs (7)
62Contract.ThrowIfFalse(_gate.CurrentCount == 0); 70Contract.ThrowIfTrue(IsSwapped, "Should not be called if we've switched over to the streaming presenter"); 77Contract.ThrowIfTrue(IsSwapped, "Should not be called if we've switched over to the streaming presenter"); 84Contract.ThrowIfTrue(IsSwapped, "Should not be called if we've switched over to the streaming presenter"); 91Contract.ThrowIfTrue(IsSwapped, "Should not be called if we've switched over to the streaming presenter"); 98Contract.ThrowIfTrue(IsSwapped, "Trying to set the presenter multiple times."); 214Contract.Fail("GoToImpl/Base should never report a reference.");
GoToDefinition\GoToDefinitionCommandHandler.cs (2)
89Contract.ThrowIfNull(document); 174Contract.ThrowIfTrue(position.Snapshot.Length == 0);
InlineHints\InlineHintsDataTaggerProvider.cs (2)
67Contract.ThrowIfNull(textView); 89Contract.ThrowIfNull(textView);
InlineRename\AbstractEditorInlineRenameService.InlineRenameReplacementInfo.cs (1)
20Contract.ThrowIfFalse(conflicts.IsSuccessful);
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
64Contract.ThrowIfTrue(info.IsError);
InlineRename\InlineRenameService.cs (2)
103Contract.ThrowIfNull(snapshot, "The document used for starting the inline rename session should still be open and associated with a snapshot."); 195Contract.ThrowIfTrue(_activeRenameSession != null && value != null, "Cannot assign an active rename session when one is already in progress.");
InlineRename\InlineRenameSession.cs (3)
225Contract.ThrowIfFalse(document.TryGetText(out var text)); 226Contract.ThrowIfNull(text); 235Contract.ThrowIfNull(textSnapshot.TextBuffer);
InlineRename\UndoManagerServiceFactory.cs (1)
54Contract.ThrowIfFalse(textUndoHistoryService.TryGetTextUndoHistory(workspace, subjectBuffer, out var undoHistory));
IntelliSense\AbstractController.cs (2)
110Contract.ThrowIfFalse(IsSessionActive); 116Contract.ThrowIfTrue(IsSessionActive);
IntelliSense\AsyncCompletion\CommitManager.cs (2)
241Contract.ThrowIfNull(_languageServerSnippetExpander); 245Contract.ThrowIfNull(lspSnippetText);
IntelliSense\Helpers.cs (1)
262Contract.ThrowIfFalse(lines.Count > 0);
IntelliSense\ModelComputation.cs (2)
91Contract.ThrowIfTrue(_stopCancellationToken.IsCancellationRequested); 136Contract.ThrowIfTrue(_stopCancellationToken.IsCancellationRequested, "should not chain tasks after we've been cancelled");
IntelliSense\QuickInfo\Model.cs (1)
26Contract.ThrowIfNull(item);
IntelliSense\Session.cs (1)
44Contract.ThrowIfFalse(ReferenceEquals(this.PresenterSession, sender));
Intents\RenameIntentProvider.cs (1)
39Contract.ThrowIfNull(renameIntentData);
Interactive\InteractiveSession.cs (1)
122Contract.ThrowIfFalse(result.InitializationResult != null);
Interactive\InteractiveWorkspace.cs (1)
57Contract.ThrowIfNull(_openTextContainer);
KeywordHighlighting\HighlighterViewTaggerProvider.cs (1)
129Contract.ThrowIfFalse(tag1 == tag2, "KeywordHighlightTag is supposed to be a singleton");
Preview\AbstractPreviewFactoryService.cs (1)
651Contract.ThrowIfTrue((leftWorkspace == null) && (rightWorkspace == null));
Preview\DifferenceViewerPreview.cs (1)
20Contract.ThrowIfNull(viewer);
ReferenceHighlighting\NavigateToHighlightReferenceCommandHandler.cs (2)
82Contract.ThrowIfFalse(spans.Any(), "We should have at least found the tag under the cursor!"); 111Contract.ThrowIfFalse(destIndex >= 0, "Expected to find start tag in the collection");
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
81Contract.ThrowIfNull(document, "Invoked rename tracking smart tag but cannot find the document for the snapshot span."); 88Contract.ThrowIfNull(symbol, "Invoked rename tracking smart tag but cannot find the symbol.");
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
387Contract.ThrowIfFalse(_refCount >= 0);
Shared\Extensions\ITextSelectionExtensions.cs (2)
16Contract.ThrowIfNull(selection); 17Contract.ThrowIfNull(subjectBuffer);
Shared\Extensions\ITextViewExtensions.AutoClosingViewProperty.cs (3)
26Contract.ThrowIfTrue(textView.IsClosed); 47Contract.ThrowIfTrue(textView.IsClosed); 58Contract.ThrowIfTrue(textView.IsClosed);
Shared\Extensions\ITextViewExtensions.cs (9)
207Contract.ThrowIfNull(textView); 208Contract.ThrowIfNull(subjectBuffer); 209Contract.ThrowIfNull(valueCreator); 220Contract.ThrowIfNull(textView); 221Contract.ThrowIfNull(subjectBuffer); 232Contract.ThrowIfNull(textView); 233Contract.ThrowIfNull(subjectBuffer); 243Contract.ThrowIfNull(textView); 244Contract.ThrowIfNull(subjectBuffer);
Shared\Extensions\ITextViewExtensions.PerSubjectBufferProperty.cs (3)
35Contract.ThrowIfTrue(textView.IsClosed); 57Contract.ThrowIfTrue(textView.IsClosed); 69Contract.ThrowIfTrue(textView.IsClosed);
Shared\Extensions\IThreadingContextExtensions.cs (2)
13=> Contract.ThrowIfFalse(threadingContext.JoinableTaskContext.IsOnMainThread); 16=> Contract.ThrowIfTrue(threadingContext.JoinableTaskContext.IsOnMainThread);
Shared\Tagging\EventSources\TaggerEventSources.CaretPositionChangedEventSource.cs (2)
19Contract.ThrowIfNull(textView); 20Contract.ThrowIfNull(subjectBuffer);
Shared\Tagging\EventSources\TaggerEventSources.CompositionEventSource.cs (1)
19Contract.ThrowIfNull(providers);
Shared\Tagging\EventSources\TaggerEventSources.ReadOnlyRegionsChangedEventSource.cs (1)
19Contract.ThrowIfNull(subjectBuffer);
Shared\Tagging\EventSources\TaggerEventSources.TextChangedEventSource.cs (1)
19Contract.ThrowIfNull(subjectBuffer);
Shared\Tagging\Utilities\TagSpanIntervalTree.cs (1)
96Contract.Fail(tag + " doesn't intersects with any requested span");
Shared\Utilities\AbstractClassificationTypeMap.cs (1)
37Contract.ThrowIfNull(rawValue);
Shared\Utilities\ForegroundThreadAffinitizedObject.cs (3)
32Contract.ThrowIfFalse(threadingContext.HasMainThread); 55Contract.ThrowIfFalse(_threadingContext.JoinableTaskContext.IsOnMainThread); 59=> Contract.ThrowIfTrue(IsForeground());
Shared\Utilities\LinkedEditsTracker.cs (2)
27Contract.ThrowIfNull(subjectBuffer); 61Contract.ThrowIfTrue(MyOwnChanges(args));
Shared\Utilities\ResettableDelay.cs (1)
30Contract.ThrowIfFalse(delayInMilliseconds >= 50, "Perf, only use delays >= 50ms");
Shared\Utilities\UIThreadOperationContextProgressTracker.cs (1)
19Contract.ThrowIfNull(scope);
Shared\Utilities\VirtualTreePoint.cs (3)
21Contract.ThrowIfNull(tree); 22Contract.ThrowIfFalse(position >= 0 && position <= tree.Length); 23Contract.ThrowIfFalse(virtualSpaces >= 0);
SolutionEvents\HostLegacySolutionEventsWorkspaceEventListener.cs (1)
66Contract.ThrowIfTrue(events.Any(e => e.OldSolution.Workspace != workspace || e.NewSolution.Workspace != workspace));
Structure\AbstractStructureTaggerProvider.cs (2)
229Contract.ThrowIfFalse(tag1 is StructureTag); 230Contract.ThrowIfFalse(tag2 is StructureTag);
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (2)
263Contract.ThrowIfNull(_textView); 313Contract.ThrowIfTrue(_dataSource.Options.Any(o => o is not Option2<bool> and not PerLanguageOption2<bool>), "All options must be Option2<bool> or PerLanguageOption2<bool>");
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs (4)
24Contract.Fail($@"Should have been disposed! 40Contract.ThrowIfFalse(_taggers >= 0); 51Contract.ThrowIfFalse(_taggers > 0); 84=> Contract.ThrowIfFalse(Thread.CurrentThread == _thread);
TextStructureNavigation\AbstractTextStructureNavigatorProvider.cs (2)
26Contract.ThrowIfNull(selectorService); 27Contract.ThrowIfNull(contentTypeService);
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (3)
34Contract.ThrowIfNull(subjectBuffer); 35Contract.ThrowIfNull(naturalLanguageNavigator); 36Contract.ThrowIfNull(provider);
Workspaces\AbstractTextBufferVisibilityTracker.cs (4)
106Contract.ThrowIfFalse(_subjectBufferToCallbacks.TryGetValue(subjectBuffer, out var data)); 107Contract.ThrowIfFalse(data.Callbacks.Contains(callback)); 168Contract.ThrowIfTrue(Callbacks.Count > 0); 173Contract.ThrowIfTrue(TextViews.Count > 0);
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (36)
Controller.Session.cs (1)
33Contract.ThrowIfFalse(ReferenceEquals(this.PresenterSession, sender));
Controller.Session_SetModelSelectedItem.cs (1)
39Contract.ThrowIfFalse(model.Items.Contains(selectedItem));
Model.cs (3)
44Contract.ThrowIfNull(selectedItem); 45Contract.ThrowIfFalse(items.Count != 0, "Must have at least one item."); 46Contract.ThrowIfFalse(items.Contains(selectedItem), "Selected item must be in list of items.");
NavigableSymbolService.NavigableSymbol.cs (1)
33Contract.ThrowIfNull(location);
NavigationCommandHandlers\AbstractNavigationCommandHandler.cs (1)
29Contract.ThrowIfNull(streamingPresenters);
NavigationCommandHandlers\FindBaseSymbolsCommandHandler.cs (1)
44Contract.ThrowIfNull(listenerProvider);
NavigationCommandHandlers\FindDerivedSymbolsCommandHandler.cs (1)
43Contract.ThrowIfNull(listenerProvider);
NavigationCommandHandlers\FindExtensionMethodsCommandHandler.cs (1)
48Contract.ThrowIfNull(listenerProvider);
NavigationCommandHandlers\FindImplementingMembersCommandHandler.cs (1)
46Contract.ThrowIfNull(listenerProvider);
NavigationCommandHandlers\FindMemberOverloadsCommandHandler.cs (1)
41Contract.ThrowIfNull(listenerProvider);
NavigationCommandHandlers\FindReferencesOfOverloadsCommandHandler.cs (3)
49Contract.ThrowIfNull(streamingPresenters); 50Contract.ThrowIfNull(listenerProvider); 51Contract.ThrowIfNull(threadingContext);
Preview\ICocoaDifferenceViewerExtensions.cs (3)
79Contract.ThrowIfNull(_diffViewer.DifferenceBuffer.CurrentInlineBufferSnapshot); 117Contract.ThrowIfFalse(IsNormal(_width)); 121Contract.ThrowIfFalse(IsNormal(_height));
Preview\PreviewFactoryService.cs (1)
66Contract.ThrowIfFalse(mode == DifferenceViewMode.Inline);
SignatureHelpPresenter.SignatureHelpPresenterSession.cs (2)
103Contract.ThrowIfNull(_signatureMap); 166Contract.ThrowIfFalse(_signatureMap.TryGetKey((Signature)eventArgs.NewSelectedSignature, out var helpItem));
Snippets\AbstractSnippetExpansionClient.cs (2)
90Contract.ThrowIfNull(ExpansionSession); 114Contract.ThrowIfNull(ExpansionSession);
Snippets\CSharpSnippets\SnippetExpansionClient.cs (1)
35Contract.ThrowIfNull(ExpansionSession);
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
55Contract.ThrowIfNull(_snippetExpansionClient.ExpansionSession);
Snippets\SnippetFunctions\AbstractSnippetFunctionClassName.cs (1)
33Contract.ThrowIfNull(_snippetExpansionClient.ExpansionSession);
Snippets\SnippetFunctions\AbstractSnippetFunctionGenerateSwitchCases.cs (1)
80Contract.ThrowIfNull(_snippetExpansionClient.ExpansionSession);
Snippets\SnippetFunctions\AbstractSnippetFunctionSimpleTypeName.cs (1)
57Contract.ThrowIfNull(_snippetExpansionClient.ExpansionSession);
SuggestedAction.CaretPositionRestorer.cs (1)
34Contract.ThrowIfNull(associatedViewService);
SuggestedAction.cs (2)
56Contract.ThrowIfNull(provider); 57Contract.ThrowIfNull(codeAction);
SuggestedActionsSource.cs (2)
365Contract.ThrowIfFalse( 424Contract.ThrowIfNull(priority);
SuggestedActionsSourceProvider.cs (2)
91Contract.ThrowIfNull(textView); 92Contract.ThrowIfNull(textBuffer);
SuggestedActionWithNestedFlavors.cs (1)
80Contract.ThrowIfTrue(_nestedFlavors.IsDefault);
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (1)
Diagnostics\AbstractUserDiagnosticTest.cs (1)
93Contract.ThrowIfTrue(parameters.testHost == TestHost.OutOfProcess, $"Out-of-proc testing is not supported since {analyzer} can't be serialized.");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (36)
Completion\AbstractArgumentProviderTests`1.cs (3)
69Contract.ThrowIfNull(parameter); 104Contract.ThrowIfTrue(arguments.Any(argument => syntaxFacts.IsNamedArgument(argument)), "Named arguments are not currently supported by this test."); 105Contract.ThrowIfTrue(parameters.Any(parameter => parameter.IsParams), "'params' parameters are not currently supported by this test.");
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
37Contract.ThrowIfNull(_testDocument, "markup does not contain a cursor position"); 49Contract.ThrowIfNull(ProjectToBeModified, "Project with the given name does not exist");
EditAndContinue\ActiveStatementsDescription.cs (1)
267Contract.ThrowIfTrue(result.Any(span => span == default));
EditAndContinue\EditAndContinueTestHelpers.cs (3)
150Contract.ThrowIfNull(oldModel); 151Contract.ThrowIfNull(newModel); 350Contract.ThrowIfNull(actualSyntaxMap);
NavigateTo\NavigateToTestAggregator.Callback.cs (1)
27Contract.ThrowIfNull(options);
NavigateTo\NavigateToTestAggregator.cs (1)
26Contract.ThrowIfNull(itemProvider);
Workspaces\TestHostDocument.cs (9)
70Contract.ThrowIfNull(_id); 79Contract.ThrowIfNull(_project); 126Contract.ThrowIfNull(filePath); 195Contract.ThrowIfFalse(project.Id == this.Id.ProjectId); 226Contract.ThrowIfNull(_exportProvider, $"Can only create text view for {nameof(TestHostDocument)} created with {nameof(ExportProvider)}"); 257Contract.ThrowIfNull(_languageServiceProvider, $"To get a text buffer for a {nameof(TestHostDocument)}, it must have been parented in a project."); 278Contract.ThrowIfNull(document); 318Contract.ThrowIfNull(_initialTextSnapshot); 360Contract.ThrowIfTrue(IsSourceGenerated, "We shouldn't be producing a DocumentInfo for a source generated document.");
Workspaces\TestWorkspace.cs (14)
684Contract.ThrowIfTrue(testDocument.IsSourceGenerated); 692Contract.ThrowIfTrue(testDocument.IsSourceGenerated); 693Contract.ThrowIfFalse(IsDocumentOpen(documentId)); 702Contract.ThrowIfTrue(testDocument.IsSourceGenerated); 710Contract.ThrowIfTrue(testDocument.IsSourceGenerated); 711Contract.ThrowIfFalse(IsDocumentOpen(documentId)); 720Contract.ThrowIfTrue(testDocument.IsSourceGenerated); 728Contract.ThrowIfTrue(testDocument.IsSourceGenerated); 729Contract.ThrowIfFalse(IsDocumentOpen(documentId)); 738Contract.ThrowIfFalse(testDocument.IsSourceGenerated); 746Contract.ThrowIfFalse(testDocument.IsSourceGenerated); 747Contract.ThrowIfFalse(IsDocumentOpen(documentId)); 750Contract.ThrowIfNull(document); 829Contract.ThrowIfFalse(threadingContext.HasMainThread && threadingContext.JoinableTaskContext.IsOnMainThread);
Workspaces\TestWorkspace_XmlConsumption.cs (1)
814Contract.ThrowIfTrue(cursorPosition != null);
Workspaces\TestWorkspace_XmlCreation.cs (1)
130Contract.ThrowIfFalse(options.SpecificDiagnosticOptions.IsEmpty);
Microsoft.CodeAnalysis.EditorFeatures.Text (16)
Extensions.SnapshotSourceText.cs (6)
42Contract.ThrowIfNull(editorSnapshot); 53Contract.ThrowIfNull(textImage); 103Contract.ThrowIfFalse(editorSnapshot.TextBuffer == container.GetTextBuffer()); 230Contract.ThrowIfNull(editorSnapshot); 233Contract.ThrowIfNull(textImage); 247Contract.ThrowIfFalse(snapshot == editorSnapshot);
Extensions.TextBufferContainer.cs (1)
30Contract.ThrowIfNull(editorBuffer);
Shared\Extensions\ITextSnapshotExtensions.cs (3)
112Contract.ThrowIfNull(snapshot); 119Contract.ThrowIfNull(snapshot); 137Contract.ThrowIfNull(snapshot);
Shared\Extensions\ITextSnapshotLineExtensions.cs (6)
23Contract.ThrowIfNull(line); 45Contract.ThrowIfNull(line); 72Contract.ThrowIfNull(line, "line"); 73Contract.ThrowIfFalse(startIndex >= 0); 95Contract.ThrowIfNull(line, @"line"); 96Contract.ThrowIfNull(predicate, @"tree");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (2)
153Contract.ThrowIfNull(tagger); 201Contract.ThrowIfNull(tagger);
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
172Contract.ThrowIfNull(sessionProxy);
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (4)
77Contract.ThrowIfNull(symbol); 97Contract.ThrowIfNull(symbol); 192Contract.ThrowIfNull(assemblySymbol); 329Contract.ThrowIfNull(symbol);
Preview\PreviewWorkspaceTests.cs (2)
202Contract.ThrowIfNull(leftTagger); 203Contract.ThrowIfNull(rightTagger);
Tagging\AsynchronousTaggerTests.cs (3)
77Contract.ThrowIfNull(tagger); 103Contract.ThrowIfNull(tagger); 129Contract.ThrowIfNull(tagger);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (45)
Adornments\AbstractAdornmentManager.cs (11)
66Contract.ThrowIfNull(threadingContext); 67Contract.ThrowIfNull(textView); 68Contract.ThrowIfNull(tagAggregatorFactoryService); 69Contract.ThrowIfNull(adornmentLayerName); 70Contract.ThrowIfNull(asyncListener); 79Contract.ThrowIfFalse(textView.VisualElement.Dispatcher.CheckAccess()); 110Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess()); 142Contract.ThrowIfNull(spans); 205Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess()); 230Contract.ThrowIfNull(changedSpanCollection); 233Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess());
BackgroundWorkIndicator\BackgroundWorkIndicatorContext.cs (4)
193Contract.ThrowIfTrue(requests.IsDefault || requests.IsEmpty, "We must have gotten an actual request to process."); 194Contract.ThrowIfTrue(requests.Count > 2, "At most we can have two requests in the queue (one to update, one to dismiss)."); 195Contract.ThrowIfFalse( 264Contract.ThrowIfFalse(_scopes.Contains(scope));
BackgroundWorkIndicator\BackgroundWorkIndicatorScope.cs (1)
44Contract.ThrowIfFalse(Monitor.IsEntered(_context.Gate));
InlineDiagnostics\InlineDiagnosticsAdornmentManager.cs (3)
58Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess()); 83Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess()); 109Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess());
Interactive\InteractiveEvaluator.cs (1)
242Contract.ThrowIfNull(currentSubmissionBuffer);
Interactive\InteractiveGlobalUndoServiceFactory.cs (1)
65Contract.ThrowIfFalse(_undoHistoryRegistry.TryGetHistory(textBuffer, out var textUndoHistory));
IWpfDifferenceViewerExtensions.cs (3)
80Contract.ThrowIfNull(_diffViewer.DifferenceBuffer.CurrentInlineBufferSnapshot); 120Contract.ThrowIfFalse(IsNormal(_width)); 124Contract.ThrowIfFalse(IsNormal(_height));
LineSeparators\LineSeparatorAdornmentManager.cs (1)
27Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess());
NavigableSymbols\NavigableSymbolService.NavigableSymbol.cs (1)
33Contract.ThrowIfNull(location);
NavigateTo\NavigateToItemProvider.cs (2)
36Contract.ThrowIfNull(workspace); 37Contract.ThrowIfNull(asyncListener);
Preview\PreviewFactoryService.cs (1)
73Contract.ThrowIfFalse(mode == DifferenceViewMode.Inline);
SignatureHelp\Controller.Session.cs (1)
33Contract.ThrowIfFalse(ReferenceEquals(this.PresenterSession, sender));
SignatureHelp\Controller.Session_SetModelSelectedItem.cs (1)
39Contract.ThrowIfFalse(model.Items.Contains(selectedItem));
SignatureHelp\Model.cs (3)
44Contract.ThrowIfNull(selectedItem); 45Contract.ThrowIfFalse(items.Count != 0, "Must have at least one item."); 46Contract.ThrowIfFalse(items.Contains(selectedItem), "Selected item must be in list of items.");
SignatureHelp\Presentation\SignatureHelpPresenter.SignatureHelpPresenterSession.cs (2)
103Contract.ThrowIfNull(_signatureMap); 166Contract.ThrowIfFalse(_signatureMap.TryGetKey((Signature)eventArgs.NewSelectedSignature, out var helpItem));
StringIndentation\StringIndentationAdornmentManager.cs (1)
35Contract.ThrowIfFalse(TextView.VisualElement.Dispatcher.CheckAccess());
Suggestions\SuggestedActions\SuggestedAction.CaretPositionRestorer.cs (1)
34Contract.ThrowIfNull(associatedViewService);
Suggestions\SuggestedActions\SuggestedAction.cs (2)
56Contract.ThrowIfNull(provider); 57Contract.ThrowIfNull(codeAction);
Suggestions\SuggestedActionsSource.cs (2)
365Contract.ThrowIfFalse( 424Contract.ThrowIfNull(priority);
Suggestions\SuggestedActionsSourceProvider.cs (2)
91Contract.ThrowIfNull(textView); 92Contract.ThrowIfNull(textBuffer);
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
80Contract.ThrowIfTrue(_nestedFlavors.IsDefault);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
CodeFixes\CodeFixServiceTests.vb (2)
238Contract.ThrowIfFalse(context.Document.Project.Language = LanguageNames.CSharp) 263Contract.ThrowIfFalse(context.Document.Project.Language = LanguageNames.CSharp)
IntelliSense\SignatureHelpControllerTests.vb (1)
264Roslyn.Utilities.Contract.ThrowIfFalse(s_controllerMocksMap.TryGetValue(controller, result))
Microsoft.CodeAnalysis.ExternalAccess.Debugger (2)
GlassTestsHotReloadService.cs (2)
42Contract.ThrowIfFalse(_sessionId == default, "Session already started"); 49Contract.ThrowIfFalse(sessionId != default, "Session has not started");
Microsoft.CodeAnalysis.ExternalAccess.FSharp (6)
Internal\Editor\FSharpSmartIndentProvider.cs (2)
45Contract.ThrowIfTrue(service == null && legacyService == null); 100Contract.ThrowIfNull(_provider._legacyService);
SignatureHelp\FSharpSignatureHelpItems.cs (3)
67Contract.ThrowIfNull(items); 68Contract.ThrowIfTrue(items.IsEmpty()); 69Contract.ThrowIfTrue(selectedItem.HasValue && selectedItem.Value >= items.Count);
SignatureHelp\FSharpSignatureHelpTriggerInfo.cs (1)
18Contract.ThrowIfTrue(triggerReason == FSharpSignatureHelpTriggerReason.TypeCharCommand && triggerCharacter == null);
Microsoft.CodeAnalysis.ExternalAccess.Razor (3)
RazorCSharpFormattingInteractionService.cs (3)
41Contract.ThrowIfFalse(document.Project.Language is LanguageNames.CSharp); 67Contract.ThrowIfFalse(root.Language is LanguageNames.CSharp); 77Contract.ThrowIfFalse(root.Language is LanguageNames.CSharp);
Microsoft.CodeAnalysis.Features (402)
AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
54Contract.ThrowIfNull(symbol);
AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
78Contract.ThrowIfNull(obsoleteAttribute);
AbstractForEachCastCodeFixProvider.cs (2)
70Contract.ThrowIfNull(variableDeclarator.Symbol.Type); 71Contract.ThrowIfNull(enumerableType);
AbstractForEachCastDiagnosticAnalyzer.cs (1)
67Contract.ThrowIfFalse(option.Value is ForEachExplicitCastInSourcePreference.Always or ForEachExplicitCastInSourcePreference.WhenStronglyTyped);
AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
81Contract.ThrowIfNull(symbol);
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
110Contract.ThrowIfNull(node); 117Contract.ThrowIfNull(methodSymbol);
AbstractMakeMethodSynchronousCodeFixProvider.cs (2)
59Contract.ThrowIfNull(methodSymbol); 256Contract.ThrowIfNull(currentInvocationExpression);
AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
36Contract.ThrowIfNull(options);
AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
82Contract.ThrowIfNull(newRoot);
AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
59Contract.ThrowIfNull(symbol); 72Contract.ThrowIfNull(fieldDeclarator);
AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
485Contract.ThrowIfNull(variableDeclarator); 501Contract.ThrowIfFalse(node.GetRequiredParent().Parent is TExpressionStatementSyntax); 591Contract.ThrowIfNull(type); 592Contract.ThrowIfNull(newLocalNameOpt); 853Contract.ThrowIfNull(declStatement); 894Contract.ThrowIfNull(rootWithRemovedDeclaration);
AbstractSimplifyInterpolationHelpers.cs (3)
79Contract.ThrowIfNull(expression.SemanticModel); 139Contract.ThrowIfNull(operation.SemanticModel); 158Contract.ThrowIfNull(operation.SemanticModel);
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
94Contract.ThrowIfNull(statement);
AbstractUseNullPropagationCodeFixProvider.cs (1)
161Contract.ThrowIfNull(newWhenTrueStatement);
AbstractUseObjectInitializerCodeFixProvider.cs (1)
95Contract.ThrowIfNull(statement);
AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
80Contract.ThrowIfNull(semanticModel);
AddAccessibilityModifiersHelpers.cs (1)
17Contract.ThrowIfNull(symbol);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
72Contract.ThrowIfNull(constructorDocument);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (1)
185Contract.ThrowIfNull(changedSolution);
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
28Contract.ThrowIfFalse(fixData.Kind == AddImportFixKind.ReferenceAssemblySymbol);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
42Contract.ThrowIfFalse(fixData.Kind == AddImportFixKind.PackageSymbol);
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (1)
25Contract.ThrowIfFalse(fixData.Kind == AddImportFixKind.MetadataSymbol);
AddImport\CodeActions\ParentInstallPackageCodeAction.cs (1)
47Contract.ThrowIfFalse(fixData.Kind == AddImportFixKind.PackageSymbol);
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (1)
35Contract.ThrowIfFalse(fixData.Kind == AddImportFixKind.ProjectSymbol);
AddImport\SearchScopes\ProjectSearchScope.cs (1)
25Contract.ThrowIfFalse(project.SupportsCompilation);
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
167Contract.ThrowIfFalse(!string.IsNullOrEmpty(category)); 190Contract.ThrowIfNull(category);
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (1)
113Contract.ThrowIfNull(defaultValue);
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (1)
238Contract.ThrowIfFalse(batchOfFixes.Any());
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (4)
148Contract.ThrowIfFalse(!diagnostic.IsSuppressed); 167Contract.ThrowIfFalse(diagnostic.Location.IsInSource); 172Contract.ThrowIfNull(targetSymbol); 189Contract.ThrowIfFalse(!diagnostic.Location.IsInSource);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (2)
182Contract.ThrowIfFalse(indexOfTriviaToRemoveOrToggle >= 0); 189Contract.ThrowIfFalse(triviaToToggle != default);
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (2)
93Contract.ThrowIfNull(result); 123Contract.ThrowIfNull(localFunctionResult);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
273Contract.ThrowIfNull(symbol);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (2)
872Contract.ThrowIfNull(x); 873Contract.ThrowIfNull(y);
Completion\Providers\AbstractAwaitCompletionProvider.cs (3)
118Contract.ThrowIfTrue(dotAwaitContext == DotAwaitContext.None); 199Contract.ThrowIfFalse(dotToken.HasValue); 200Contract.ThrowIfNull(expr);
Completion\Providers\AbstractCrefCompletionProvider.cs (1)
36Contract.ThrowIfNull(semanticModel);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (4)
131Contract.ThrowIfNull(containingType); 172Contract.ThrowIfNull(targetToken); 191Contract.ThrowIfNull(position); 218Contract.ThrowIfNull(root);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
52Contract.ThrowIfNull(enclosing);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (1)
114Contract.ThrowIfNull(containingType);
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
213Contract.ThrowIfNull(context);
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
246Contract.ThrowIfNull(syntaxContext); 324Contract.ThrowIfNull(syntaxContext);
Completion\Providers\CompletionUtilities.cs (1)
47Contract.ThrowIfNull(solution);
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
98Contract.ThrowIfTrue(quotedPath[0] != '"');
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
58Contract.ThrowIfNull(snippetText);
Completion\Providers\Snippets\SnippetCompletionItem.cs (3)
47Contract.ThrowIfFalse(item.Properties.TryGetValue(SnippetIdentifierKey, out var text)); 53Contract.ThrowIfFalse(item.Properties.TryGetValue("Position", out var text)); 54Contract.ThrowIfFalse(int.TryParse(text, out var num));
Completion\Utilities.cs (1)
54Contract.ThrowIfFalse(document.SupportsSemanticModel, "Should only be called from C#/VB providers.");
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
82Contract.ThrowIfNull(document.DocumentState.ParseOptions);
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (3)
65Contract.ThrowIfTrue(placeholderIndex < 0); 236Contract.ThrowIfNull(literalExpression); 258Contract.ThrowIfTrue(placeholderIndex < 0);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
538Contract.ThrowIfNull(containingMember,
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
212Contract.ThrowIfNull(document.FilePath);
DiagnosticHelper.cs (3)
186Contract.ThrowIfTrue(additionalLocations.IsEmpty()); 187Contract.ThrowIfTrue(tagIndices.IsEmpty()); 197Contract.ThrowIfFalse(indices.All(idx => idx >= 0 && idx < additionalLocationsLength));
Diagnostics\LiveDiagnosticUpdateArgsId.cs (1)
19Contract.ThrowIfNull(projectOrDocumentId);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
115Contract.ThrowIfNull(symbol);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (51)
544Contract.ThrowIfNull(newTree); 813Contract.ThrowIfFalse(newExceptionRegions[i].IsDefault); 825Contract.ThrowIfFalse(hasPartner); 862Contract.ThrowIfFalse(statementPart == -1); 864Contract.ThrowIfNull(newStatement); 1011Contract.ThrowIfNull(oldStatementSyntax); 1332Contract.ThrowIfNull(newStatementSyntax); 2043Contract.ThrowIfNull(oldNode); 2044Contract.ThrowIfNull(newNode); 2461Contract.ThrowIfNull(symbol); 2596Contract.ThrowIfNull(oldModel); 2597Contract.ThrowIfNull(oldSymbol); 2598Contract.ThrowIfNull(oldDeclaration); 2772Contract.ThrowIfNull(newModel); 2773Contract.ThrowIfNull(newSymbol); 2774Contract.ThrowIfNull(newDeclaration); 2802Contract.ThrowIfNull(oldDeclaration); 2827Contract.ThrowIfNull(oldDeclaration); 2977Contract.ThrowIfFalse(newSymbol is INamedTypeSymbol || IsGlobalMain(newSymbol)); 2995Contract.ThrowIfNull(newContainingType); 2996Contract.ThrowIfNull(oldContainingType); 3024Contract.ThrowIfFalse(editKind == SemanticEditKind.Insert); 3032Contract.ThrowIfNull(oldModel); 3033Contract.ThrowIfNull(newModel); 3034Contract.ThrowIfNull(oldSymbol); 3035Contract.ThrowIfNull(newSymbol); 3046Contract.ThrowIfNull(oldDeclaration); 3047Contract.ThrowIfNull(newDeclaration); 3114Contract.ThrowIfFalse(editKind is SemanticEditKind.Update or SemanticEditKind.Insert); 3118Contract.ThrowIfNull(oldSymbol); 3171Contract.ThrowIfNull(oldDeclaration); 3175Contract.ThrowIfNull(newDeclaration); 3204Contract.ThrowIfNull(oldModel); 3205Contract.ThrowIfNull(newModel); 3210Contract.ThrowIfNull(newSymbol); 3211Contract.ThrowIfNull(oldSymbol); 3220Contract.ThrowIfNull(oldDeclaration); 3221Contract.ThrowIfNull(newDeclaration); 3225Contract.ThrowIfNull(oldContainingType); 3226Contract.ThrowIfNull(newContainingType); 3256Contract.ThrowIfFalse(IsConstructorWithMemberInitializers(oldDeclaration) == IsConstructorWithMemberInitializers(newDeclaration)); 3257Contract.ThrowIfFalse(IsDeclarationWithInitializer(oldDeclaration) == IsDeclarationWithInitializer(newDeclaration)); 3495Contract.ThrowIfNull(processedSymbols); 3521Contract.ThrowIfNull(processedSymbols); 3573Contract.ThrowIfNull(oldType); 3606Contract.ThrowIfNull(newType); 3911Contract.ThrowIfNull(newType.DelegateInvokeMethod); 4937Contract.ThrowIfNull(oldModel); 4939Contract.ThrowIfFalse(oldCtor is IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor }); 4972Contract.ThrowIfTrue(firstSpan.IsEmpty); 5031Contract.ThrowIfFalse(isStatic || oldCtor != null);
EditAndContinue\ActiveStatementExceptionRegions.cs (1)
24Contract.ThrowIfTrue(spans.IsDefault);
EditAndContinue\CommittedSolution.cs (5)
143Contract.ThrowIfFalse(currentDocument == null || documentId == currentDocument.Id); 222Contract.ThrowIfNull(document.FilePath); 312Contract.ThrowIfNull(document.FilePath); 382Contract.ThrowIfNull(sourceFilePath); 473Contract.ThrowIfNull(document.FilePath);
EditAndContinue\DebuggingSession.cs (3)
655Contract.ThrowIfNull(document.FilePath); 782Contract.ThrowIfNull(mappedDocument.FilePath); 904Contract.ThrowIfTrue(analysis.ActiveStatements.IsDefault);
EditAndContinue\DocumentActiveStatementChanges.cs (2)
22Contract.ThrowIfFalse(oldSpans.Length == newStatements.Length); 23Contract.ThrowIfFalse(oldSpans.Length == newExceptionRegions.Length);
EditAndContinue\EditAndContinueWorkspaceService.cs (5)
127Contract.ThrowIfTrue(captureAllMatchingDocuments && !captureMatchingDocuments.IsEmpty); 177Contract.ThrowIfNull(debuggingSession, "Debugging session has not started."); 187Contract.ThrowIfNull(debuggingSession); 217Contract.ThrowIfNull(debuggingSession); 225Contract.ThrowIfNull(debuggingSession);
EditAndContinue\EditSession.cs (11)
159Contract.ThrowIfTrue(documentAnalyses.IsEmpty); 630Contract.ThrowIfTrue(analysis.HasChangesAndErrors); 633Contract.ThrowIfTrue(analysis.ActiveStatements.IsDefault); 683Contract.ThrowIfNull(oldResolution.Symbol); 694Contract.ThrowIfNull(newResolution.Symbol); 700Contract.ThrowIfNull(newResolution.Symbol); 720Contract.ThrowIfNull(newSymbol); 980Contract.ThrowIfNull(oldCompilation); 981Contract.ThrowIfNull(newCompilation); 991Contract.ThrowIfNull(newCompilation); 1013Contract.ThrowIfNull(emitResult.Baseline);
EditAndContinue\EditSessionTelemetry.cs (1)
32Contract.ThrowIfNull(telemetry._inBreakState);
EditAndContinue\EmitSolutionUpdateResults.cs (1)
113Contract.ThrowIfNull(document);
EditAndContinue\TraceLog.cs (1)
143Contract.ThrowIfNull(_logDirectory);
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
99Contract.ThrowIfTrue(services.IsDefaultOrEmpty);
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (3)
221Contract.ThrowIfNull(startString); 222Contract.ThrowIfNull(lengthString); 223Contract.ThrowIfNull(newText);
EmbeddedLanguages\ExportEmbeddedLanguageFeatureServiceAttribute.cs (2)
57Contract.ThrowIfFalse(contractType.IsInterface && typeof(IEmbeddedLanguageFeatureService).IsAssignableFrom(contractType), 62Contract.ThrowIfFalse(name is PredefinedEmbeddedLanguageNames.Regex or PredefinedEmbeddedLanguageNames.Json,
EmbeddedLanguages\RegularExpressions\RegexParser.cs (3)
883Contract.ThrowIfFalse(comment.HasValue); 1394Contract.ThrowIfNull(last); 1741Contract.ThrowIfNull(number);
EmbeddedLanguages\StackFrame\StackFrameParser.cs (2)
90Contract.ThrowIfFalse(_lexer.Position == _lexer.Text.Length); 91Contract.ThrowIfFalse(eolToken.Kind == StackFrameKind.EndOfFrame);
EncapsulateField\AbstractEncapsulateFieldService.cs (2)
140Contract.ThrowIfTrue(fields.Length == 0); 320Contract.ThrowIfFalse(resolution.IsSuccessful);
ExternalAccess\UnitTesting\API\NewUnitTestingIncrementalAnalyzerProvider.cs (1)
45Contract.ThrowIfNull(workspaceKind);
ExternalAccess\UnitTesting\API\UnitTestingHotReloadService.cs (3)
96Contract.ThrowIfFalse(_sessionId == default, "Session already started"); 114Contract.ThrowIfFalse(sessionId != default, "Session has not started"); 155Contract.ThrowIfFalse(_sessionId != default, "Session has not started");
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (2)
59Contract.ThrowIfFalse(_processorTask == null); 90Contract.ThrowIfTrue(_isPaused_doNotAccessDirectly);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (3)
60Contract.ThrowIfNull(workspaceKind); 135Contract.ThrowIfNull(workspaceKind); 158Contract.ThrowIfNull(workspaceKind);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (10)
266Contract.ThrowIfNull(args.ProjectId); 272Contract.ThrowIfNull(args.ProjectId); 277Contract.ThrowIfNull(args.ProjectId); 282Contract.ThrowIfNull(args.DocumentId); 288Contract.ThrowIfNull(args.DocumentId); 293Contract.ThrowIfNull(args.DocumentId); 306Contract.ThrowIfNull(args.ProjectId); 704Contract.ThrowIfNull(_projectOrDocumentIds); 752Contract.ThrowIfNull(_projectOrDocumentIds); 795Contract.ThrowIfNull(_projectOrDocumentIds);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (2)
112Contract.ThrowIfNull(lowPriorityDocumentId); 118Contract.ThrowIfNull(item.DocumentId);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
122Contract.ThrowIfNull(item.DocumentId);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (3)
66Contract.ThrowIfFalse(item.DocumentId != null, "can only enqueue a document work item"); 82Contract.ThrowIfFalse(item.DocumentId != null); 273Contract.ThrowIfNull(workItem.DocumentId);
ExternalAccess\VSTypeScript\Api\VSTypeScriptDiagnosticData.cs (1)
42Contract.ThrowIfTrue(useMapped);
ExternalAccess\Watch\Api\WatchHotReloadService.cs (3)
84Contract.ThrowIfFalse(_sessionId == default, "Session already started"); 100Contract.ThrowIfFalse(sessionId != default, "Session has not started"); 119Contract.ThrowIfFalse(_sessionId != default, "Session has not started");
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
88Contract.ThrowIfNull(containingType);
ExtractClass\ExtractClassWithDialogCodeAction.cs (1)
216Contract.ThrowIfFalse(remainingResults.Count == 0);
ExtractMethod\AbstractSyntaxTriviaService.cs (6)
30Contract.ThrowIfNull(root); 31Contract.ThrowIfTrue(textSpan.IsEmpty); 37Contract.ThrowIfFalse(textSpan.Contains(tokens[TriviaLocation.AfterBeginningOfSpan].Span) && textSpan.Contains(tokens[TriviaLocation.BeforeEndOfSpan].Span)); 56Contract.ThrowIfNull(root); 57Contract.ThrowIfNull(oldTokens); 58Contract.ThrowIfNull(computeReplacementToken);
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (4)
34Contract.ThrowIfNull(root); 35Contract.ThrowIfNull(annotations); 36Contract.ThrowIfNull(triviaList); 115Contract.ThrowIfFalse(
ExtractMethod\Extensions.cs (1)
75Contract.ThrowIfNull(typeSymbol);
ExtractMethod\InsertionPoint.cs (2)
29Contract.ThrowIfNull(document); 30Contract.ThrowIfNull(annotation);
ExtractMethod\MethodExtractor.Analyzer.cs (10)
31Contract.ThrowIfNull(selectionResult); 92Contract.ThrowIfFalse(unused.Count == 0); 416Contract.ThrowIfNull(model); 417Contract.ThrowIfNull(dataFlowAnalysisData); 503Contract.ThrowIfTrue(bestEffort, "Should never fail if bestEffort is true"); 533Contract.ThrowIfNull(model); 534Contract.ThrowIfNull(type); 541Contract.ThrowIfTrue(bestEffort, "Should never fail if bestEffort is true"); 700Contract.ThrowIfTrue(SelectionResult.SelectionInExpression); 864Contract.ThrowIfFalse(parameters.Count == arguments.Count);
ExtractMethod\MethodExtractor.Analyzer.SymbolMapBuilder.cs (3)
35Contract.ThrowIfNull(semanticModel); 36Contract.ThrowIfNull(service); 37Contract.ThrowIfNull(root);
ExtractMethod\MethodExtractor.AnalyzerResult.cs (1)
135Contract.ThrowIfNull(_variableToUseAsReturnValue);
ExtractMethod\MethodExtractor.CodeGenerator.cs (6)
44Contract.ThrowIfFalse(insertionPoint.SemanticDocument == analyzerResult.SemanticDocument); 229Contract.ThrowIfTrue(AnalyzerResult.GetVariablesToSplitOrMoveOutToCallSite(cancellationToken).Any(v => v.UseAsReturnValue)); 249Contract.ThrowIfFalse(AnalyzerResult.GetVariablesToSplitOrMoveOutToCallSite(cancellationToken).Single(v => v.ReturnBehavior == ReturnBehavior.Initialization) != null); 258Contract.ThrowIfFalse(variable.ReturnBehavior == ReturnBehavior.Assignment); 296Contract.ThrowIfFalse(variableToUseAsReturnValue.ReturnBehavior is ReturnBehavior.Assignment or 309Contract.ThrowIfFalse(variable.GetDeclarationBehavior(cancellationToken) is DeclarationBehavior.MoveOut or
ExtractMethod\MethodExtractor.cs (1)
32Contract.ThrowIfNull(selectionResult);
ExtractMethod\MethodExtractor.GeneratedCode.cs (4)
22Contract.ThrowIfNull(document); 23Contract.ThrowIfNull(methodNameAnnotation); 24Contract.ThrowIfNull(callsiteAnnotation); 25Contract.ThrowIfNull(methodDefinitionAnnotation);
ExtractMethod\MethodExtractor.VariableInfo.cs (4)
38Contract.ThrowIfFalse(!_useAsReturnValue || _variableStyle.ReturnStyle.ReturnBehavior != ReturnBehavior.None); 98Contract.ThrowIfNull(variable); 99Contract.ThrowIfFalse(variable.CanBeUsedAsReturnValue); 100Contract.ThrowIfFalse(variable.ParameterModifier is ParameterBehavior.Out or ParameterBehavior.Ref);
ExtractMethod\MethodExtractor.VariableSymbol.cs (22)
112Contract.ThrowIfNull(parameterSymbol); 123Contract.ThrowIfNull(other); 136Contract.ThrowIfFalse(_parameterSymbol.Ordinal != other._parameterSymbol.Ordinal); 191Contract.ThrowIfNull(localSymbol); 192Contract.ThrowIfNull(nonNoisySet); 205Contract.ThrowIfNull(other); 212Contract.ThrowIfFalse(_localSymbol.Locations.Length == 1); 213Contract.ThrowIfFalse(other._localSymbol.Locations.Length == 1); 214Contract.ThrowIfFalse(_localSymbol.Locations[0].IsInSource); 215Contract.ThrowIfFalse(other._localSymbol.Locations[0].IsInSource); 216Contract.ThrowIfFalse(_localSymbol.Locations[0].SourceTree == other._localSymbol.Locations[0].SourceTree); 217Contract.ThrowIfFalse(_localSymbol.Locations[0].SourceSpan.Start != other._localSymbol.Locations[0].SourceSpan.Start); 234Contract.ThrowIfFalse(_localSymbol.Locations.Length == 1); 235Contract.ThrowIfFalse(_localSymbol.Locations[0].IsInSource); 236Contract.ThrowIfNull(_localSymbol.Locations[0].SourceTree); 242Contract.ThrowIfFalse(token.Span.Equals(span)); 305Contract.ThrowIfNull(symbol); 316Contract.ThrowIfNull(other); 326Contract.ThrowIfFalse(locationLeft.IsInSource); 327Contract.ThrowIfFalse(locationRight.IsInSource); 328Contract.ThrowIfFalse(locationLeft.SourceTree == locationRight.SourceTree); 329Contract.ThrowIfFalse(locationLeft.SourceSpan.Start != locationRight.SourceSpan.Start);
ExtractMethod\OperationStatus.cs (3)
17Contract.ThrowIfTrue(flag.Succeeded() && flag.HasBestEffort()); 25Contract.ThrowIfNull(reasons); 26Contract.ThrowIfTrue(flag.Succeeded() && flag.HasBestEffort());
ExtractMethod\SelectionResult.cs (3)
23Contract.ThrowIfNull(status); 103Contract.ThrowIfTrue(SelectionInExpression); 111Contract.ThrowIfTrue(SelectionInExpression);
ExtractMethod\SelectionValidator.cs (2)
34Contract.ThrowIfNull(document); 57Contract.ThrowIfNull(range);
ExtractMethod\UniqueNameGenerator.cs (3)
18Contract.ThrowIfNull(semanticModel); 24Contract.ThrowIfNull(contextNode); 25Contract.ThrowIfNull(baseName);
FindUsages\DefinitionItem.cs (3)
158Contract.ThrowIfFalse(Properties.ContainsKey(MetadataSymbolOriginatingProjectIdGuid)); 159Contract.ThrowIfFalse(Properties.ContainsKey(MetadataSymbolOriginatingProjectIdDebugName)); 250Contract.ThrowIfNull(projectId);
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
50Contract.ThrowIfNull(project);
FindUsages\IRemoteFindUsagesService.cs (2)
154Contract.ThrowIfFalse(_idToDefinition.ContainsKey(definitionId)); 182Contract.ThrowIfNull(document);
FullyQualify\AbstractFullyQualifyService.cs (2)
167Contract.ThrowIfNull(rightSide); 197Contract.ThrowIfNull(symbolResult.OriginalSymbol);
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (1)
58Contract.ThrowIfNull(_state.DelegatedConstructor);
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (2)
46Contract.ThrowIfNull(_state.ClassType); 68Contract.ThrowIfNull(classType);
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.CodeAction.cs (1)
30Contract.ThrowIfNull(state.ClassType);
GenerateMember\AbstractGenerateMemberService.cs (1)
141Contract.ThrowIfNull(attributeNode);
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
88Contract.ThrowIfNull(state.TypeToGenerateIn);
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (9)
115Contract.ThrowIfNull(TypeToGenerateIn); 187Contract.ThrowIfNull(TypeToGenerateIn); 188Contract.ThrowIfNull(TypeToGenerateIn.BaseType); 209Contract.ThrowIfNull(TypeToGenerateIn); 240Contract.ThrowIfNull(TypeToGenerateIn); 523Contract.ThrowIfNull(TypeToGenerateIn); 580Contract.ThrowIfNull(TypeToGenerateIn); 615Contract.ThrowIfNull(TypeToGenerateIn); 638Contract.ThrowIfNull(TypeToGenerateIn);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
74Contract.ThrowIfFalse(document.Project.Solution == generateTypeOptionsResult.Project.Solution);
GenerateType\AbstractGenerateTypeService.State.cs (1)
121Contract.ThrowIfNull(generateTypeServiceStateOptions.NameOrMemberAccessExpression);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
150Contract.ThrowIfNull(parameterSyntax);
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
448Contract.ThrowIfNull(parameterSymbol, "We filtered out varags methods earlier.");
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (2)
155Contract.ThrowIfNull(parameterList); 462Contract.ThrowIfNull(newMethodDeclaration);
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
113Contract.ThrowIfNull(type);
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (3)
320Contract.ThrowIfFalse(symbolGroup.Length > 0); 329Contract.ThrowIfFalse(symbolGroup.Length > 0); 731Contract.ThrowIfTrue(symbol.TypeParameterKind == TypeParameterKind.Cref);
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
41Contract.ThrowIfNull(rootNamespace);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (8)
250Contract.ThrowIfNull(workspace); 252Contract.ThrowIfFalse(threadingService.IsOnMainThread); 275Contract.ThrowIfTrue(_openedDocumentIds.ContainsKey(fileInfo)); 309Contract.ThrowIfNull(documentId); 345Contract.ThrowIfFalse(_openedDocumentIds.IsEmpty); 351Contract.ThrowIfNull(compilation, "We are trying to produce a key for a language that doesn't support compilations."); 387Contract.ThrowIfNull(filePath); 398Contract.ThrowIfNull(assemblyIdentity);
MetadataAsSource\MetadataAsSourceFileService.cs (4)
98Contract.ThrowIfNull(_workspace); 123Contract.ThrowIfFalse(threadingService.IsOnMainThread); 209Contract.ThrowIfNull(document.FilePath); 219Contract.ThrowIfNull(_workspace);
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
53Contract.ThrowIfNull(containingType);
NamingStyleCodeFixProvider.cs (1)
53Contract.ThrowIfNull(serializedNamingStyle);
NavigationBar\NavigationBarItems\RoslynNavigationBarItem.SymbolItem.cs (3)
92Contract.ThrowIfTrue(inDocumentInfo == null && otherDocumentInfo == null, "Both locations were null"); 93Contract.ThrowIfTrue(inDocumentInfo != null && otherDocumentInfo != null, "Both locations were not null"); 97Contract.ThrowIfTrue(inDocumentInfo.Value.spans.IsEmpty, "If location is in document, it must have non-empty spans");
PdbSourceDocument\PdbFileLocatorService.cs (1)
51Contract.ThrowIfNull(pdbReaderProvider);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (4)
94Contract.ThrowIfNull(telemetryMessage); 266Contract.ThrowIfNull(navigateDocument); 353Contract.ThrowIfNull(workspace); 355Contract.ThrowIfFalse(threadingService.IsOnMainThread);
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
39Contract.ThrowIfNull(options);
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
62Contract.ThrowIfNull(containingType);
Rename\SymbolicRenameInfo.cs (3)
63Contract.ThrowIfTrue(this.IsError); 90Contract.ThrowIfTrue(this.IsError); 97Contract.ThrowIfTrue(this.IsError);
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (2)
251Contract.ThrowIfNull(initializer); 319Contract.ThrowIfNull(containerWithConditionalReplaced);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
491Contract.ThrowIfFalse(x.Document == y.Document);
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (2)
124Contract.ThrowIfNull(_expression.Parent, $"Parent of {_expression} is null."); 291Contract.ThrowIfNull(_expression.Parent, $"Parent of {_expression} is null.");
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (3)
56Contract.ThrowIfNull(propertySymbol); 266Contract.ThrowIfNull(parent); 437Contract.ThrowIfFalse(x.location.Document == y.location.Document);
SignatureHelp\SignatureHelpItems.cs (3)
65Contract.ThrowIfNull(items); 66Contract.ThrowIfTrue(items.IsEmpty()); 67Contract.ThrowIfTrue(selectedItem.HasValue && selectedItem.Value >= items.Count);
SignatureHelp\SignatureHelpTriggerInfo.cs (1)
17Contract.ThrowIfTrue(triggerReason == SignatureHelpTriggerReason.TypeCharCommand && triggerCharacter == null);
SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
82Contract.ThrowIfNull(options);
Snippets\AbstractSnippetService.cs (1)
39Contract.ThrowIfFalse(_identifierToProviderMap.ContainsKey(snippetIdentifier));
Snippets\RoslynLSPSnippetConverter.cs (2)
39Contract.ThrowIfNull(textChangeText); 129Contract.ThrowIfNull(textChangeText);
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
108Contract.ThrowIfNull(snippetExpressionNode);
Snippets\SnippetProviders\AbstractConstructorSnippetProvider.cs (1)
38Contract.ThrowIfNull(containingType);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (3)
113Contract.ThrowIfNull(caretTarget); 114Contract.ThrowIfNull(mainChangeNode); 234Contract.ThrowIfNull(snippetExpressionNode);
SolutionCrawler\AbstractDocumentDifferenceService.cs (2)
68Contract.ThrowIfNull(oldRoot); 69Contract.ThrowIfNull(newRoot);
SolutionCrawler\IdleProcessor.cs (2)
59Contract.ThrowIfFalse(_processorTask == null); 90Contract.ThrowIfTrue(_isPaused_doNotAccessDirectly);
SolutionCrawler\SolutionCrawlerRegistrationService.cs (2)
77Contract.ThrowIfNull(workspace.Kind); 137Contract.ThrowIfNull(workspace.Kind);
SolutionCrawler\WorkCoordinator.AsyncDocumentWorkItemQueue.cs (2)
91Contract.ThrowIfNull(lowPriorityDocumentId); 97Contract.ThrowIfNull(item.DocumentId);
SolutionCrawler\WorkCoordinator.cs (10)
215Contract.ThrowIfNull(args.ProjectId); 220Contract.ThrowIfNull(args.ProjectId); 226Contract.ThrowIfNull(args.ProjectId); 231Contract.ThrowIfNull(args.DocumentId); 236Contract.ThrowIfNull(args.DocumentId); 242Contract.ThrowIfNull(args.DocumentId); 255Contract.ThrowIfNull(args.ProjectId); 637Contract.ThrowIfNull(_projectOrDocumentIds); 685Contract.ThrowIfNull(_projectOrDocumentIds); 728Contract.ThrowIfNull(_projectOrDocumentIds);
SolutionCrawler\WorkCoordinator.HighPriorityProcessor.cs (4)
82Contract.ThrowIfFalse(item.DocumentId != null, "can only enqueue a document work item"); 116Contract.ThrowIfNull(item.DocumentId); 144Contract.ThrowIfFalse(GetNextWorkItem(out var workItem, out var documentCancellation)); 184Contract.ThrowIfNull(workItem.DocumentId);
SolutionCrawler\WorkCoordinator.IncrementalAnalyzerProcessor.cs (1)
106Contract.ThrowIfNull(item.DocumentId);
SolutionCrawler\WorkCoordinator.NormalPriorityProcessor.cs (3)
65Contract.ThrowIfFalse(item.DocumentId != null, "can only enqueue a document work item"); 81Contract.ThrowIfFalse(item.DocumentId != null); 259Contract.ThrowIfNull(workItem.DocumentId);
SymbolMapping\SymbolMappingResult.cs (2)
16Contract.ThrowIfNull(project); 17Contract.ThrowIfNull(symbol);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
143Contract.ThrowIfFalse(resolution.IsSuccessful); 156Contract.ThrowIfTrue(fieldSymbol == null || propertySymbol == null); 225Contract.ThrowIfNull(newFieldTreeRoot);
UseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
73Contract.ThrowIfNull(expression); // checked in analyzer.
UseExplicitTupleNameCodeFixProvider.cs (1)
50Contract.ThrowIfNull(preferredName);
ValueTracking\SerializableValueTrackedItem.cs (1)
57Contract.ThrowIfNull(symbolResolution.Symbol);
ValueTracking\ValueTrackedItem.cs (1)
51Contract.ThrowIfNull(location.SourceTree);
Wrapping\AbstractCodeActionComputer.cs (2)
232Contract.ThrowIfNull(nodeToFormat); 264Contract.ThrowIfNull(rewrittenRoot);
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (1)
312Contract.ThrowIfFalse(comma.IsToken);
Microsoft.CodeAnalysis.LanguageServer.Protocol (93)
Extensions\Extensions.cs (1)
27Contract.ThrowIfNull(document.FilePath);
Extensions\ProtocolConversions.cs (8)
114Contract.ThrowIfNull(context.TriggerCharacter); 115Contract.ThrowIfFalse(char.TryParse(context.TriggerCharacter, out var triggerChar)); 126Contract.ThrowIfNull(context.TriggerCharacter); 127Contract.ThrowIfFalse(char.TryParse(context.TriggerCharacter, out var triggerChar)); 143Contract.ThrowIfTrue(position < 1); 212Contract.ThrowIfNull(textChange.NewText); 274Contract.ThrowIfNull(textDiffService); 819Contract.ThrowIfFalse(textSpans.Length == mappedSpanResult.Length,
Features\CodeCleanup\AbstractCodeCleanupService.cs (1)
189Contract.ThrowIfNull(solution);
Features\CodeFixes\CodeFixService.cs (3)
315Contract.ThrowIfNull(solution); 962Contract.ThrowIfNull(x); 963Contract.ThrowIfNull(y);
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (3)
49Contract.ThrowIfFalse(diagnostics.All(d => d.DocumentId != null)); 57Contract.ThrowIfFalse(diagnostics.All(d => d.DocumentId != null)); 72Contract.ThrowIfFalse(diagnostics.All(d => d.DocumentId == null));
Features\Diagnostics\DiagnosticService.cs (1)
314Contract.ThrowIfNull(workspace);
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
67Contract.ThrowIfFalse(AnalysisScope.Analyzers.Contains(analyzer));
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
154Contract.ThrowIfFalse(project.SupportsCompilation); 192Contract.ThrowIfFalse(project.TryGetCompilation(out var compilation2)); 193Contract.ThrowIfFalse(compilation1 == compilation2);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ActiveFileState.cs (1)
65Contract.ThrowIfFalse(data.OldItems.IsDefault);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (1)
124Contract.ThrowIfFalse(project.Id == result.ProjectId);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.CompilationManager.cs (1)
89Contract.ThrowIfFalse(compilation.Analyzers.SetEquals(stateSets.Select(s => s.Analyzer).Where(a => !a.IsWorkspaceDiagnosticAnalyzer())));
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (5)
54Contract.ThrowIfNull(analyzerService); 167Contract.ThrowIfFalse(project.Solution.Workspace == Workspace); 181Contract.ThrowIfFalse(solution == null || solution.Workspace == Workspace); 194Contract.ThrowIfFalse(document.Project.Solution.Workspace == Workspace); 208Contract.ThrowIfFalse(solution == null || solution.Workspace == Workspace);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
319Contract.ThrowIfFalse(member.FullSpan.Start == oldSpan.Start);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InMemoryStorage.cs (1)
67=> Contract.ThrowIfFalse(key.key is DocumentId or ProjectId);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (1)
73Contract.ThrowIfFalse(!compilationWithAnalyzers.Analyzers.IsEmpty);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (8)
56Contract.ThrowIfFalse(lastResult.ProjectId == project.Id); 117Contract.ThrowIfFalse(lastResult.ProjectId == document.Project.Id); 158Contract.ThrowIfFalse(lastResult.ProjectId == project.Id); 192Contract.ThrowIfTrue(result.IsAggregatedForm); 193Contract.ThrowIfNull(result.DocumentIds); 242Contract.ThrowIfFalse(state.DocumentId == document.Id); 352Contract.ThrowIfFalse(document == null || document.Project == project); 413Contract.ThrowIfFalse(document == null || document.Project == project);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (1)
301Contract.ThrowIfFalse(set.Add((stateSet.Language, stateSet.StateName)));
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
222Contract.ThrowIfFalse(kind == AnalysisKind.NonLocal);
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
65Contract.ThrowIfNull(tree);
Handler\CodeActions\CodeActionResolveHandler.cs (4)
81Contract.ThrowIfNull(codeActionToResolve); 181Contract.ThrowIfNull(oldTextDoc); 182Contract.ThrowIfNull(newTextDoc); 192Contract.ThrowIfNull(textDiffService);
Handler\CodeActions\CodeActionsHandler.cs (1)
56Contract.ThrowIfNull(document);
Handler\CodeLens\CodeLensResolveHandler.cs (2)
77Contract.ThrowIfNull(resolveData, "Missing data for code lens resolve request"); 80Contract.ThrowIfNull(cacheEntry, "Missing cache entry for code lens resolve request");
Handler\Completion\CompletionHandler.cs (3)
66Contract.ThrowIfNull(document); 67Contract.ThrowIfNull(context.Solution); 284Contract.ThrowIfNull(mostUsedCommitCharacters);
Handler\Completion\CompletionResolveHandler.cs (5)
100Contract.ThrowIfTrue(completionItem.InsertText != null); 101Contract.ThrowIfTrue(completionItem.TextEdit != null); 148Contract.ThrowIfNull(newText); 182Contract.ThrowIfNull(request.Data); 186Contract.Fail("Result id should always be provided when resolving a completion item we returned.");
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (6)
138Contract.ThrowIfFalse(diagnosticMode == DiagnosticMode.LspPull, $"{diagnosticMode} is not pull"); 208Contract.ThrowIfNull(context.Solution); 287Contract.ThrowIfFalse(diagnostics.IsEmpty); 344Contract.ThrowIfNull(diagnostic.Tags, $"diagnostic {diagnostic.Identifier} was missing tags"); 369Contract.ThrowIfNull(diagnosticData.Message, $"Got a document diagnostic that did not have a {nameof(diagnosticData.Message)}"); 503Contract.ThrowIfNull(diagnosticData.Language, $"diagnostic {diagnosticData.Id} is missing a language");
Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (2)
141Contract.ThrowIfNull(context.Solution); 165Contract.ThrowIfNull(context.Solution);
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (2)
67Contract.ThrowIfNull(snippets, $"Did not find any code snippets in {filePath}"); 276Contract.ThrowIfFalse(snippetParts.Any());
Handler\InlineCompletions\XmlSnippetParser.cs (1)
70Contract.ThrowIfFalse(matchingSnippet.IsExpansionSnippet(), "Only expansion snippets are supported");
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (2)
35Contract.ThrowIfNull(context.Workspace); 36Contract.ThrowIfNull(context.Solution);
Handler\References\FindAllReferencesHandler.cs (2)
55Contract.ThrowIfNull(document); 56Contract.ThrowIfNull(workspace);
Handler\Rename\RenameHandler.cs (1)
41Contract.ThrowIfNull(document);
Handler\RequestContext.cs (1)
217Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(documentUri), $"Attempted to get text for {documentUri} which is not open.");
Handler\RequestMetrics.cs (1)
49Contract.ThrowIfNull(_queuedDuration, "RecordExecutionStart was not called");
Handler\SemanticTokens\SemanticTokensHelpers.cs (4)
183Contract.ThrowIfTrue(numLinesInSpan < 1); 287Contract.ThrowIfTrue(deltaLine < 0, $"deltaLine is less than 0: {deltaLine}"); 302Contract.ThrowIfFalse(tokenLength > 0); 356Contract.ThrowIfFalse(tokenTypesToIndex.TryGetValue(tokenTypeStr, out var tokenTypeIndex), "No matching token type index found.");
Handler\SemanticTokens\SemanticTokensRangeHandler.cs (2)
36Contract.ThrowIfNull(request.TextDocument); 45Contract.ThrowIfNull(request.TextDocument, "TextDocument is null.");
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
164Contract.ThrowIfNull(_semanticTokenRefreshQueue);
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (2)
134Contract.ThrowIfNull(context.Solution); 171Contract.ThrowIfNull(context.Solution);
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
33Contract.ThrowIfNull(context.Solution);
Handler\Symbols\WorkspaceSymbolsHandler.cs (1)
56Contract.ThrowIfNull(context.Solution);
LspServices\ExportLspServiceFactoryAttribute.cs (1)
41Contract.ThrowIfFalse(type.GetInterfaces().Contains(typeof(ILspService)), $"{type.Name} does not inherit from {nameof(ILspService)}");
LspServices\ExportStatelessLspServiceAttribute.cs (1)
41Contract.ThrowIfFalse(type.GetInterfaces().Contains(typeof(ILspService)), $"{type.Name} does not inherit from {nameof(ILspService)}");
LspServices\LspServices.cs (1)
58Contract.ThrowIfNull(service, $"Missing required LSP service {typeof(T).FullName}");
Workspaces\LspWorkspaceManager.cs (3)
99Contract.ThrowIfTrue(_trackedDocuments.ContainsKey(uri), $"didOpen received for {uri} which is already open."); 116Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(uri), $"didClose received for {uri} which is not open."); 136Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(uri), $"didChange received for {uri} which is not open.");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (10)
CodeActions\RunCodeActionsTests.cs (1)
76Contract.ThrowIfNull(result);
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (1)
105Contract.ThrowIfNull(lspDocument);
InlineCompletions\InlineCompletionsTests.cs (1)
308Contract.ThrowIfNull(response);
InlineCompletions\TestSnippetInfoService.cs (1)
37Contract.ThrowIfNull(snippets);
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (3)
151Contract.ThrowIfNull(miscWorkspace); 152Contract.ThrowIfNull(miscDocument); 226Contract.ThrowIfNull(result);
Ordering\RequestOrderingTests.cs (2)
260Contract.ThrowIfNull(response); 264Contract.ThrowIfNull(solution);
SemanticTokens\AbstractSemanticTokensTests.cs (1)
32Contract.ThrowIfNull(result);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (5)
Generator.cs (1)
106Contract.ThrowIfNull(projectPath);
Graph\Edge.cs (2)
34Contract.ThrowIfTrue(IsEdgeLabelOneToMany(label)); 42Contract.ThrowIfFalse(IsEdgeLabelOneToMany(label));
Program.cs (1)
107Contract.ThrowIfNull(binLog);
VisualStudioMefHostServices.cs (1)
28Contract.ThrowIfNull(exportProvider);
Microsoft.CodeAnalysis.Remote.ServiceHub (53)
AbstractCloudCachePersistentStorageService.cs (1)
31Contract.ThrowIfTrue(string.IsNullOrWhiteSpace(workingFolderPath));
AbstractWorkspaceTelemetryService.cs (1)
26Contract.ThrowIfFalse(CurrentSession is null);
Host\IGlobalServiceBroker.cs (1)
45Contract.ThrowIfNull(s_instance, "Global service broker not registered");
Host\RemoteDocumentDifferenceService.cs (2)
64Contract.ThrowIfNull(oldRoot); 65Contract.ThrowIfNull(newRoot);
Host\RemoteWorkspace.cs (4)
112Contract.ThrowIfNull(solutionChecksum); 113Contract.ThrowIfTrue(solutionChecksum == Checksum.Null); 147Contract.ThrowIfTrue(inFlightSolution.InFlightCount < 1); 163Contract.ThrowIfTrue(inFlightSolution.InFlightCount < 1);
Host\RemoteWorkspace.InFlightSolution.cs (13)
59Contract.ThrowIfFalse(workspace._gate.CurrentCount == 0); 81Contract.ThrowIfFalse(_workspace._gate.CurrentCount == 0); 90Contract.ThrowIfFalse(_workspace._gate.CurrentCount == 0); 109Contract.ThrowIfFalse(_workspace._gate.CurrentCount == 0); 110Contract.ThrowIfNull(updatePrimaryBranchAsync); 111Contract.ThrowIfTrue(this._cancellationTokenSource_doNotAccessDirectly.IsCancellationRequested); 146Contract.ThrowIfFalse(_workspace._gate.CurrentCount == 0); 147Contract.ThrowIfTrue(InFlightCount < 1); 160Contract.ThrowIfFalse(_workspace._gate.CurrentCount == 0); 161Contract.ThrowIfTrue(InFlightCount < 1); 170Contract.ThrowIfFalse(_workspace._solutionChecksumToSolution.TryGetValue(SolutionChecksum, out var existingSolution)); 171Contract.ThrowIfFalse(existingSolution == this); 174Contract.ThrowIfFalse(_workspace._solutionChecksumToSolution.Remove(SolutionChecksum));
Host\RemoteWorkspace.SolutionCreator.cs (14)
71Contract.ThrowIfFalse(solution.Id == newSolutionInfo.Id && solution.FilePath == newSolutionInfo.FilePath); 179Contract.ThrowIfTrue(oldProjectChecksums.Checksum == newProjectChecksums.Checksum); 299Contract.ThrowIfFalse(project.State.ProjectInfo.Attributes.Id == newProjectAttributes.Id); 300Contract.ThrowIfFalse(project.State.ProjectInfo.Attributes.Language == newProjectAttributes.Language); 301Contract.ThrowIfFalse(project.State.ProjectInfo.Attributes.IsSubmission == newProjectAttributes.IsSubmission); 418Contract.ThrowIfTrue(oldDocumentChecksums.Checksum == newDocumentChecksums.Checksum); 421Contract.ThrowIfNull(document); 477Contract.ThrowIfFalse(document.State.Attributes.Id == newDocumentInfo.Id); 478Contract.ThrowIfFalse(document.State.Attributes.Name == newDocumentInfo.Name); 479Contract.ThrowIfFalse(document.State.Attributes.FilePath == newDocumentInfo.FilePath); 480Contract.ThrowIfFalse(document.State.Attributes.IsGenerated == newDocumentInfo.IsGenerated); 481Contract.ThrowIfFalse(document.State.Attributes.DesignTimeOnly == newDocumentInfo.DesignTimeOnly); 486Contract.ThrowIfFalse(document is Document); 493Contract.ThrowIfFalse(document is Document);
Host\RemoteWorkspace_SolutionCaching.cs (9)
44Contract.ThrowIfFalse(_gate.CurrentCount == 0); 51Contract.ThrowIfTrue(solution.InFlightCount < 1); 67Contract.ThrowIfFalse(_gate.CurrentCount == 0); 72Contract.ThrowIfTrue(solution.InFlightCount < 1); 76Contract.ThrowIfTrue(solution.InFlightCount < 2); 93Contract.ThrowIfFalse(solution.InFlightCount == 1); 103Contract.ThrowIfFalse(_gate.CurrentCount == 0); 111Contract.ThrowIfTrue(solution.InFlightCount < 1); 112Contract.ThrowIfTrue(solutionChecksum != solution.SolutionChecksum);
Host\Storage\RemoteCloudCachePersistentStorageService.cs (1)
63Contract.ThrowIfNull(cacheService);
Services\BrokeredServiceBase.cs (1)
60Contract.ThrowIfNull(traceSource);
Services\BrokeredServiceBase.FactoryBase.cs (1)
133Contract.ThrowIfNull(descriptor.ClientInterface);
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
247Contract.ThrowIfNull(analyzerId);
Services\NavigationBar\RemoteNavigationBarItemService.cs (1)
33Contract.ThrowIfNull(document);
Services\ProcessTelemetry\RemoteWorkspaceConfigurationService.cs (1)
34Contract.ThrowIfFalse(_options == null);
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
35Contract.ThrowIfNull(document);
TelemetryLogger.cs (1)
141Contract.ThrowIfFalse(_pendingScopes.TryRemove(blockId, out var scope));
Microsoft.CodeAnalysis.Remote.Workspaces (25)
BrokeredServiceConnection.cs (8)
68Contract.ThrowIfFalse((callbackDispatcher == null) == (serviceDescriptor.ClientInterface == null)); 98Contract.ThrowIfNull(service); 137Contract.ThrowIfFalse(_callbackDispatcher is not null); 154Contract.ThrowIfFalse(_callbackDispatcher is not null); 238Contract.ThrowIfFalse(_callbackDispatcher is not null); 257Contract.ThrowIfFalse(_callbackDispatcher is not null); 276Contract.ThrowIfFalse(_callbackDispatcher is not null); 295Contract.ThrowIfFalse(_callbackDispatcher is not null);
RemoteCallback.cs (1)
54Contract.ThrowIfNull(rental.Proxy);
RemoteHostAssetSerialization.cs (3)
101Contract.ThrowIfFalse(solutionChecksum == responseSolutionChecksum); 104Contract.ThrowIfFalse(count == checksums.Count); 109Contract.ThrowIfFalse(checksums.Contains(responseChecksum));
Serialization\MessagePackFormatters.cs (1)
74Contract.ThrowIfFalse(reader.ReadArrayHeader() == 2);
ServiceDescriptors.cs (4)
107Contract.ThrowIfFalse(serviceInterface.IsInterface); 109Contract.ThrowIfFalse(interfaceName.StartsWith(InterfaceNamePrefix, StringComparison.Ordinal)); 110Contract.ThrowIfFalse(interfaceName.EndsWith(InterfaceNameSuffix, StringComparison.Ordinal)); 117Contract.ThrowIfFalse(callbackInterface == null || callbackInterface.IsInterface);
SolutionAsset.cs (1)
38Contract.ThrowIfTrue(kind is WellKnownSynchronizationKind.SourceText);
SolutionAssetStorage.cs (3)
71Contract.ThrowIfTrue(scope.RefCount <= 0); 88Contract.ThrowIfTrue(existingScope != scope); 90Contract.ThrowIfTrue(scope.RefCount <= 0);
SolutionAssetStorage.Scope.cs (3)
84Contract.ThrowIfTrue(result.Count != numberOfChecksumsToSearch); 102Contract.ThrowIfTrue(resultPool.Object.Count != 1); 105Contract.ThrowIfFalse(checksum == resultingChecksum);
VisualStudioMefHostServices.cs (1)
28Contract.ThrowIfNull(exportProvider);
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (10)
AutomaticEndConstructCorrection\AutomaticEndConstructCorrector.vb (2)
26Contract.ThrowIfNull(subjectBuffer) 292Contract.ThrowIfFalse(positionInText >= 0)
AutomaticEndConstructCorrection\LetterOnlyTrackingSpan.vb (1)
20Contract.ThrowIfNull(span.Snapshot)
EndConstructGeneration\SpitLinesResult.vb (1)
25Contract.ThrowIfFalse(_lines.Any(Function(line) String.IsNullOrWhiteSpace(line)))
LineCommit\CommitBufferManager.DirtyState.vb (2)
15Contract.ThrowIfNull(baseDocument) 16Contract.ThrowIfNull(baseSnapshot)
LineCommit\CommitBufferManager.vb (4)
48Contract.ThrowIfNull(buffer) 49Contract.ThrowIfNull(commitFormatter) 50Contract.ThrowIfNull(inlineRenameService) 333Contract.ThrowIfNull(manager)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (2)
Utils.vb (2)
116Contract.ThrowIfNull(syntaxTree) 117Contract.ThrowIfNull(node)
Microsoft.CodeAnalysis.VisualBasic.Features (67)
Completion\KeywordRecommenders\Expressions\TrueFalseKeywordRecommender.vb (1)
33Contract.ThrowIfNull(typeInferenceService, NameOf(typeInferenceService))
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (7)
661Contract.ThrowIfNull(oldDeclaration.Parent) 662Contract.ThrowIfNull(newDeclaration.Parent) 1048Contract.ThrowIfFalse(node.IsParentKind(SyntaxKind.ParameterList, SyntaxKind.TypeParameterList)) 1199Contract.ThrowIfFalse(parent.Parent.IsKind(SyntaxKind.FieldDeclaration)) 1330Contract.ThrowIfNull(oldNode) 1331Contract.ThrowIfNull(newNode) 1332Contract.ThrowIfNull(oldModel)
ExtractMethod\Extensions.vb (7)
28Contract.ThrowIfNull(node) 40Contract.ThrowIfNull(node) 57Contract.ThrowIfNull(node) 58Contract.ThrowIfNull(statement) 300Contract.ThrowIfNull(node) 326Contract.ThrowIfNull(node) 373Contract.ThrowIfNull(tuple.Item1)
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (2)
33Contract.ThrowIfFalse(style.ParameterStyle.DeclarationBehavior = DeclarationBehavior.MoveIn OrElse style.ParameterStyle.DeclarationBehavior = DeclarationBehavior.SplitIn) 50Contract.ThrowIfTrue(variable.UseAsReturnValue)
ExtractMethod\VisualBasicMethodExtractor.PostProcessor.vb (6)
17Contract.ThrowIfNull(semanticModel) 59Contract.ThrowIfNull(statement) 60Contract.ThrowIfFalse(statement.Declarators.Count = 1) 65Contract.ThrowIfNull(type) 74Contract.ThrowIfFalse(keyValuePair.Value.Count > 0) 100Contract.ThrowIfNull(statement)
ExtractMethod\VisualBasicMethodExtractor.vb (3)
32Contract.ThrowIfFalse(originalSpanStart >= 0) 54Contract.ThrowIfNull(enclosingTopLevelNode) 89Contract.ThrowIfNull(type)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (13)
27Contract.ThrowIfNull(outmostCallSiteContainer) 28Contract.ThrowIfNull(variableToRemoveMap) 29Contract.ThrowIfNull(firstStatementOrFieldToReplace) 30Contract.ThrowIfNull(lastStatementOrFieldToReplace) 31Contract.ThrowIfTrue(statementsOrFieldToInsert.IsEmpty()) 41Contract.ThrowIfFalse(Me._firstStatementOrFieldToReplace.Parent Is Me._lastStatementOrFieldToReplace.Parent) 70Contract.ThrowIfFalse(expressionStatements.Count = 0) 74Contract.ThrowIfFalse(expressionStatements.Count = 0) 310Contract.ThrowIfNull(statement) 317Contract.ThrowIfFalse(Me._statementsOrFieldToInsert.Count() = 1) 327Contract.ThrowIfFalse(Me._firstStatementOrFieldToReplace Is Me._lastStatementOrFieldToReplace) 332Contract.ThrowIfFalse(lastStatementIndex >= 0) 334Contract.ThrowIfFalse(firstStatementIndex <= lastStatementIndex)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (4)
71Contract.ThrowIfFalse(IsExtractMethodOnExpression(VBSelectionResult)) 102Contract.ThrowIfNull(container) 103Contract.ThrowIfFalse(container.IsStatementContainerNode() OrElse 123Contract.ThrowIfTrue(
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.MultipleStatementsCodeGenerator.vb (3)
29Contract.ThrowIfFalse(firstUnderContainer.Parent Is lastUnderContainer.Parent) 51Contract.ThrowIfFalse(firstStatementIndex >= 0) 54Contract.ThrowIfFalse(lastStatementIndex >= 0)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.SingleStatementCodeGenerator.vb (1)
40Contract.ThrowIfFalse(IsExtractMethodOnSingleStatement(VBSelectionResult))
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (6)
50Contract.ThrowIfFalse(Me.SemanticDocument Is selectionResult.SemanticDocument) 96Contract.ThrowIfFalse(firstStatementToRemove.Parent Is lastStatementToRemove.Parent) 133Contract.ThrowIfTrue(AnalyzerResult.MethodTypeParametersInDeclaration.Count = 0) 151Contract.ThrowIfNull(declStatement) 152Contract.ThrowIfFalse(declStatement.Parent.IsStatementContainerNode()) 439Contract.ThrowIfTrue(Me.AnalyzerResult.HasVariableToUseAsReturnValue)
ExtractMethod\VisualBasicSelectionResult.vb (9)
31Contract.ThrowIfNull(document) 118Contract.ThrowIfNull(Me.SemanticDocument) 126Contract.ThrowIfNull(scope, "Should always find an expression given that SelectionInExpression was true") 228Contract.ThrowIfTrue(SelectionInExpression) 246Contract.ThrowIfNull(statement) 252Contract.ThrowIfTrue(SelectionInExpression) 261Contract.ThrowIfNull(lastStatement) 262Contract.ThrowIfFalse(lastStatement.Parent Is (GetFirstStatementUnderContainer()).Parent) 268Contract.ThrowIfFalse(SelectionInExpression)
ExtractMethod\VisualBasicSelectionValidator.vb (1)
653Contract.ThrowIfFalse(line.LineNumber > 0)
LineSeparators\VisualBasicLineSeparatorService.vb (2)
104Contract.ThrowIfNull(spans) 152Contract.ThrowIfNull(node)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
44Contract.ThrowIfNull(semanticModel)
VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
65Contract.ThrowIfFalse(operand.IsKind(SyntaxKind.TypeOfIsExpression))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (42)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (2)
203Contract.ThrowIfNull(methodDeclaration) 204Contract.ThrowIfNull(_semanticModel)
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (2)
384Contract.ThrowIfFalse(index >= 0) 477Contract.ThrowIfFalse(originalModifiers.Count > 0)
Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.vb (1)
55Contract.ThrowIfFalse(SyntaxFacts.IsPreprocessorDirective(trivia.Kind))
Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb (2)
38Contract.ThrowIfTrue(trivia.Kind = SyntaxKind.EndOfLineTrivia) 39Contract.ThrowIfTrue(trivia.Kind = SyntaxKind.SkippedTokensTrivia)
Formatting\Engine\Trivia\TriviaDataFactory.ComplexTrivia.vb (2)
22Contract.ThrowIfNull(treeInfo) 64Contract.ThrowIfFalse(list.Count > 0)
Formatting\Engine\Trivia\TriviaDataFactory.FormattedComplexTrivia.vb (3)
27Contract.ThrowIfNull(context) 28Contract.ThrowIfNull(formattingRules) 29Contract.ThrowIfNull(originalString)
Formatting\Engine\Trivia\TriviaDataFactory.LineContinuationTrivia.vb (1)
26Contract.ThrowIfFalse(Me.SecondTokenIsFirstTokenOnLine)
Formatting\Engine\Trivia\TriviaDataFactory.ModifiedComplexTrivia.vb (3)
19Contract.ThrowIfNull(original) 71Contract.ThrowIfFalse(Me.SecondTokenIsFirstTokenOnLine) 77Contract.ThrowIfFalse(list.Count > 0)
Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (2)
24Contract.ThrowIfNull(node) 25Contract.ThrowIfNull(map)
Formatting\Engine\Trivia\TriviaDataFactory.vb (3)
103Contract.ThrowIfFalse(lineBreaks = 1) 117Contract.ThrowIfFalse(indentation >= 0 AndAlso indentation < s_lineContinuationCacheSize) 153Contract.ThrowIfFalse(space >= -1)
Formatting\Engine\Trivia\VisualBasicTriviaFormatter.vb (1)
296Contract.ThrowIfFalse(singlelineDocCommentTrivia.Count = 1)
Formatting\Engine\VisualBasicFormatEngine.vb (1)
34Contract.ThrowIfNull(tokenStream)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb\SyntaxTreeExtensions.vb (1)
239Contract.ThrowIfNull(syntaxTree)
SemanticModelReuse\VisualBasicSemanticModelReuseLanguageService.vb (2)
30Contract.ThrowIfFalse(TypeOf container Is PropertyBlockSyntax OrElse 36Contract.ThrowIfFalse(TypeOf member Is PropertyBlockSyntax OrElse
Simplification\Reducers\AbstractVisualBasicReducer.AbstractReductionRewriter.vb (1)
53Contract.ThrowIfNull(ParseOptions)
Simplification\Simplifiers\ExpressionSimplifier.vb (1)
202Contract.Fail("QualifiedName Left = " + qualifiedName.Left.ToString() + " and QualifiedName Right = " + qualifiedName.Right.ToString() + " . Left is tried to be replaced with the PredefinedType " + replacementNode.ToString())
Simplification\VisualBasicSimplificationService.vb (4)
78Contract.ThrowIfNull(nodeToSpeculate) 79Contract.ThrowIfNull(originalNode) 96Contract.ThrowIfFalse(originalMethod.Statements.Any(), "How did empty method body get reduced?") 114Contract.ThrowIfFalse(SpeculationAnalyzer.CanSpeculateOnNode(nodeToSpeculate))
StringExtensions.vb (2)
62Contract.ThrowIfNull(text) 91Contract.ThrowIfNull(text)
SyntaxNodeExtensions.vb (2)
114Contract.ThrowIfNull(node) 115Contract.ThrowIfFalse(node.IsStatementContainerNode())
VisualBasicRemoveUnnecessaryImportsService.vb (1)
32Contract.ThrowIfNull(formattingOptions)
VisualBasicSemanticFacts.vb (2)
134Contract.ThrowIfNull(model) 135Contract.ThrowIfTrue(model.IsSpeculativeSemanticModel)
VisualBasicSmartTokenFormatter.vb (2)
26Contract.ThrowIfNull(root) 35Contract.ThrowIfTrue(token.Kind = SyntaxKind.None OrElse token.Kind = SyntaxKind.EndOfFileToken)
VisualBasicTypeInferenceService.TypeInferrer.vb (1)
524Contract.ThrowIfTrue(previousToken <> Nothing AndAlso binop.OperatorToken <> previousToken)
Microsoft.CodeAnalysis.Workspaces (508)
AbstractAggregatedFormattingResult.cs (2)
32Contract.ThrowIfNull(node); 33Contract.ThrowIfNull(formattingResults);
AbstractDocumentationCommentService.cs (1)
52Contract.ThrowIfNull(documentationComment);
AbstractFlagsEnumGenerator.cs (5)
80Contract.ThrowIfNull(enumType.EnumUnderlyingType); 121Contract.ThrowIfNull(finalNode); 151Contract.ThrowIfNull(field.ConstantValue); 174Contract.ThrowIfNull(enumType.EnumUnderlyingType); 190Contract.ThrowIfNull(enumType.EnumUnderlyingType);
AbstractFormatEngine.cs (1)
64Contract.ThrowIfTrue(treeData.Root.IsInvalidTokenRange(startToken, endToken));
AbstractFormatEngine.OperationApplier.cs (6)
61Contract.ThrowIfFalse(triviaInfo.LineBreaks == 0); 94Contract.ThrowIfFalse(triviaInfo.LineBreaks == 0); 132Contract.ThrowIfFalse(triviaInfo.LineBreaks == 0); 271Contract.ThrowIfNull(previousChangesMap); 460Contract.ThrowIfFalse(triviaInfo.SecondTokenIsFirstTokenOnLine); 487Contract.ThrowIfFalse(baseToken.RawKind != 0 && startToken.RawKind != 0 && endToken.RawKind != 0);
AbstractTriviaDataFactory.AbstractComplexTrivia.cs (3)
27Contract.ThrowIfNull(treeInfo); 80Contract.ThrowIfFalse(line > 0); 137Contract.ThrowIfFalse(list.Count > 0);
AbstractTriviaDataFactory.cs (6)
25Contract.ThrowIfNull(treeInfo); 39Contract.ThrowIfFalse(space >= 0); 58Contract.ThrowIfFalse(lineBreaks >= 0); 59Contract.ThrowIfFalse(indentation >= 0); 91Contract.ThrowIfFalse(lineIndex is >= 0 and < LineBreakCacheSize); 92Contract.ThrowIfFalse(indentationLevel >= 0 && indentationLevel < _whitespaces.Length / _whitespaces.Rank);
AbstractTriviaDataFactory.ModifiedWhitespace.cs (1)
27Contract.ThrowIfNull(original);
AbstractTriviaDataFactory.Whitespace.cs (2)
27Contract.ThrowIfFalse(space >= 0); 59Contract.ThrowIfFalse(line > 0);
AbstractTriviaFormatter.cs (6)
72Contract.ThrowIfNull(context); 73Contract.ThrowIfNull(formattingRules); 74Contract.ThrowIfNull(originalString); 76Contract.ThrowIfFalse(lineBreaks >= 0); 77Contract.ThrowIfFalse(spaces >= 0); 79Contract.ThrowIfTrue(token1 == default && token2 == default);
AdjustNewLinesOperation.cs (3)
16Contract.ThrowIfFalse(option != AdjustNewLinesOption.ForceLines || line > 0); 17Contract.ThrowIfFalse(option != AdjustNewLinesOption.PreserveLines || line >= 0); 18Contract.ThrowIfFalse(option != AdjustNewLinesOption.ForceLinesIfOnSingleLine || line > 0);
AdjustSpacesOperation.cs (1)
16Contract.ThrowIfFalse(space >= 0);
AlignTokensOperation.cs (1)
18Contract.ThrowIfNull(tokens);
AnalyzerConfigOptionsExtensions.cs (1)
26Contract.ThrowIfFalse(option.Definition.IsEditorConfigOption);
AnchorIndentationOperation.cs (3)
18Contract.ThrowIfTrue(anchorToken.RawKind == 0); 19Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0);
AnnotationTable.cs (1)
108Contract.ThrowIfNull(ra.Data);
AsyncLazy`1.cs (9)
114Contract.ThrowIfNull(asynchronousComputeFunction); 150Contract.ThrowIfTrue(_asynchronousComputationCancellationSource != null && 154Contract.ThrowIfTrue(_requests != null && 159Contract.ThrowIfTrue(_requests != null && 163Contract.ThrowIfTrue(_cachedResult != null && 168Contract.ThrowIfTrue(_asynchronousComputeFunction == null && _synchronousComputeFunction != null); 248Contract.ThrowIfNull(_synchronousComputeFunction); 360Contract.ThrowIfTrue(_computationActive); 361Contract.ThrowIfNull(_asynchronousComputeFunction);
BottomUpBaseIndentationFinder.cs (1)
34Contract.ThrowIfNull(formattingRules);
ChainedFormattingRules.cs (1)
33Contract.ThrowIfNull(formattingRules);
Classification\IRemoteSemanticClassificationService.cs (2)
94Contract.ThrowIfNull(ClassificationTypes); 95Contract.ThrowIfNull(ClassificationTriples);
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (6)
101Contract.ThrowIfTrue(commonLeftWidth > oldRootWidth); 102Contract.ThrowIfTrue(commonLeftWidth > newRootWidth); 103Contract.ThrowIfTrue(commonRightWidth > oldRootWidth); 104Contract.ThrowIfTrue(commonRightWidth > newRootWidth); 133Contract.ThrowIfFalse(currentOld.FullSpan.Start == currentNew.FullSpan.Start); 191Contract.ThrowIfFalse((oldRoot.FullSpan.End - currentOld.FullSpan.End) ==
CodeActions\CodeAction.cs (1)
105Contract.ThrowIfFalse(provider is CodeFixProvider or CodeRefactoringProvider);
CodeCleanup\AbstractCodeCleanerService.cs (7)
214Contract.ThrowIfFalse(hasMultiplePreviousToken || hasMultipleNextToken); 240Contract.ThrowIfTrue(spanMarkerType == SpanMarkerType.EndOfFile); 241Contract.ThrowIfTrue(previousToken.RawKind == 0); 256Contract.ThrowIfTrue(spanMarkerType == SpanMarkerType.BeginningOfFile); 257Contract.ThrowIfTrue(nextToken.RawKind == 0); 372Contract.ThrowIfTrue(startToken.RawKind == 0 || endToken.RawKind == 0); 669Contract.ThrowIfNull(annotation.Data);
CodeFixes\CodeFixProvider.cs (1)
49Contract.ThrowIfFalse(priority is CodeActionRequestPriority.Low or CodeActionRequestPriority.Normal or CodeActionRequestPriority.High);
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
59Contract.ThrowIfFalse(fixAllContext.Scope is FixAllScope.Document or
CodeFixes\FixAllOccurrences\FixAllContext.cs (1)
315Contract.ThrowIfNull(project);
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (1)
47Contract.ThrowIfFalse(fixAllContext.Scope is FixAllScope.Document or FixAllScope.Project
CodeFixesAndRefactorings\FixAllLogger.cs (1)
95Contract.ThrowIfTrue(completed && timedOut);
CodeGenerationHelpers.cs (2)
182Contract.ThrowIfNull(attribute); 200Contract.ThrowIfTrue(availableIndices != null && availableIndices.Count != declarationList.Count + 1);
CodeGenerationOptions.cs (1)
138Contract.ThrowIfNull(document.Project.ParseOptions);
CodeRefactorings\CodeRefactoringProvider.cs (1)
42Contract.ThrowIfFalse(priority is CodeActionRequestPriority.Low or CodeActionRequestPriority.Normal or CodeActionRequestPriority.High);
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (1)
90Contract.ThrowIfFalse(fixAllContext.Scope is FixAllScope.Document or FixAllScope.Project
CodeRefactorings\FixAllOccurences\FixAllState.cs (2)
101Contract.ThrowIfNull(Document); 112Contract.ThrowIfNull(Document);
CommonFormattingHelpers.cs (15)
44Contract.ThrowIfNull(root); 45Contract.ThrowIfFalse(spans.Count > 0); 80Contract.ThrowIfNull(root); 81Contract.ThrowIfTrue(textSpan.IsEmpty); 120Contract.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart); 144Contract.ThrowIfNull(tree); 145Contract.ThrowIfTrue(token.RawKind == 0); 166Contract.ThrowIfTrue(token1.RawKind == 0 && token2.RawKind == 0); 167Contract.ThrowIfTrue(token1.Equals(token2)); 282Contract.ThrowIfFalse(backwardPosition < parentNode.FullSpan.End); 286Contract.ThrowIfTrue(nextToken.RawKind == 0); 307Contract.ThrowIfNull(parentNode); 308Contract.ThrowIfFalse(parentNode.FullSpan.Start < forwardPosition); 312Contract.ThrowIfTrue(previousToken.RawKind == 0); 362Contract.ThrowIfNull(root);
Diagnostics\DiagnosticAnalysisResult.cs (5)
219Contract.ThrowIfNull(_syntaxLocals); 220Contract.ThrowIfNull(_semanticLocals); 221Contract.ThrowIfNull(_nonLocals); 222Contract.ThrowIfTrue(_others.IsDefault); 257Contract.ThrowIfNull(map);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
59Contract.ThrowIfTrue(Project.SupportsCompilation);
Diagnostics\DiagnosticDataLocation.cs (1)
62Contract.ThrowIfNull(unmappedFileSpan.Path);
Diagnostics\DocumentAnalysisScope.cs (1)
51Contract.ThrowIfFalse(TextDocument is AdditionalDocument);
Diagnostics\HostDiagnosticAnalyzers.cs (1)
181Contract.ThrowIfNull(language);
DocumentExtensions.cs (1)
116Contract.ThrowIfFalse(document.SupportsSemanticModel);
Editing\SyntaxEditor.cs (2)
258Contract.Fail($"GetCurrentNode returned null with the following node: {OriginalNode}"); 303Contract.ThrowIfNull(node);
Editing\SyntaxGenerator.cs (4)
1027Contract.ThrowIfNull(attribute.AttributeClass); 1380Contract.ThrowIfTrue(ReferenceEquals(root, node)); 1531Contract.ThrowIfNull(currentFirst); 1903Contract.ThrowIfNull(name);
EditorConfigValueSerializer`1.cs (1)
62Contract.ThrowIfTrue(RoslynString.IsNullOrEmpty(editorConfigStringForValue));
EmbeddedSeparatedSyntaxNodeList.cs (1)
27Contract.ThrowIfTrue(nodesAndTokens.IsDefault);
ErrorReporting\InfoBarUI.cs (1)
20Contract.ThrowIfNull(title);
FindSymbols\Declarations\DeclarationFinder.cs (3)
30Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API"); 80Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API"); 87Contract.ThrowIfNull(info);
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
28Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API"); 33Contract.ThrowIfNull(query.Name);
FindSymbols\FindLiterals\FindLiteralsSearchEngine.cs (2)
121Contract.ThrowIfNull(index); 124Contract.ThrowIfNull(_stringValue);
FindSymbols\FindReferences\DependentProjectsFinder.cs (4)
263Contract.ThrowIfNull(symbolOrigination.assembly); 264Contract.ThrowIfNull(project); 265Contract.ThrowIfFalse(project.SupportsCompilation); 277Contract.ThrowIfFalse(project.SupportsCompilation);
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
347Contract.ThrowIfNull(symbolTreeInfo);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
578Contract.ThrowIfFalse(notNullOriginalUnreducedSymbol2.GetOriginalUnreducedDefinition().Equals(notNullOriginalUnreducedSymbol2));
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (1)
56Contract.ThrowIfNull(token.Parent?.Parent);
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
45Contract.ThrowIfNull(underlyingNamedType);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
57Contract.ThrowIfNull(symbol.DeclaringMethod);
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (3)
159Contract.ThrowIfFalse(linkedSymbols.Contains(symbol), "Linked symbols did not contain the very symbol we started with."); 162Contract.ThrowIfFalse(group.Symbols.Contains(symbol), "Symbol group did not contain the very symbol we started with."); 169Contract.ThrowIfFalse(_symbolToGroup.ContainsKey(symbol));
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (2)
121Contract.ThrowIfNull(searchSymbol); 229Contract.ThrowIfFalse(projects.Count == 1, "Only a single project should be passed in");
FindSymbols\IStreamingFindReferencesProgress.cs (1)
34Contract.ThrowIfTrue(symbols.IsDefaultOrEmpty, "Symbols should be non empty");
FindSymbols\Shared\AbstractSyntaxIndex.cs (3)
32Contract.ThrowIfNull(index); 55Contract.ThrowIfFalse(index != null || loadOnly == true, "Result can only be null if 'loadOnly: true' was passed."); 114Contract.ThrowIfFalse(document.SupportsSyntaxTree);
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
66Contract.ThrowIfTrue(dehydrated.Symbols.Count == 0);
FindSymbols\SymbolFinder_Helpers.cs (5)
148Contract.ThrowIfNull(equivalentTypesWithDifferingAssemblies); 149Contract.ThrowIfTrue(!equivalentTypesWithDifferingAssemblies.Any()); 152Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => !SymbolEquivalenceComparer.Instance.Equals(kvp.Key.ContainingAssembly, kvp.Value.ContainingAssembly))); 155Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => kvp.Key.ContainingType == null)); 156Contract.ThrowIfFalse(equivalentTypesWithDifferingAssemblies.All(kvp => kvp.Value.ContainingType == null));
FindSymbols\SymbolTree\MetadataInfo.cs (1)
31Contract.ThrowIfNull(info);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (4)
126Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API"); 138Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API"); 150Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API"); 156Contract.ThrowIfNull(queryName);
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
113Contract.ThrowIfTrue(info.Checksum != checksum, "How could the info stored for a particular PEReference now have a different checksum?");
FindSymbols\SymbolTree\SymbolTreeInfo_Serialization.cs (1)
57Contract.ThrowIfNull(result);
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (4)
179Contract.ThrowIfNull(info); 180Contract.ThrowIfTrue(info.Checksum != checksum, "If we computed a SymbolTreeInfo, then its checksum must match our checksum."); 201Contract.ThrowIfNull(info); 202Contract.ThrowIfTrue(info.Checksum != checksum, "If we computed a SymbolTreeInfo, then its checksum must match our checksum.");
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (1)
85Contract.ThrowIfNull(node);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (2)
138Contract.ThrowIfTrue((uint)accessibility > Max4BitValue); 139Contract.ThrowIfTrue((uint)kind > Max5BitValue);
Formatting\AbstractFormattingService.cs (1)
20Contract.ThrowIfNull(syntaxFormattingOptions);
Formatting\Formatter.cs (1)
138Contract.ThrowIfNull(formattingOptions);
FormattingContext.cs (4)
59Contract.ThrowIfNull(engine); 60Contract.ThrowIfNull(tokenStream); 125Contract.ThrowIfNull(operations); 437Contract.ThrowIfFalse(intervals.Length == 0);
FormattingContext.InitialContextFinder.cs (3)
32Contract.ThrowIfNull(tokenStream); 33Contract.ThrowIfNull(formattingRules); 34Contract.ThrowIfNull(rootNode);
FormattingExtensions.cs (1)
201Contract.ThrowIfFalse(lines.Length > 0);
IIndentationService.cs (1)
36Contract.ThrowIfNull(firstNonWhitespacePos);
ImmutableHashMapExtensions.cs (2)
28Contract.ThrowIfNull(valueProvider); 31Contract.ThrowIfNull(map);
IndentBlockOperation.cs (10)
17Contract.ThrowIfFalse(option.IsMaskOn(IndentBlockOption.PositionMask)); 19Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 20Contract.ThrowIfTrue(startToken.RawKind == 0); 21Contract.ThrowIfTrue(endToken.RawKind == 0); 36Contract.ThrowIfFalse(option.IsMaskOn(IndentBlockOption.PositionMask)); 38Contract.ThrowIfFalse(option.IsMaskOn(IndentBlockOption.RelativePositionMask)); 39Contract.ThrowIfFalse(baseToken.Span.End <= textSpan.Start); 41Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 42Contract.ThrowIfTrue(startToken.RawKind == 0); 43Contract.ThrowIfTrue(endToken.RawKind == 0);
ISymbolExtensions_Accessibility.cs (7)
88Contract.ThrowIfNull(symbol); 89Contract.ThrowIfNull(within); 183Contract.ThrowIfNull(type); 221Contract.ThrowIfNull(assembly); 258Contract.ThrowIfNull(containingType); 435Contract.ThrowIfNull(withinType); 436Contract.ThrowIfNull(originalContainingType);
ISyntaxFactsExtensions.cs (1)
29Contract.ThrowIfNull(node);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (3)
338Contract.ThrowIfNull(classOrStructType); 339Contract.ThrowIfNull(interfacesOrAbstractClasses); 340Contract.ThrowIfNull(isImplemented);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (1)
497Contract.ThrowIfFalse(symbol.IsNormalAnonymousType());
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs\StringExtensions.cs (10)
16Contract.ThrowIfNull(line); 31Contract.ThrowIfNull(line); 46Contract.ThrowIfNull(lineText); 57Contract.ThrowIfNull(lineText); 208Contract.ThrowIfNull(line); 209Contract.ThrowIfFalse(0 <= endPosition && endPosition <= line.Length); 210Contract.ThrowIfFalse(tabSize > 0); 217Contract.ThrowIfNull(line); 218Contract.ThrowIfFalse(column >= 0); 219Contract.ThrowIfFalse(tabSize > 0);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
69Contract.ThrowIfNull(syntaxTree); 131Contract.ThrowIfNull(syntaxTree);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\TestHooks\TaskExtensions.cs\TaskExtensions.cs (2)
53Contract.ThrowIfNull(task, nameof(task)); 90Contract.ThrowIfNull(task, nameof(task));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs\TaskExtensions.cs (7)
89Contract.ThrowIfNull(continuationAction, nameof(continuationAction)); 108Contract.ThrowIfNull(continuationFunction, nameof(continuationFunction)); 122Contract.ThrowIfNull(continuationAction, nameof(continuationAction)); 154Contract.ThrowIfNull(continuationFunction, nameof(continuationFunction)); 199Contract.ThrowIfNull(continuationFunction, nameof(continuationFunction)); 318Contract.ThrowIfNull(continuationFunction, nameof(continuationFunction)); 381Contract.ThrowIfFalse(task.IsCompleted);
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (2)
25Contract.ThrowIfFalse(fixAllScope is FixAllScope.ContainingMember or FixAllScope.ContainingType); 54Contract.ThrowIfNull(documentForLocation);
ListExtensions.cs (2)
68Contract.ThrowIfNull(list); 69Contract.ThrowIfNull(predicate);
LocationExtensions.cs (1)
15Contract.ThrowIfNull(location.SourceTree);
Logger.LogBlock.cs (1)
21Contract.ThrowIfNull(s_currentLogger);
NonReentrantLock.cs (1)
172=> Contract.ThrowIfFalse(LockHeldByMe());
Notification\AbstractGlobalOperationNotificationService.cs (4)
40Contract.ThrowIfFalse(_registrations.Count == 0); 41Contract.ThrowIfFalse(_operations.Count == 0, $"Non-disposed operations: {string.Join(", ", _operations)}"); 73Contract.ThrowIfFalse(_operations.Count == 1); 86Contract.ThrowIfFalse(result);
Options\DocumentOptionSet.cs (1)
85Contract.ThrowIfTrue(internallyDefinedOption.Type == typeof(NamingStylePreferences));
ParsedDocument.cs (1)
73Contract.ThrowIfFalse(Id == oldDocument.Id);
PublicOptionFactory.cs (4)
101Contract.ThrowIfNull(option.PublicOption); 107Contract.ThrowIfNull(option.PublicOption); 113Contract.ThrowIfNull(option.PublicOption); 119Contract.ThrowIfNull(option.PublicOption);
ReferenceCountedDisposable.cs (1)
294Contract.ThrowIfNull(weakInstance);
Remote\ExportRemoteServiceCallbackDispatcherAttribute.cs (1)
22Contract.ThrowIfFalse(serviceInterface.IsInterface);
Remote\IRemoteKeepAliveService.cs (1)
59Contract.Fail("Should have been disposed!");
Remote\RemoteArguments.cs (1)
69Contract.ThrowIfNull(project, WorkspacesResources.Symbols_project_could_not_be_found_in_the_provided_solution);
Remote\RemoteServiceCallbackDispatcher.cs (2)
32Contract.ThrowIfTrue(_callbackInstances?.TryRemove(Id, out _) == false); 54Contract.ThrowIfFalse(_callbackInstances.TryGetValue(callbackId, out var instance));
Remote\RemoteServiceCallbackDispatchers.cs (1)
24Contract.ThrowIfNull(serviceInterface);
Rename\ConflictEngine\ConflictResolver.cs (6)
193Contract.ThrowIfNull(implicitUsageConflict.SourceTree); 217Contract.ThrowIfNull(implicitConflict.SourceTree); 243Contract.ThrowIfNull(projectOpt); 295Contract.ThrowIfNull(projectOpt); 310Contract.ThrowIfNull(languageConflict.SourceTree); 337Contract.ThrowIfNull(oldLocation.SourceTree);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
162Contract.ThrowIfTrue(conflictLocations.Count != 0, "We're the first phase, so we should have no conflict locations yet");
Rename\ConflictEngine\MutableConflictResolution.cs (1)
117Contract.ThrowIfNull(directory);
Rename\IRemoteRenamerService.cs (2)
157Contract.ThrowIfNull(serializableLocations); 239Contract.ThrowIfNull(Resolution);
Rename\LightweightRenameLocations.cs (5)
42Contract.ThrowIfTrue(locations.IsDefault); 43Contract.ThrowIfTrue(implicitLocations.IsDefault); 44Contract.ThrowIfTrue(referencedSymbols.IsDefault); 80Contract.ThrowIfNull(solution); 81Contract.ThrowIfNull(symbol);
Rename\Renamer.cs (6)
163Contract.ThrowIfNull(solution); 164Contract.ThrowIfNull(symbol); 165Contract.ThrowIfTrue(string.IsNullOrEmpty(newName)); 211Contract.ThrowIfNull(solution); 212Contract.ThrowIfNull(symbol); 213Contract.ThrowIfTrue(string.IsNullOrEmpty(newName));
Rename\RenameUtilities.cs (4)
101Contract.ThrowIfFalse(isSubset); 307Contract.ThrowIfNull(definitionSymbol); 318Contract.ThrowIfNull(symbol); 319Contract.ThrowIfNull(solution);
Rename\SymbolicRenameLocations.cs (4)
49Contract.ThrowIfTrue(locations.IsDefault); 50Contract.ThrowIfTrue(implicitLocations.IsDefault); 51Contract.ThrowIfTrue(referencedSymbols.IsDefault); 68Contract.ThrowIfNull(symbol);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
266Contract.ThrowIfNull(aliasLocation.SourceTree); 285Contract.ThrowIfNull(aliasLocation.SourceTree);
Rename\SymbolicRenameLocations.SearchResult.cs (1)
24Contract.ThrowIfNull(locations);
SemanticModelExtensions.cs (3)
109Contract.ThrowIfNull(semanticModel.ParentModel); 110Contract.ThrowIfTrue(semanticModel.ParentModel.IsSpeculativeSemanticModel); 111Contract.ThrowIfTrue(semanticModel.ParentModel.ParentModel != null);
Serialization\SerializableSourceText.cs (1)
175Contract.ThrowIfFalse(kind == SerializationKinds.Bits);
Serialization\SerializerService_ChecksumWithChildren.cs (1)
79Contract.ThrowIfFalse(checksums.Checksum == checksum);
Serialization\SerializerService_Reference.cs (6)
378Contract.ThrowIfFalse(metadataKind == MetadataImageKind.Module); 388Contract.ThrowIfFalse(metadataKind == MetadataImageKind.Module); 403Contract.ThrowIfFalse(metadataKind == MetadataImageKind.Module); 414Contract.ThrowIfFalse(metadataKind == MetadataImageKind.Module); 428Contract.ThrowIfFalse(length == storageStream.Length); 442Contract.ThrowIfFalse(SerializationKinds.Bits == kind);
Shared\Extensions\DocumentExtensions.cs (1)
19Contract.ThrowIfNull(result);
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
89Contract.ThrowIfTrue(start < text.Lines.GetLinePosition(0)); 90Contract.ThrowIfTrue(end > text.Lines.GetLinePosition(text.Length));
Shared\Extensions\IMethodSymbolExtensions.cs (1)
22Contract.ThrowIfFalse(delegateType.TypeKind == TypeKind.Delegate);
Shared\Extensions\ISymbolExtensions.cs (1)
370Contract.ThrowIfNull(candidate);
Shared\Extensions\SemanticEquivalence.cs (1)
108Contract.ThrowIfTrue(b1 != b2);
Shared\Extensions\SourceTextExtensions.cs (2)
218Contract.ThrowIfFalse(offset == length); 264Contract.ThrowIfFalse(offset == length);
Shared\Extensions\SyntaxGeneratorExtensions.cs (1)
179Contract.ThrowIfNull(type);
Shared\Extensions\TelemetryExtensions.cs (1)
18Contract.ThrowIfNull(type.FullName);
Shared\TestHooks\AsynchronousOperationListener.cs (3)
116Contract.ThrowIfFalse(_gate.LockHeldByMe()); 122Contract.ThrowIfFalse(_gate.LockHeldByMe()); 187Contract.ThrowIfFalse(TrackActiveTokens);
Shared\Utilities\BloomFilter_Serialization.cs (1)
30Contract.ThrowIfTrue(bitArray.Length % 8 != 0);
Shared\Utilities\ExtensionOrderer.Graph.cs (1)
22Contract.ThrowIfNull(name);
Simplification\AbstractSimplificationService.cs (1)
185Contract.ThrowIfFalse(nodesAndTokensToReduce.Any());
SimplificationHelpers.cs (1)
66Contract.ThrowIfNull(expression);
SourceTextExtensions_SharedWithCodeStyle.cs (1)
19Contract.ThrowIfNull(text);
StackExtensions.cs (2)
34Contract.ThrowIfNull(stack); 35Contract.ThrowIfNull(range);
Storage\AbstractPersistentStorageService.cs (1)
84Contract.ThrowIfNull(storage);
Storage\SQLite\v2\Interop\SqlConnection.cs (2)
55Contract.ThrowIfFalse(wrote == length); 316Contract.ThrowIfFalse(MemoryMarshal.TryRead(bytes, out Checksum.HashData result));
Storage\SQLite\v2\Interop\SqlStatement.cs (1)
93Contract.ThrowIfFalse(Encoding.UTF8.GetBytes(value.AsSpan(), bytes) == utf8ByteCount);
Storage\SQLite\v2\SQLiteConnectionPoolService.cs (2)
139Contract.ThrowIfNull(directoryName); 150Contract.ThrowIfNull(directory);
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (6)
152Contract.ThrowIfTrue(optional.HasValue && optional.Value == null); 166Contract.ThrowIfFalse(TaskScheduler.Current == Storage._connectionPoolService.Scheduler.ConcurrentScheduler); 225Contract.ThrowIfFalse(TaskScheduler.Current == Storage._connectionPoolService.Scheduler.ExclusiveScheduler); 290Contract.ThrowIfTrue(exception != null); 307Contract.ThrowIfTrue(exception != null); 364Contract.ThrowIfFalse(TaskScheduler.Current == Storage._connectionPoolService.Scheduler.ExclusiveScheduler);
Storage\SQLite\v2\SQLitePersistentStorage.cs (1)
59Contract.ThrowIfNull(solutionKey.FilePath);
Storage\SQLite\v2\SQLitePersistentStorage_FlushWrites.cs (1)
65Contract.ThrowIfFalse(TaskScheduler.Current == _connectionPoolService.Scheduler.ExclusiveScheduler);
Storage\SQLite\v2\SQLitePersistentStorage_StringIds.cs (3)
49Contract.ThrowIfFalse( 68Contract.ThrowIfFalse(TaskScheduler.Current == _connectionPoolService.Scheduler.ExclusiveScheduler); 134Contract.ThrowIfTrue(id == -1);
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
94Contract.ThrowIfTrue(string.IsNullOrWhiteSpace(workingFolderPath));
StructuredAnalyzerConfigOptions.cs (1)
65Contract.ThrowIfFalse(options.KeyComparer == KeyComparer);
SuppressOperation.cs (3)
17Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.Length < 0); 18Contract.ThrowIfTrue(startToken.RawKind == 0); 19Contract.ThrowIfTrue(endToken.RawKind == 0);
SymbolKey.BodyLevelSymbolKey.cs (5)
22Contract.ThrowIfFalse(IsBodyLevelSymbol(symbol)); 23Contract.ThrowIfTrue(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty); 62Contract.ThrowIfTrue(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty); 66Contract.ThrowIfFalse(locations.All(loc => loc.IsInSource)); 258Contract.ThrowIfTrue(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
SymbolKey.BuiltinOperatorSymbolKey.cs (1)
48Contract.ThrowIfNull(returnTypeSymbol);
SymbolKey.ErrorTypeSymbolKey.cs (2)
86Contract.ThrowIfFalse(typeArguments.IsDefault); 91Contract.ThrowIfTrue(typeArguments.IsDefault);
SymbolKey.FunctionPointerTypeSymbolKey.cs (2)
71Contract.ThrowIfFalse(parameterTypes.IsDefault); 76Contract.ThrowIfTrue(parameterTypes.IsDefault);
SymbolKey.NamedTypeSymbolKey.cs (2)
54Contract.ThrowIfFalse(typeArguments.IsDefault); 60Contract.ThrowIfTrue(typeArguments.IsDefault);
SymbolKey.SymbolKeyReader.cs (5)
126Contract.ThrowIfNull(result); 417Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 418Contract.ThrowIfFalse(Equals(method, _methodSymbolStack[^1])); 433Contract.ThrowIfTrue(_contextualSymbolStack.Count == 0); 434Contract.ThrowIfFalse(Equals(contextualSymbol, _contextualSymbolStack.Peek()));
SymbolKey.SymbolKeyWriter.cs (2)
518Contract.ThrowIfTrue(_methodSymbolStack.Count == 0); 519Contract.ThrowIfFalse(method.Equals(_methodSymbolStack[_methodSymbolStack.Count - 1]));
SymbolKey.TypeParameterOrdinalSymbolKey.cs (1)
15Contract.ThrowIfFalse(symbol.TypeParameterKind == TypeParameterKind.Method);
SyntaxAnnotationExtensions.cs (1)
18Contract.ThrowIfFalse(symbol is CodeGenerationSymbol);
SyntaxGeneratorExtensions_Negate.cs (1)
526Contract.ThrowIfFalse(syntaxFacts.IsNotPattern(pattern));
SyntaxNodeExtensions.cs (8)
102Contract.ThrowIfNull(node); 174Contract.ThrowIfTrue(node1.RawKind == 0 || node2.RawKind == 0); 292Contract.ThrowIfNull(root); 293Contract.ThrowIfNull(pairs); 306Contract.ThrowIfNull(root); 307Contract.ThrowIfNull(pairs); 315Contract.ThrowIfNull(nodes); 316Contract.ThrowIfFalse(nodes.Any());
SyntaxTokenExtensions.cs (1)
41Contract.ThrowIfTrue(token1.RawKind == 0 || token2.RawKind == 0);
TemporaryStorage\TemporaryStorageServiceFactory.cs (1)
160Contract.ThrowIfNull(_name);
TextDocumentExtensions.cs (2)
38Contract.ThrowIfFalse(textDocument is AdditionalDocument); 47Contract.ThrowIfFalse(textDocument is AnalyzerConfigDocument);
TokenData.cs (4)
25Contract.ThrowIfNull(tokenStream); 26Contract.ThrowIfFalse((indexInStream == -1) || (0 <= indexInStream && indexInStream < tokenStream.TokenCount)); 78Contract.ThrowIfFalse(this.TokenStream == other.TokenStream); 105Contract.ThrowIfFalse(index1 >= 0 && index2 >= 0);
TokenPairWithOperations.cs (2)
28Contract.ThrowIfNull(tokenStream); 30Contract.ThrowIfFalse(0 <= tokenPairIndex && tokenPairIndex < tokenStream.TokenCount - 1);
TokenStream.cs (10)
138Contract.ThrowIfFalse(0 <= index && index < this.TokenCount); 237Contract.ThrowIfNull(data); 243Contract.ThrowIfNull(data); 249Contract.ThrowIfNull(data); 250Contract.ThrowIfFalse(0 <= pairIndex && pairIndex < this.TokenCount - 1); 429Contract.ThrowIfFalse(this.FormatBeginningOfTree); 441Contract.ThrowIfFalse(this.FormatEndOfTree); 453Contract.ThrowIfFalse(0 <= pairIndex && pairIndex < this.TokenCount - 1); 465Contract.ThrowIfFalse(0 <= pairIndex && pairIndex < this.TokenCount - 1); 478Contract.ThrowIfTrue(token.RawKind == 0);
TreeData.cs (1)
42Contract.ThrowIfNull(root);
TreeData.Debug.cs (1)
25Contract.ThrowIfFalse(text == _debugNodeData.GetTextBetween(token1, token2));
TreeData.Node.cs (2)
18Contract.ThrowIfFalse(root.GetFirstToken(includeZeroWidth: true).RawKind != 0); 23Contract.ThrowIfTrue(token.RawKind == 0);
TreeData.NodeAndText.cs (2)
20Contract.ThrowIfNull(text); 26Contract.ThrowIfTrue(token.RawKind == 0);
TreeData.StructuredTrivia.cs (1)
22Contract.ThrowIfFalse(trivia.HasStructure);
Utilities\Documentation\XmlDocumentationProvider.cs (2)
106Contract.ThrowIfNull(xmlDocCommentBytes); 155Contract.ThrowIfNull(filePath);
Utilities\TaskQueue.cs (2)
25Contract.ThrowIfNull(operationListener); 26Contract.ThrowIfNull(taskScheduler);
VirtualChar.cs (1)
72Contract.ThrowIfFalse(surrogateChar == 0 || rune == Rune.ReplacementChar,
Workspace\DocumentActiveContextChangedEventArgs.cs (4)
22Contract.ThrowIfNull(solution); 23Contract.ThrowIfNull(sourceTextContainer); 24Contract.ThrowIfNull(oldActiveContextDocumentId); 25Contract.ThrowIfNull(newActiveContextDocumentId);
Workspace\DocumentEventArgs.cs (1)
18Contract.ThrowIfNull(document);
Workspace\Host\DocumentService\AbstractSpanMappingService.cs (1)
35Contract.ThrowIfFalse(mappedSpanResults.Length == textChanges.Length);
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (1)
54Contract.ThrowIfNull(fileName);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (5)
200Contract.ThrowIfNull(documentInfo.FilePath); 464Contract.ThrowIfFalse(_documentIdToDynamicFileInfoProvider.TryGetValue(documentId, out var fileInfoProvider)); 479Contract.ThrowIfNull(fileInfo, "We previously received a dynamic file for this path, and we're responding to a change, so we expect to get a new one."); 548Contract.ThrowIfNull(documentInfo.FilePath, "We shouldn't be adding documents without file paths."); 578Contract.ThrowIfTrue(folders.IsDefault);
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
811Contract.ThrowIfNull(providerForFileInfo); 1302Contract.ThrowIfNull(remainingMetadataReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (17)
153Contract.ThrowIfFalse(_gate.CurrentCount == 0); 160Contract.ThrowIfFalse(_gate.CurrentCount == 0); 238Contract.ThrowIfFalse(_gate.CurrentCount == 0); 261Contract.ThrowIfFalse(_gate.CurrentCount == 0); 272Contract.ThrowIfFalse(_gate.CurrentCount == 0); 300Contract.ThrowIfFalse(_gate.CurrentCount == 0); 304Contract.ThrowIfFalse(_projectReferenceInfoMap.Count == 0); 305Contract.ThrowIfFalse(_projectToMaxSupportedLangVersionMap.Count == 0); 306Contract.ThrowIfFalse(_projectToDependencyNodeTargetIdentifier.Count == 0); 355Contract.ThrowIfFalse(_gate.CurrentCount == 0); 401Contract.ThrowIfFalse(_gate.CurrentCount == 0); 448Contract.ThrowIfNull(projectWithMetadataReference); 449Contract.ThrowIfNull(referencedProject); 485Contract.ThrowIfFalse(_gate.CurrentCount == 0); 526Contract.ThrowIfFalse(_gate.CurrentCount == 0); 558Contract.ThrowIfFalse(_gate.CurrentCount == 0); 577Contract.ThrowIfFalse(_gate.CurrentCount == 0);
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (1)
218Contract.ThrowIfNull(sender);
Workspace\Solution\Checksum.cs (3)
61Contract.ThrowIfFalse(MemoryMarshal.TryRead(checksum, out HashData hash)); 121Contract.ThrowIfFalse(span.Length >= HashSize); 122Contract.ThrowIfFalse(MemoryMarshal.TryWrite(span, ref Unsafe.AsRef(in _checksum)));
Workspace\Solution\ChecksumCollection.cs (2)
48Contract.ThrowIfFalse(state.TryGetStateChecksums(out var stateChecksums)); 65Contract.ThrowIfFalse(values.Count == checksums.Children.Length);
Workspace\Solution\Document.cs (2)
291Contract.ThrowIfNull(result); 485Contract.ThrowIfNull(_cachedOptions);
Workspace\Solution\DocumentState.cs (6)
46Contract.ThrowIfFalse(_options is null == _treeSource is null); 72Contract.ThrowIfNull(options); 159Contract.ThrowIfNull(tree); 231Contract.ThrowIfNull(newTree); 521Contract.ThrowIfNull(_options); 677Contract.ThrowIfFalse(existingId == id);
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
36Contract.ThrowIfNull(siblingTreeSource);
Workspace\Solution\Project.cs (2)
38Contract.ThrowIfNull(solution); 39Contract.ThrowIfNull(projectState);
Workspace\Solution\ProjectDependencyGraph.cs (3)
92Contract.ThrowIfNull(transitiveReferencesMap); 93Contract.ThrowIfNull(reverseTransitiveReferencesMap); 129Contract.ThrowIfFalse(_projectIds.Contains(projectId));
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
17Contract.ThrowIfFalse(_projectIds.Contains(projectId));
Workspace\Solution\ProjectDependencyGraph_RemoveProject.cs (1)
14Contract.ThrowIfFalse(_projectIds.Contains(projectId));
Workspace\Solution\ProjectDependencyGraph_RemoveProjectReference.cs (2)
15Contract.ThrowIfFalse(_projectIds.Contains(projectId)); 16Contract.ThrowIfFalse(_referencesMap[projectId].Contains(referencedProjectId));
Workspace\Solution\ProjectReference.cs (1)
25Contract.ThrowIfNull(projectId);
Workspace\Solution\ProjectState.cs (3)
96Contract.ThrowIfNull(projectInfo); 97Contract.ThrowIfNull(languageServices); 287Contract.ThrowIfNull(projectDirectory);
Workspace\Solution\RecoverableTextAndVersion.cs (4)
164Contract.ThrowIfTrue(source is LoadableTextAndVersionSource { CacheResult: true }); 177Contract.ThrowIfNull(_storage); 187Contract.ThrowIfNull(_storage); 197Contract.ThrowIfFalse(_storage == null); // Cannot save more than once
Workspace\Solution\Solution.cs (6)
69Contract.ThrowIfTrue(this.WorkspaceKind == CodeAnalysis.WorkspaceKind.RemoteWorkspace, "Access .Workspace off of a RemoteWorkspace Solution is not supported."); 130Contract.ThrowIfNull(state); 219Contract.ThrowIfNull(documentId); 234Contract.ThrowIfNull(documentId); 296Contract.ThrowIfNull(generatedDocument, "The call to GetDocumentState found a SourceGeneratedDocumentState, so we should have found it now."); 1763Contract.ThrowIfNull(newDocumentState, "Because we just froze this document, it should always exist.");
Workspace\Solution\SolutionState.CompilationTracker.CompilationTrackerState.cs (7)
70Contract.ThrowIfTrue(documentsAreFinalAndFrozen && !documentsAreFinal); 147Contract.ThrowIfTrue(compilation.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None))); 159Contract.ThrowIfTrue(intermediateProjects is null); 210Contract.ThrowIfTrue(intermediateProjects is null); 211Contract.ThrowIfFalse(intermediateProjects.Count > 0); 271Contract.ThrowIfNull(finalCompilation); 333Contract.ThrowIfNull(projectId);
Workspace\Solution\SolutionState.CompilationTracker.cs (7)
55Contract.ThrowIfNull(project); 225Contract.ThrowIfNull(oldDocumentId, $"{nameof(oldTree)} came from the compilation produced by the workspace, so the document ID should have existed."); 234Contract.ThrowIfFalse(compilationPair.CompilationWithoutGeneratedDocuments.ContainsSyntaxTree(tree)); 301Contract.ThrowIfNull(finalCompilation, "We have a FinalState, so we must have a non-null final compilation"); 821Contract.ThrowIfNull(stateMember); 823Contract.ThrowIfNull(additionalTextsMember); 827Contract.ThrowIfFalse(additionalTexts.Length == this.ProjectState.AdditionalDocumentStates.Count);
Workspace\Solution\SolutionState.cs (10)
174Contract.ThrowIfFalse(_projectIdToProjectStateMap.Count == ProjectIds.Count); 175Contract.ThrowIfFalse(_projectIdToProjectStateMap.Count == _dependencyGraph.ProjectIds.Count); 180Contract.ThrowIfTrue(_projectIdToTrackerMap.Any(kvp => kvp.Key != kvp.Value.ProjectState.Id)); 399Contract.ThrowIfNull(result); 423Contract.ThrowIfNull(projectState); 1499Contract.ThrowIfFalse(_projectIdToProjectStateMap.ContainsKey(projectId)); 1676Contract.ThrowIfFalse(newIdToProjectStateMap.ContainsKey(doc.Id.ProjectId)); 1859Contract.ThrowIfTrue(_frozenSourceGeneratedDocumentState != null, "We shouldn't be calling WithFrozenSourceGeneratedDocument on a solution with a frozen source generated document."); 1919Contract.ThrowIfFalse(newTrackerMap.TryGetValue(projectId, out var existingTracker)); 1921Contract.ThrowIfNull(replacingItemTracker);
Workspace\Solution\SolutionState.SymbolToProjectId.cs (1)
38Contract.ThrowIfNull(syntaxTree);
Workspace\Solution\SolutionState_Checksum.cs (1)
56Contract.ThrowIfNull(projectId);
Workspace\Solution\StateChecksums.cs (6)
57Contract.ThrowIfNull(state.FrozenSourceGeneratedDocumentState, "We should not have had a FrozenSourceGeneratedDocumentIdentity checksum if we didn't have a text in the first place."); 63Contract.ThrowIfNull(state.FrozenSourceGeneratedDocumentState, "We should not have had a FrozenSourceGeneratedDocumentState checksum if we didn't have a text in the first place."); 142Contract.ThrowIfFalse(state.TryGetStateChecksums(out var stateChecksum)); 143Contract.ThrowIfFalse(this == stateChecksum); 160Contract.ThrowIfNull(state.CompilationOptions, "We should not be trying to serialize a project with no compilation options; RemoteSupportedLanguages.IsSupported should have filtered it out."); 166Contract.ThrowIfNull(state.ParseOptions, "We should not be trying to serialize a project with no compilation options; RemoteSupportedLanguages.IsSupported should have filtered it out.");
Workspace\Solution\TextDocument.cs (2)
27Contract.ThrowIfNull(project); 28Contract.ThrowIfNull(state);
Workspace\Solution\TextDocumentStates.cs (1)
167Contract.ThrowIfTrue(!ignoreUnchangedContent && ignoreUnchangeableDocuments);
Workspace\Solution\WeaklyCachedRecoverableValueSource.cs (1)
148Contract.ThrowIfTrue(Gate.CurrentCount != 0);
Workspace\TextExtensions.cs (1)
96Contract.ThrowIfFalse(solution.ContainsAnalyzerConfigDocument(id));
Workspace\Workspace.cs (7)
342Contract.ThrowIfNull(transformation); 1078Contract.ThrowIfNull(newDocument); 1410Contract.ThrowIfNull(projectChanges.OldProject.CompilationOptions); 1411Contract.ThrowIfNull(projectChanges.NewProject.CompilationOptions); 1750Contract.ThrowIfTrue(changes.GetAddedProjects().Any()); 1751Contract.ThrowIfTrue(changes.GetRemovedProjects().Any()); 1752Contract.ThrowIfTrue(changes.GetProjectChanges().Any());
Workspace\Workspace_Editor.cs (7)
276Contract.ThrowIfNull(currentContextId, "The document is open, so we should have had some context ID."); 450Contract.ThrowIfFalse(_openSourceGeneratedDocumentIdentities.Remove(document.Id)); 685Contract.ThrowIfFalse(_bufferToDocumentInCurrentContextMap.ContainsKey(textContainer)); 693Contract.ThrowIfFalse(!_bufferToDocumentInCurrentContextMap.ContainsKey(textContainer)); 711Contract.ThrowIfFalse(!_bufferToDocumentInCurrentContextMap.ContainsKey(textContainer)); 715Contract.ThrowIfFalse(_bufferToDocumentInCurrentContextMap.ContainsKey(textContainer)); 739Contract.ThrowIfFalse(doc.TryGetText(out var text));
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildWorkspace.cs (1)
476Contract.ThrowIfNull(dir);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (9)
Fakes\SimpleAssetSource.cs (1)
49Contract.ThrowIfTrue(asset is null);
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
30Contract.ThrowIfNull(sourceText, "Failed to fetch the text of an additional file.");
MEF\TestComposition.cs (1)
183Contract.ThrowIfFalse(testAssembly == null, $"Test assemblies are not allowed in test composition: {testAssembly}. Specify explicit test parts instead.");
Remote\InProcRemostHostClient.cs (4)
57Contract.ThrowIfNull(client); 139Contract.ThrowIfFalse(options.ClientRpcTarget is null == descriptor.ClientInterface is null); 143Contract.ThrowIfNull(options.ClientRpcTarget); 245Contract.ThrowIfFalse(descriptor.ClientInterface == null);
Remote\TestSerializerService.cs (2)
93Contract.ThrowIfFalse(_sharedTestGeneratorReferences.TryGetValue(testGeneratorReferenceGuid, out var generatorReference)); 140Contract.ThrowIfFalse(_sharedTestGeneratorReferences == null ||
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Options\OptionSerializerTests.cs (2)
90Contract.ThrowIfNull(defaultValue, $"Option: {option.Name}"); 111Contract.ThrowIfNull(enumType, $"Option: {option.Name}");
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
685Contract.ThrowIfNull(document);
Microsoft.VisualStudio.IntegrationTest.Utilities (39)
AutomationElementHelper.cs (1)
57Contract.ThrowIfNull(element);
InProcess\AbstractCodeRefactorDialog_InProc.cs (1)
77Contract.ThrowIfFalse(result);
InProcess\CodeDefinitionWindow_InProc.cs (1)
43Contract.ThrowIfNull(wpfView, "We were unable to get the Code Definition Window view.");
InProcess\Editor_InProc.cs (2)
74Contract.ThrowIfNull(textViewHost); 234Contract.ThrowIfNull(subjectBuffer);
InProcess\GenerateTypeDialog_InProc.cs (5)
83Contract.ThrowIfFalse(await dialog.GetTestAccessor().AccessListComboBox.SimulateSelectItemAsync(JoinableTaskFactory, accessibility)); 96Contract.ThrowIfFalse(await dialog.GetTestAccessor().KindListComboBox.SimulateSelectItemAsync(JoinableTaskFactory, kind)); 109Contract.ThrowIfFalse(await dialog.GetTestAccessor().ProjectListComboBox.SimulateSelectItemAsync(JoinableTaskFactory, projectName)); 122Contract.ThrowIfFalse(await dialog.GetTestAccessor().CreateNewFileRadioButton.SimulateClickAsync(JoinableTaskFactory)); 123Contract.ThrowIfFalse(await dialog.GetTestAccessor().CreateNewFileComboBox.SimulateSelectItemAsync(JoinableTaskFactory, newFileName, mustExist: false));
InProcess\InteractiveWindow_InProc.cs (8)
52Contract.ThrowIfNull(_interactiveWindow); 59Contract.ThrowIfNull(_interactiveWindow); 65Contract.ThrowIfNull(_interactiveWindow); 71Contract.ThrowIfNull(_interactiveWindow); 167Contract.ThrowIfFalse(result.IsSuccessful); 178Contract.ThrowIfNull(_interactiveWindow); 217Contract.ThrowIfNull(_interactiveWindow); 262Contract.ThrowIfNull(_interactiveWindow);
InProcess\MoveToNamespaceDialog_InProc.cs (1)
65Contract.ThrowIfFalse(success);
InProcess\PickMembersDialog_InProc.cs (1)
65Contract.ThrowIfFalse(await button.SimulateClickAsync(JoinableTaskFactory));
InProcess\SolutionExplorer_InProc.cs (10)
90Contract.ThrowIfNull(_solution); 91Contract.ThrowIfNull(_fileName); 176Contract.ThrowIfNull(_solution); 254Contract.ThrowIfNull(_solution); 261Contract.ThrowIfNull(_solution); 475Contract.ThrowIfNull(_solution); 831Contract.ThrowIfNull(_solution); 873Contract.ThrowIfNull(_solution); 898Contract.ThrowIfNull(item); 910Contract.ThrowIfNull(item);
InProcess\TestWaitingService.cs (1)
33Contract.ThrowIfNull(featureWaiter);
InProcess\TextViewWindow_InProc.cs (2)
268Contract.ThrowIfNull(session); 284Contract.ThrowIfNull(session);
IntegrationHelper.cs (1)
276Contract.ThrowIfNull(moniker);
OutOfProcess\Editor_OutOfProc.Verifier.cs (2)
159Contract.ThrowIfNull(currentParameter); 169Contract.ThrowIfNull(currentParameters);
OutOfProcess\TextViewWindow_OutOfProc.Verifier.cs (1)
95Contract.ThrowIfNull(applyFix);
VisualStudioInstanceFactory.cs (2)
125Contract.ThrowIfNull(_currentlyRunningInstance); 195Contract.ThrowIfNull(_currentlyRunningInstance);
Microsoft.VisualStudio.LanguageServices (147)
CodeCleanup\AbstractCodeCleanUpFixer.cs (2)
199Contract.ThrowIfNull(workspace); 206Contract.ThrowIfNull(document);
CodeLens\RemoteCodeLensReferencesService.cs (1)
167Contract.ThrowIfTrue(results.IsDefaultOrEmpty);
ColorSchemes\ColorSchemeApplier.ClassificationVerifier.cs (1)
165Contract.ThrowIfNull(_fontAndColorUtilities);
CommonControls\MemberSelectionViewModel.cs (1)
107Contract.ThrowIfFalse(ShowCheckDependentsButton);
DebuggerIntelliSense\DebuggerIntellisenseFilter.cs (1)
156Contract.ThrowIfNull(_context);
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
317Contract.ThrowIfNull(_projectSystemNotificationQueue);
Diagnostics\DiagnosticProgressReporter.cs (1)
167Contract.ThrowIfNull(_taskCenterService);
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.cs (2)
38Contract.ThrowIfNull(extensionManager); 39Contract.ThrowIfNull(typeIExtensionContent);
DocumentationComments\VisualStudioDocumentationProvider.cs (2)
27Contract.ThrowIfNull(memberIndexService); 28Contract.ThrowIfNull(filePath);
ErrorReporting\VisualStudioInfoBar.cs (2)
97Contract.ThrowIfFalse(_threadingContext.JoinableTaskContext.IsOnMainThread); 129Contract.ThrowIfNull(onClose);
FindReferences\Entries\DocumentSpanEntry.cs (1)
301Contract.ThrowIfFalse(CanNavigateTo());
FindReferences\Entries\SimpleMessageEntry.cs (2)
54Contract.ThrowIfFalse(CanNavigateTo()); 55Contract.ThrowIfNull(_navigationBucket);
Implementation\AbstractEditorFactory.cs (3)
74Contract.ThrowIfNull(_oleServiceProvider); 106Contract.ThrowIfNull(textBuffer, $"Failed to get document data for {pszMkDocument}"); 160Contract.ThrowIfNull(_oleServiceProvider);
Implementation\AbstractOleCommandTarget.cs (4)
30Contract.ThrowIfNull(wpfTextView); 31Contract.ThrowIfNull(componentModel); 59Contract.ThrowIfNull(vsTextView); 64Contract.ThrowIfNull(nextCommandTarget);
Implementation\AbstractOleCommandTarget.Query.cs (2)
17Contract.ThrowIfFalse(commandCount == 1); 18Contract.ThrowIfFalse(prgCmds.Length == 1);
InheritanceMargin\InheritanceGlyphFactory.cs (1)
83Contract.ThrowIfTrue(membersOnLine.IsEmpty);
InheritanceMargin\InheritanceMarginHelpers.cs (1)
140Contract.ThrowIfTrue(members.Length <= 1);
InheritanceMargin\InheritanceMarginTag.cs (1)
41Contract.ThrowIfTrue(membersOnLine.IsEmpty);
InheritanceMargin\InheritanceMarginTaggerProvider.cs (3)
59Contract.ThrowIfNull(textView); 78Contract.ThrowIfNull(textView); 144Contract.ThrowIfTrue(membersOnTheLineArray.IsEmpty);
InlineRename\InlineRenameUndoManager.cs (2)
112Contract.ThrowIfFalse(textUndoHistoryService.TryGetTextUndoHistory(workspace, subjectBuffer, out var undoHistory)); 113Contract.ThrowIfFalse(undoHistory.Properties.TryGetProperty(typeof(ITextBuffer), out ITextBuffer primaryBuffer));
Interop\ComAggregate.cs (3)
44Contract.ThrowIfNull(value, "value"); 57Contract.ThrowIfNull(comWrapper, "comWrapper"); 62Contract.ThrowIfNull(target, "target");
LanguageClient\LogHubLspLogger.cs (1)
31Contract.Fail($"{GetType().FullName} was double disposed");
LanguageService\AbstractLanguageService`2.cs (3)
179Contract.ThrowIfNull(textView); 182Contract.ThrowIfNull(wpfTextView, "Could not get IWpfTextView for IVsTextView"); 214Contract.ThrowIfNull(openDocument);
LanguageService\AbstractLanguageService`2.VsCodeWindowManager.cs (4)
113Contract.ThrowIfFalse(_navigationBarController == null, "We shouldn't have a controller manager if there isn't a dropdown"); 114Contract.ThrowIfFalse(_dropdownBarClient == null, "We shouldn't have a dropdown client if there isn't a dropdown"); 256Contract.ThrowIfFalse(_documentOutlineControl is null); 257Contract.ThrowIfFalse(_documentOutlineViewHost is null);
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (3)
49Contract.ThrowIfNull(languageService); 50Contract.ThrowIfNull(languageServiceProvider); 320Contract.ThrowIfNull(tree);
Library\ClassView\AbstractSyncClassViewCommandHandler.cs (1)
36Contract.ThrowIfNull(serviceProvider);
NavigationBar\NavigationBarClient.cs (3)
83Contract.ThrowIfNull(item, "We shouldn't be getting requests for member items if we had no type selected."); 127Contract.ThrowIfNull(_dropdownBar, "The dropdown is asking us for things, so we should have a reference to it."); 201Contract.ThrowIfNull(_dropdownBar, "The dropdown is asking us for things, so we should have a reference to it.");
Options\LocalUserRegistryOptionPersister.cs (8)
38Contract.ThrowIfNull(localRegistry); 39Contract.ThrowIfFalse(ErrorHandler.Succeeded(localRegistry.GetLocalRegistryRootEx((uint)__VsLocalRegistryType.RegType_UserSettings, out var rootHandle, out var rootPath))); 42Contract.ThrowIfTrue(string.IsNullOrEmpty(rootPath)); 43Contract.ThrowIfTrue(handle == __VsLocalRegistryRootHandle.RegHandle_Invalid); 133Contract.ThrowIfNull(_registryKey); 144Contract.ThrowIfNull(value); 151Contract.ThrowIfNull(value); 159Contract.ThrowIfNull(value);
Options\NamingPreferencesReadFallback.cs (1)
26Contract.ThrowIfNull(language);
Options\VisualStudioSettingsOptionPersister.cs (3)
66Contract.ThrowIfNull(_settingManager); 105Contract.ThrowIfNull(_settingManager); 197Contract.ThrowIfNull(_settingManager);
Packaging\PackageInstallerServiceFactory.cs (5)
217Contract.ThrowIfFalse(IsEnabled); 305Contract.ThrowIfFalse(IsEnabled); 377Contract.ThrowIfFalse(IsEnabled); 453Contract.ThrowIfNull(_workQueue, "We should only register for events after having create the WorkQueue"); 462Contract.ThrowIfNull(_workQueue, "How could we be processing a workqueue change without a workqueue?");
PickMembers\PickMembersDialogViewModel.cs (2)
158Contract.ThrowIfFalse(CanMoveUp); 166Contract.ThrowIfFalse(CanMoveDown);
Preview\FileChange.cs (1)
46Contract.ThrowIfFalse(left != null || right != null);
Preview\PreviewUpdater.cs (2)
58Contract.ThrowIfNull(_previewWorkspace, "We shouldn't have a current document if we don't have a workspace."); 69Contract.ThrowIfNull(_previewWorkspace, "We shouldn't have a current document if we don't have a workspace.");
PreviewPane\PreviewPane.xaml.cs (2)
77Contract.ThrowIfNull(helpLinkToolTipText); 210Contract.ThrowIfFalse(_differenceViewerPreview == null);
ProjectSystem\FileChangeTracker.cs (2)
92Contract.ThrowIfTrue(_fileChangeCookie != s_none); 108Contract.ThrowIfTrue(_fileChangeCookie != s_none);
ProjectSystem\FileChangeWatcher.cs (9)
143Contract.ThrowIfFalse(kind is Kind.None); 158Contract.ThrowIfFalse(kind is Kind.WatchDirectory); 174Contract.ThrowIfFalse(kind is Kind.WatchFile); 190Contract.ThrowIfFalse(kind is Kind.UnwatchDirectories); 206Contract.ThrowIfFalse(kind is Kind.UnwatchFiles); 222Contract.ThrowIfFalse(kind is Kind.UnwatchFile); 353Contract.ThrowIfFalse(_cookies is not null); 358Contract.ThrowIfFalse(_tokens is not null); 450Contract.ThrowIfFalse(_activeFileWatchingTokens.Remove(watchedFile), "This token was no longer being watched.");
ProjectSystem\Legacy\AbstractLegacyProject.cs (1)
70Contract.ThrowIfNull(hierarchy);
ProjectSystem\Legacy\AbstractLegacyProject_IProjectSiteEx.cs (1)
25Contract.ThrowIfFalse(_batchScopes.Count > 0);
ProjectSystem\Legacy\SolutionEventsBatchScopeCreator.cs (1)
187Contract.ThrowIfTrue(_scopeCreator._fullSolutionLoadScopes.Any());
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
231Contract.ThrowIfFalse(stream.Length == size);
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.MetadataCache.cs (1)
78Contract.ThrowIfNull(newMetadata);
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.RecoverableMetadataValueSource.cs (1)
29Contract.ThrowIfFalse(storages.Length > 0);
ProjectSystem\MiscellaneousFilesWorkspace.cs (1)
291Contract.ThrowIfNull(languageInformation);
ProjectSystem\VisualStudioWorkspaceImpl.cs (4)
252Contract.ThrowIfFalse(ImmutableInterlocked.TryAdd(ref _projectToRuleSetFilePath, project.Id, ruleSetFilePathFunc)); 928Contract.ThrowIfNull(folderPath, "If we didn't have a file path, then we expected a folder path to generate the file path from."); 957Contract.ThrowIfNull(hierarchy, "Removing files from projects without hierarchies are not supported."); 961Contract.ThrowIfNull(document.FilePath, "Removing files from projects that don't have file names are not supported.");
RoslynActivityLogger.cs (2)
32Contract.ThrowIfNull(traceSource); 43Contract.ThrowIfNull(traceSource);
RoslynPackage.cs (5)
362Contract.ThrowIfNull(globalNotificationService); 376Contract.ThrowIfNull(gate); 377Contract.ThrowIfNull(globalNotificationService); 395Contract.ThrowIfNull(gate); 396Contract.ThrowIfNull(globalNotificationService);
Snippets\AbstractSnippetExpansionClient.cs (2)
1013Contract.ThrowIfNull(expansion); 1040Contract.ThrowIfNull(vsTextView);
SolutionEventMonitor.cs (1)
30Contract.ThrowIfNull(notificationService);
Storage\AbstractCloudCachePersistentStorageService.cs (1)
31Contract.ThrowIfTrue(string.IsNullOrWhiteSpace(workingFolderPath));
Storage\VisualStudioCloudCacheStorageService.cs (1)
66Contract.ThrowIfNull(cacheService);
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
54Contract.ThrowIfNull(serviceProvider);
TableDataSource\DiagnosticTableItem.cs (1)
27Contract.ThrowIfNull(data);
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (2)
219Contract.ThrowIfNull(_tableControl); 302Contract.ThrowIfNull(project);
TableDataSource\Suppression\VisualStudioDiagnosticListTableCommandHandler.cs (1)
93Contract.ThrowIfFalse(_threadingContext.HasMainThread);
TableDataSource\TableEntriesFactory.cs (1)
222Contract.ThrowIfNull(primary);
TableDataSource\TableItem.cs (3)
28Contract.ThrowIfNull(workspace); 29Contract.ThrowIfNull(projectNames); 30Contract.ThrowIfNull(projectGuids);
TableDataSource\TaskList\VisualStudioTaskListTable.cs (3)
125Contract.ThrowIfNull(args.Solution); 126Contract.ThrowIfNull(args.DocumentId); 133Contract.ThrowIfNull(data.Solution);
TableDataSource\VisualStudioDiagnosticListTable.BuildTableDataSource.cs (1)
211Contract.ThrowIfTrue(data.IsSuppressed);
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
366Contract.ThrowIfNull(projectGroup.Key);
TaskList\HostDiagnosticUpdateSource.cs (6)
75Contract.ThrowIfNull(projectId); 76Contract.ThrowIfNull(key); 77Contract.ThrowIfNull(items); 89Contract.ThrowIfNull(projectId); 113Contract.ThrowIfNull(projectId); 114Contract.ThrowIfNull(key);
Telemetry\AbstractWorkspaceTelemetryService.cs (1)
26Contract.ThrowIfFalse(CurrentSession is null);
Telemetry\FileLogger.cs (1)
57Contract.ThrowIfNull(e.Value);
Telemetry\TelemetryLogger.cs (1)
141Contract.ThrowIfFalse(_pendingScopes.TryRemove(blockId, out var scope));
Telemetry\VisualStudioWorkspaceTelemetryService.cs (1)
57Contract.ThrowIfNull(settings);
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
63Contract.ThrowIfNull(serviceProvider);
Utilities\VsCodeWindowViewTracker.cs (2)
92Contract.ThrowIfNull(pView, $"{nameof(IVsCodeWindow.GetLastActiveView)} returned success, but did not provide a view."); 94Contract.ThrowIfNull(view, "The active view should be initialized.");
ValueTracking\ValueTrackingCommandHandler.cs (1)
172Contract.ThrowIfNull(roslynPackage);
ValueTracking\ValueTrackingToolWindow.cs (2)
67Contract.ThrowIfTrue(Initialized); 79Contract.ThrowIfFalse(Initialized);
Venus\VenusCommandFilter.cs (3)
31Contract.ThrowIfNull(wpfTextView); 32Contract.ThrowIfNull(subjectBuffer); 33Contract.ThrowIfNull(nextCommandTarget);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
60Contract.ThrowIfNull(visualStudioWorkspace);
Workspace\SourceGeneratedFileManager.cs (1)
287Contract.ThrowIfNull(sourceGeneratedDocument);
Workspace\VisualStudioActiveDocumentTracker.cs (1)
146Contract.ThrowIfNull(frame);
Workspace\VisualStudioDocumentNavigationService.cs (1)
428Contract.ThrowIfNull(textBuffer);
Microsoft.VisualStudio.LanguageServices.CSharp (16)
CodeModel\CSharpCodeModelService.cs (12)
968Contract.ThrowIfNull(symbol); 1734Contract.ThrowIfNull(parsedArgumentList); 1761Contract.ThrowIfNull(node.Parent); 2723Contract.ThrowIfNull(typeSymbol); 2756Contract.ThrowIfNull(fieldDeclaration); 2766Contract.ThrowIfNull(newFieldDeclaration); 2795Contract.ThrowIfNull(attributeList); 2813Contract.ThrowIfNull(newAttributeList); 2822Contract.ThrowIfNull(argumentList); 2824Contract.ThrowIfNull(newArgumentList); 2832Contract.ThrowIfNull(parameterList); 2834Contract.ThrowIfNull(newParameterList);
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
159Contract.ThrowIfFalse(
ProjectSystemShim\TempPECompilerService.cs (2)
39Contract.ThrowIfFalse(fileNames.Length == fileContents.Length); 73Contract.ThrowIfFalse(optionNames.Length == optionValues.Length);
Utilities\CSharpParseOptionsChangingService.cs (1)
52Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(maxLangVersion, out var parsedMaxLanguageVersion));
Microsoft.VisualStudio.LanguageServices.Implementation (19)
CodeModel\AbstractCodeModelObject_CodeGen.cs (3)
50Contract.ThrowIfNull(method); 64Contract.ThrowIfNull(method); 170Contract.ThrowIfNull(method);
CodeModel\AbstractCodeModelService.cs (5)
424Contract.ThrowIfNull(node.Parent); 818Contract.ThrowIfNull(typeSymbol); 826Contract.ThrowIfNull(typeSymbol); 1035Contract.ThrowIfNull(annotatedNode); 1084Contract.ThrowIfTrue(object.ReferenceEquals(root, newRoot), $"We failed to insert the node into the tree; this might be if {nameof(containerNode)} came from a different snapshot.");
CodeModel\ProjectCodeModel.cs (2)
57Contract.ThrowIfNull(_projectId); 58Contract.ThrowIfNull(_visualStudioWorkspace);
Options\Style\EnumCodeStyleOptionViewModel.cs (1)
30=> Contract.ThrowIfFalse(typeof(T).IsEnum);
ProjectSystem\CPS\CPSProject_IWorkspaceProjectContext.cs (1)
265Contract.ThrowIfFalse(_batchScopes.TryDequeue(out var scope));
RoslynVisualStudioWorkspace.cs (3)
87Contract.ThrowIfNull(textDocument.FilePath); 162Contract.ThrowIfNull(tree, "We have a location that was in source, but doesn't have a SourceTree."); 165Contract.ThrowIfNull(document, "We have a symbol coming from a tree, and that tree isn't in the Project it supposedly came from.");
SolutionExplorer\AnalyzerReferenceManager.cs (1)
64Contract.ThrowIfNull(_tracker.SelectedHierarchy);
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (2)
109Contract.ThrowIfFalse(HasItems); 182Contract.ThrowIfNull(_items, "We only subscribe to events after we create the items, so this should not be null.");
SolutionExplorer\SourceGeneratedFileItems\SourceGeneratedFileItemSource.cs (1)
163Contract.ThrowIfTrue(_cancellationSeries.HasActiveToken);
Microsoft.VisualStudio.LanguageServices.New.IntegrationTests (6)
InProcess\EditorInProcess.cs (3)
147Contract.ThrowIfNull(subjectBuffer); 291Contract.ThrowIfNull(session); 304Contract.ThrowIfNull(session);
InProcess\SolutionExplorerInProcess.cs (1)
39Contract.ThrowIfTrue(await IsSolutionOpenAsync(cancellationToken));
InProcess\WorkspaceInProcess.cs (1)
138Contract.ThrowIfFalse(await statusService.IsFullyLoadedAsync(cancellationToken));
IntegrationHelper.cs (1)
276Contract.ThrowIfNull(moniker);
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
ProjectSystemShim\TempPECompiler.TempPEProject.vb (1)
74Contract.ThrowIfFalse(itemid = VSConstants.VSITEMID.Nil)
ProjectSystemShim\TempPECompiler.vb (1)
26Contract.ThrowIfFalse(ppErrors = IntPtr.Zero)
Microsoft.VisualStudio.LanguageServices.Xaml (8)
Implementation\LanguageServer\Handler\Commands\CreateEventCommandHandler.cs (1)
47Contract.ThrowIfNull(request.Arguments);
Implementation\LanguageServer\Handler\Completion\CompletionResolveHandler.cs (1)
48Contract.ThrowIfNull(context.Solution);
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (2)
111Contract.ThrowIfNull(sourceDefinition.FilePath); 153Contract.ThrowIfNull(symbolDefinition.Symbol);
Implementation\LanguageServer\Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
64Contract.ThrowIfNull(context.Solution);
Implementation\LanguageServer\Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (1)
43Contract.ThrowIfNull(context.Solution);
Implementation\LanguageServer\Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
56Contract.ThrowIfNull(result.TextChange.NewText);
Implementation\LanguageServer\Handler\OnTypeRename\OnTypeRenameHandler.cs (1)
89Contract.ThrowIfTrue(result.Ranges.IsDefault);
Roslyn.VisualStudio.DiagnosticsWindow (1)
DiagnosticsWindow.cs (1)
71Contract.ThrowIfFalse(Workspace == null);
Roslyn.VisualStudio.Next.UnitTests (3)
Remote\SerializationValidator.cs (3)
83Contract.ThrowIfNull(data.Value); 97Contract.ThrowIfNull<object?>(result); 213Contract.ThrowIfFalse(solution.State.TryGetStateChecksums(out var solutionObjectFromSolution));