27 references to ThrowIfFalse
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.Features (8)
Completion\Utilities.cs (1)
54Contract.ThrowIfFalse(document.SupportsSemanticModel, "Should only be called from C#/VB providers.");
EmbeddedLanguages\ExportEmbeddedLanguageFeatureServiceAttribute.cs (1)
60Contract.ThrowIfFalse(name is PredefinedEmbeddedLanguageNames.Regex or PredefinedEmbeddedLanguageNames.Json,
ExternalAccess\UnitTesting\API\UnitTestingHotReloadService.cs (3)
73Contract.ThrowIfFalse(_sessionId == default, "Session already started"); 90Contract.ThrowIfFalse(sessionId != default, "Session has not started"); 128Contract.ThrowIfFalse(_sessionId != default, "Session has not started");
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
63Contract.ThrowIfFalse(item.DocumentId != null, "can only enqueue a document work item");
ExternalAccess\Watch\Api\WatchHotReloadService.cs (2)
150Contract.ThrowIfFalse(sessionId != default, "Session has not started"); 175Contract.ThrowIfFalse(_sessionId == default, "Session already started");
Microsoft.CodeAnalysis.LanguageServer (3)
BrokeredServices\ServiceBrokerFactory.cs (1)
65Contract.ThrowIfFalse(_container == null, "We should only create one container.");
Testing\TestDiscoverer.DiscoveryHandler.cs (2)
53Contract.ThrowIfFalse(_isComplete, "Tried to get test cases before discovery completed"); 59Contract.ThrowIfFalse(_isComplete, "Tried to get discovery status before completion");
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\InlineCompletions\XmlSnippetParser.cs (1)
70Contract.ThrowIfFalse(matchingSnippet.IsExpansionSnippet(), "Only expansion snippets are supported");
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
374Contract.ThrowIfFalse(tokenTypesToIndex.TryGetValue(tokenTypeStr, out var tokenTypeIndex), "No matching token type index found.");
Microsoft.CodeAnalysis.Workspaces (11)
CodeActions\CodeAction_Cleanup.cs (1)
200Contract.ThrowIfFalse(document.SupportsSyntaxTree, "GetDocumentIdsAndOptionsAsync should only be returning documents that support syntax");
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (2)
188Contract.ThrowIfFalse(linkedSymbols.Contains(symbol), "Linked symbols did not contain the very symbol we started with."); 191Contract.ThrowIfFalse(group.Symbols.Contains(symbol), "Symbol group did not contain the very symbol we started with.");
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (1)
241Contract.ThrowIfFalse(projects.Count == 1, "Only a single project should be passed in");
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
58Contract.ThrowIfFalse(index != null || loadOnly == true, "Result can only be null if 'loadOnly: true' was passed.");
Serialization\SerializerService_Reference.cs (2)
78Contract.ThrowIfFalse(TryGetAnalyzerImageReferenceGuid(analyzerImageReference, out var guid), "AnalyzerImageReferences are only supported during testing"); 153Contract.ThrowIfFalse(TryGetAnalyzerImageReferenceGuid(analyzerImageReference, out var guid), "AnalyzerImageReferences are only supported during testing");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
71Contract.ThrowIfFalse(surrogateChar == 0 || rune == Rune.ReplacementChar,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ValueTaskExtensions.cs (1)
22Contract.ThrowIfFalse(task.IsCompleted, message);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (1)
160Contract.ThrowIfFalse(newRefCount >= 0, "Ref count cannot be negative");
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
996/// 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
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Remote\TestSerializerService.cs (1)
154Contract.ThrowIfFalse(_sharedTestGeneratorReferences == null ||