35 references to ThrowIfTrue
Microsoft.CodeAnalysis.CSharp.Features (1)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
194Contract.ThrowIfTrue(
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
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.");
Microsoft.CodeAnalysis.EditorFeatures (8)
FindUsages\BufferedFindUsagesContext.cs (5)
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.");
InlineRename\InlineRenameService.cs (1)
195Contract.ThrowIfTrue(_activeRenameSession != null && value != null, "Cannot assign an active rename session when one is already in progress.");
IntelliSense\ModelComputation.cs (1)
136Contract.ThrowIfTrue(_stopCancellationToken.IsCancellationRequested, "should not chain tasks after we've been cancelled");
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (1)
313Contract.ThrowIfTrue(_dataSource.Options.Any(o => o is not Option2<bool> and not PerLanguageOption2<bool>), "All options must be Option2<bool> or PerLanguageOption2<bool>");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Completion\AbstractArgumentProviderTests`1.cs (2)
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.");
Workspaces\TestHostDocument.cs (1)
360Contract.ThrowIfTrue(IsSourceGenerated, "We shouldn't be producing a DocumentInfo for a source generated document.");
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
BackgroundWorkIndicator\BackgroundWorkIndicatorContext.cs (2)
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).");
Microsoft.CodeAnalysis.Features (5)
ExtractMethod\MethodExtractor.Analyzer.cs (2)
503Contract.ThrowIfTrue(bestEffort, "Should never fail if bestEffort is true"); 541Contract.ThrowIfTrue(bestEffort, "Should never fail if bestEffort is true");
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");
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (1)
123Contract.ThrowIfTrue(
Microsoft.CodeAnalysis.Workspaces (13)
FindSymbols\Declarations\DeclarationFinder.cs (2)
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");
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
28Contract.ThrowIfTrue(query.Kind == SearchKind.Custom, "Custom queries are not supported in this API");
FindSymbols\IStreamingFindReferencesProgress.cs (1)
34Contract.ThrowIfTrue(symbols.IsDefaultOrEmpty, "Symbols should be non empty");
FindSymbols\SymbolTree\SymbolTreeInfo.cs (3)
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");
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\SymbolTreeInfoCacheService.cs (2)
180Contract.ThrowIfTrue(info.Checksum != checksum, "If we computed a SymbolTreeInfo, then its checksum must match our checksum."); 202Contract.ThrowIfTrue(info.Checksum != checksum, "If we computed a SymbolTreeInfo, then its checksum must match our checksum.");
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
162Contract.ThrowIfTrue(conflictLocations.Count != 0, "We're the first phase, so we should have no conflict locations yet");
Workspace\Solution\Solution.cs (1)
69Contract.ThrowIfTrue(this.WorkspaceKind == CodeAnalysis.WorkspaceKind.RemoteWorkspace, "Access .Workspace off of a RemoteWorkspace Solution is not supported.");
Workspace\Solution\SolutionState.cs (1)
1859Contract.ThrowIfTrue(_frozenSourceGeneratedDocumentState != null, "We shouldn't be calling WithFrozenSourceGeneratedDocument on a solution with a frozen source generated document.");
Microsoft.VisualStudio.LanguageServices.Implementation (1)
CodeModel\AbstractCodeModelService.cs (1)
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.");