18 references to ThrowIfFalse
Microsoft.CodeAnalysis.Features (6)
Completion\Utilities.cs (1)
54
Contract.
ThrowIfFalse
(document.SupportsSemanticModel, "Should only be called from C#/VB providers.");
EmbeddedLanguages\ExportEmbeddedLanguageFeatureServiceAttribute.cs (1)
60
Contract.
ThrowIfFalse
(name is PredefinedEmbeddedLanguageNames.Regex or PredefinedEmbeddedLanguageNames.Json,
ExternalAccess\UnitTesting\API\UnitTestingHotReloadService.cs (3)
74
Contract.
ThrowIfFalse
(_sessionId == default, "Session already started");
91
Contract.
ThrowIfFalse
(sessionId != default, "Session has not started");
129
Contract.
ThrowIfFalse
(_sessionId != default, "Session has not started");
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
63
Contract.
ThrowIfFalse
(item.DocumentId != null, "can only enqueue a document work item");
Microsoft.CodeAnalysis.Workspaces (12)
CodeActions\CodeAction_Cleanup.cs (1)
200
Contract.
ThrowIfFalse
(document.SupportsSyntaxTree, "GetDocumentIdsAndOptionsAsync should only be returning documents that support syntax");
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (2)
188
Contract.
ThrowIfFalse
(linkedSymbols.Contains(symbol), "Linked symbols did not contain the very symbol we started with.");
191
Contract.
ThrowIfFalse
(group.Symbols.Contains(symbol), "Symbol group did not contain the very symbol we started with.");
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (1)
236
Contract.
ThrowIfFalse
(projects.Count == 1, "Only a single project should be passed in");
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
58
Contract.
ThrowIfFalse
(index != null || loadOnly == true, "Result can only be null if 'loadOnly: true' was passed.");
Serialization\SerializerService_Reference.cs (2)
81
Contract.
ThrowIfFalse
(TryGetAnalyzerImageReferenceGuid(analyzerImageReference, out var guid), "AnalyzerImageReferences are only supported during testing");
156
Contract.
ThrowIfFalse
(TryGetAnalyzerImageReferenceGuid(analyzerImageReference, out var guid), "AnalyzerImageReferences are only supported during testing");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ValueTaskExtensions.cs (2)
22
Contract.
ThrowIfFalse
(task.IsCompleted, message);
38
Contract.
ThrowIfFalse
(task.IsCompleted, message);
TemporaryStorage\TemporaryStorageService.cs (1)
186
Contract.
ThrowIfFalse
(PlatformInformation.IsWindows, $"{nameof(GetStreamHandle)} should only be called for VS on Windows (where named memory mapped files as supported)");
Workspace\ProjectSystem\ReferenceFileChangeTracker.cs (1)
136
Contract.
ThrowIfFalse
(newRefCount >= 0, "Ref count cannot be negative");
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
1005
/// This is just the same as <see cref="Contract.
ThrowIfFalse
(bool, string, int, string)"/> but throws a custom exception type to make this easier to find in telemetry since the exception type