126 references to ThrowIfTrue
Microsoft.CodeAnalysis.Workspaces (126)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (5)
101
Contract.
ThrowIfTrue
(commonLeftWidth > oldRootWidth);
102
Contract.
ThrowIfTrue
(commonLeftWidth > newRootWidth);
103
Contract.
ThrowIfTrue
(commonRightWidth > oldRootWidth);
104
Contract.
ThrowIfTrue
(commonRightWidth > newRootWidth);
178
Contract.
ThrowIfTrue
(oldRoot.IsIncrementallyIdenticalTo(newRoot));
CodeCleanup\AbstractCodeCleanerService.cs (5)
239
Contract.
ThrowIfTrue
(spanMarkerType == SpanMarkerType.EndOfFile);
240
Contract.
ThrowIfTrue
(previousToken.RawKind == 0);
255
Contract.
ThrowIfTrue
(spanMarkerType == SpanMarkerType.BeginningOfFile);
256
Contract.
ThrowIfTrue
(nextToken.RawKind == 0);
371
Contract.
ThrowIfTrue
(startToken.RawKind == 0 || endToken.RawKind == 0);
CodeFixesAndRefactorings\FixAllLogger.cs (1)
95
Contract.
ThrowIfTrue
(completed && timedOut);
Diagnostics\AnalysisResultPair.cs (1)
29
Contract.
ThrowIfTrue
(projectAnalysisResult is null && hostAnalysisResult is null);
Diagnostics\CompilationWithAnalyzersPair.cs (1)
32
Contract.
ThrowIfTrue
(projectCompilationWithAnalyzers is null && hostCompilationWithAnalyzers is null);
Diagnostics\DiagnosticAnalysisResult.cs (1)
222
Contract.
ThrowIfTrue
(_others.IsDefault);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
46
Contract.
ThrowIfTrue
(Project.SupportsCompilation);
Editing\SyntaxGenerator.cs (1)
1383
Contract.
ThrowIfTrue
(ReferenceEquals(root, node));
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
44
Contract.
ThrowIfTrue
(dehydrated.Symbols.Count == 0);
FindSymbols\SymbolFinder_Helpers.cs (1)
131
Contract.
ThrowIfTrue
(equivalentTypesWithDifferingAssemblies.Count == 0);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (2)
127
Contract.
ThrowIfTrue
((uint)accessibility > Max4BitValue);
128
Contract.
ThrowIfTrue
((uint)kind > Max5BitValue);
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (2)
55
Contract.
ThrowIfTrue
(newDocumentsAndHashes.Count == 0);
94
Contract.
ThrowIfTrue
(newDocumentsAndHashes.Count < 2);
Options\DocumentOptionSet.cs (1)
78
Contract.
ThrowIfTrue
(internallyDefinedOption.Type == typeof(NamingStylePreferences));
Remote\RemoteServiceCallbackDispatcher.cs (1)
25
Contract.
ThrowIfTrue
(callbackInstances?.TryRemove(Id, out _) == false);
Rename\LightweightRenameLocations.cs (3)
40
Contract.
ThrowIfTrue
(locations.IsDefault);
41
Contract.
ThrowIfTrue
(implicitLocations.IsDefault);
42
Contract.
ThrowIfTrue
(referencedSymbols.IsDefault);
Rename\Renamer.cs (2)
154
Contract.
ThrowIfTrue
(string.IsNullOrEmpty(newName));
199
Contract.
ThrowIfTrue
(string.IsNullOrEmpty(newName));
Rename\SymbolicRenameLocations.cs (3)
43
Contract.
ThrowIfTrue
(locations.IsDefault);
44
Contract.
ThrowIfTrue
(implicitLocations.IsDefault);
45
Contract.
ThrowIfTrue
(referencedSymbols.IsDefault);
Serialization\SerializedPortableExecutableReference.cs (1)
35
Contract.
ThrowIfTrue
(storageHandles.IsDefault);
Serialization\SerializerService_Reference.cs (2)
356
Contract.
ThrowIfTrue
(handles.Count == 0);
439
Contract.
ThrowIfTrue
(length != storageHandle.Identifier.Size);
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
89
Contract.
ThrowIfTrue
(start < text.Lines.GetLinePosition(0));
90
Contract.
ThrowIfTrue
(end > text.Lines.GetLinePosition(text.Length));
Shared\Extensions\SourceTextExtensions.cs (7)
199
Contract.
ThrowIfTrue
(buffer.Length != CharArrayLength);
255
Contract.
ThrowIfTrue
(chunkSize != CharArrayLength);
268
Contract.
ThrowIfTrue
(length > CharArrayLength);
272
Contract.
ThrowIfTrue
(currentChunk.Length != CharArrayLength);
275
Contract.
ThrowIfTrue
(i < numberOfChunks - 1 && currentChunkLength != CharArrayLength);
284
Contract.
ThrowIfTrue
(chunksArray.Any(static (c, s) => c.Length != s, CharArrayLength));
368
Contract.
ThrowIfTrue
(Position > Length);
Shared\Utilities\BloomFilter_Serialization.cs (1)
28
Contract.
ThrowIfTrue
(bitArray.Length % 8 != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
237
Contract.
ThrowIfTrue
(leftMaxEndValue < 0 && rightMaxEndValue < 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (2)
78
Contract.
ThrowIfTrue
(_currentNodeHasValue);
79
Contract.
ThrowIfTrue
(_stack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (1)
27
Contract.
ThrowIfTrue
(nodesAndTokens.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (1)
106
Contract.
ThrowIfTrue
(b1 != b2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
110
Contract.
ThrowIfTrue
(semanticModel.ParentModel.IsSpeculativeSemanticModel);
111
Contract.
ThrowIfTrue
(semanticModel.ParentModel.ParentModel != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
179
Contract.
ThrowIfTrue
(node1.RawKind == 0 || node2.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
94
Contract.
ThrowIfTrue
(treeData.Root.IsInvalidTokenRange(startToken, endToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
478
Contract.
ThrowIfTrue
(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
23
Contract.
ThrowIfTrue
(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
26
Contract.
ThrowIfTrue
(token.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (3)
18
Contract.
ThrowIfTrue
(anchorToken.RawKind == 0);
19
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
21
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (6)
19
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
20
Contract.
ThrowIfTrue
(startToken.RawKind == 0);
21
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
41
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
42
Contract.
ThrowIfTrue
(startToken.RawKind == 0);
43
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (3)
22
Contract.
ThrowIfTrue
(textSpan.Start < 0 || textSpan.Length < 0);
23
Contract.
ThrowIfTrue
(startToken.RawKind == 0);
24
Contract.
ThrowIfTrue
(endToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
79
Contract.
ThrowIfTrue
(token1 == default && token2 == default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
55
Contract.
ThrowIfTrue
(RoslynString.IsNullOrEmpty(editorConfigStringForValue));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (3)
23
Contract.
ThrowIfTrue
(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty);
62
Contract.
ThrowIfTrue
(symbol.DeclaringSyntaxReferences.IsEmpty && symbol.Locations.IsEmpty);
258
Contract.
ThrowIfTrue
(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (2)
417
Contract.
ThrowIfTrue
(_methodSymbolStack.Count == 0);
433
Contract.
ThrowIfTrue
(_contextualSymbolStack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
524
Contract.
ThrowIfTrue
(_methodSymbolStack.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (3)
165
Contract.
ThrowIfTrue
(_requests != null &&
174
Contract.
ThrowIfTrue
(_cachedResult != null &&
179
Contract.
ThrowIfTrue
(_asynchronousComputeFunction == null && _synchronousComputeFunction != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (6)
85
Contract.
ThrowIfTrue
(textSpan.IsEmpty);
149
Contract.
ThrowIfTrue
(token.RawKind == 0);
170
Contract.
ThrowIfTrue
(token1.RawKind == 0 && token2.RawKind == 0);
171
Contract.
ThrowIfTrue
(token1.Equals(token2));
290
Contract.
ThrowIfTrue
(nextToken.RawKind == 0);
316
Contract.
ThrowIfTrue
(previousToken.RawKind == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (5)
52
Contract.
ThrowIfTrue
(_index + values.Length > _values.Length);
59
Contract.
ThrowIfTrue
(_index + values.Count > _values.Length);
66
Contract.
ThrowIfTrue
(_index + values.Count > _values.Length);
73
Contract.
ThrowIfTrue
(_index + values.Count > _values.Length);
107
Contract.
ThrowIfTrue
(_index != _values.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
199
Contract.
ThrowIfTrue
(availableIndices != null && availableIndices.Count != declarationList.Count + 1);
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (3)
152
Contract.
ThrowIfTrue
(optional.HasValue && optional.Value == null);
290
Contract.
ThrowIfTrue
(exception != null);
307
Contract.
ThrowIfTrue
(exception != null);
Storage\SQLite\v2\SQLitePersistentStorage_StringIds.cs (1)
134
Contract.
ThrowIfTrue
(id == -1);
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
64
Contract.
ThrowIfTrue
(string.IsNullOrWhiteSpace(workingFolderPath));
Workspace\IsolatedAnalyzerReferenceSet.Core.cs (2)
152
Contract.
ThrowIfTrue
(_analyzerReferences.ContainsKey(checksum));
178
Contract.
ThrowIfTrue
(HasConflict(filePath, mvid));
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
612
Contract.
ThrowIfTrue
(folders.IsDefault);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
850
Contract.
ThrowIfTrue
(oldAnalyzerFilePath != newAnalyzerFilePath);
Workspace\Solution\Checksum.cs (1)
88
Contract.
ThrowIfTrue
(span.Length < HashSize);
Workspace\Solution\ChecksumsAndIds.cs (3)
23
Contract.
ThrowIfTrue
(ids.Length != checksums.Children.Length);
75
Contract.
ThrowIfTrue
(ids.Length != attributeChecksums.Children.Length);
76
Contract.
ThrowIfTrue
(ids.Length != textChecksums.Children.Length);
Workspace\Solution\DocumentState.cs (1)
403
Contract.
ThrowIfTrue
(ReferenceEquals(newAttributes, Attributes));
Workspace\Solution\ProjectState.cs (2)
990
Contract.
ThrowIfTrue
(oldDocuments.IsEmpty);
1016
Contract.
ThrowIfTrue
(oldDocuments.IsEmpty);
Workspace\Solution\Solution.cs (1)
1543
Contract.
ThrowIfTrue
(solution._documentIdToFrozenSolution.Count != 0);
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (3)
94
Contract.
ThrowIfTrue
(pendingTranslationActions is null);
105
Contract.
ThrowIfTrue
(this.CompilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
205
Contract.
ThrowIfTrue
(compilationWithoutGeneratedDocuments.SyntaxTrees.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
Workspace\Solution\SolutionCompilationState.cs (2)
77
Contract.
ThrowIfTrue
(projectCone != null);
107
Contract.
ThrowIfTrue
(_projectIdToTrackerMap.Any(kvp => kvp.Key != kvp.Value.ProjectState.Id));
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
132
Contract.
ThrowIfTrue
(forkedTrackerState is FinalCompilationTrackerState);
403
Contract.
ThrowIfTrue
(inProgressState.PendingTranslationActions.IsEmpty);
474
Contract.
ThrowIfTrue
(inProgressState.PendingTranslationActions.Count > 0);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
176
Contract.
ThrowIfTrue
(generatedSources.Length != documentsToAddOrUpdate.Count);
Workspace\Solution\SolutionState.cs (2)
1239
Contract.
ThrowIfTrue
(documentId.ProjectId == relatedProjectIdHint);
1267
Contract.
ThrowIfTrue
(relatedProject == projectState);
Workspace\Solution\TextDocumentStates.cs (1)
226
Contract.
ThrowIfTrue
(!ignoreUnchangedContent && ignoreUnchangeableDocuments);
Workspace\Solution\VersionSource\LoadableTextAndVersionSource.cs (1)
88
Contract.
ThrowIfTrue
(_gate.CurrentCount != 0);
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
160
Contract.
ThrowIfTrue
(source is LoadableTextAndVersionSource { CacheResult: true });
Workspace\Solution\VersionSource\RecoverableTextAndVersion.RecoverableText.cs (1)
134
Contract.
ThrowIfTrue
(Gate.CurrentCount != 0);
Workspace\Workspace.cs (2)
355
Contract.
ThrowIfTrue
(relatedDocumentId == addedDocumentId);
358
Contract.
ThrowIfTrue
(relatedDocumentId.ProjectId == addedDocumentId.ProjectId);