71 references to ThrowIfNull
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
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.");
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
91Contract.ThrowIfNull(typeInferenceService, nameof(typeInferenceService));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
CSharpIndentationService.Indenter.cs (2)
272Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???"); 285Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???");
ReassignedVariable\CSharpReassignedVariableService.cs (1)
51Contract.ThrowIfNull(current, "Couldn't find a suitable parent of this local declaration");
Microsoft.CodeAnalysis.EditorFeatures (5)
EditAndContinue\ActiveStatementTrackingService.cs (1)
86Contract.ThrowIfNull(session, "Active statement tracking not started.");
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");
InlineRename\InlineRenameService.cs (1)
103Contract.ThrowIfNull(snapshot, "The document used for starting the inline rename session should still be open and associated with a snapshot.");
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.");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
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");
Workspaces\TestHostDocument.cs (2)
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.");
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Shared\Extensions\ITextSnapshotLineExtensions.cs (3)
72Contract.ThrowIfNull(line, "line"); 95Contract.ThrowIfNull(line, @"line"); 96Contract.ThrowIfNull(predicate, @"tree");
Microsoft.CodeAnalysis.Features (4)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
538Contract.ThrowIfNull(containingMember,
EditAndContinue\EditAndContinueWorkspaceService.cs (1)
177Contract.ThrowIfNull(debuggingSession, "Debugging session has not started.");
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
448Contract.ThrowIfNull(parameterSymbol, "We filtered out varags methods earlier.");
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
351Contract.ThrowIfNull(compilation, "We are trying to produce a key for a language that doesn't support compilations.");
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
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\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
369Contract.ThrowIfNull(diagnosticData.Message, $"Got a document diagnostic that did not have a {nameof(diagnosticData.Message)}");
Handler\RequestMetrics.cs (1)
49Contract.ThrowIfNull(_queuedDuration, "RecordExecutionStart was not called");
Handler\SemanticTokens\SemanticTokensRangeHandler.cs (1)
45Contract.ThrowIfNull(request.TextDocument, "TextDocument is null.");
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\IGlobalServiceBroker.cs (1)
45Contract.ThrowIfNull(s_instance, "Global service broker not registered");
Microsoft.CodeAnalysis.VisualBasic.Features (2)
Completion\KeywordRecommenders\Expressions\TrueFalseKeywordRecommender.vb (1)
33Contract.ThrowIfNull(typeInferenceService, NameOf(typeInferenceService))
ExtractMethod\VisualBasicSelectionResult.vb (1)
126Contract.ThrowIfNull(scope, "Should always find an expression given that SelectionInExpression was true")
Microsoft.CodeAnalysis.Workspaces (20)
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 (6)
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));
Remote\RemoteArguments.cs (1)
69Contract.ThrowIfNull(project, WorkspacesResources.Symbols_project_could_not_be_found_in_the_provided_solution);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
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.");
Workspace\Solution\Solution.cs (2)
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.cs (2)
225Contract.ThrowIfNull(oldDocumentId, $"{nameof(oldTree)} came from the compilation produced by the workspace, so the document ID should have existed."); 301Contract.ThrowIfNull(finalCompilation, "We have a FinalState, so we must have a non-null final compilation");
Workspace\Solution\StateChecksums.cs (4)
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."); 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\Workspace_Editor.cs (1)
276Contract.ThrowIfNull(currentContextId, "The document is open, so we should have had some context ID.");
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
30Contract.ThrowIfNull(sourceText, "Failed to fetch the text of an additional file.");
Microsoft.VisualStudio.IntegrationTest.Utilities (1)
InProcess\CodeDefinitionWindow_InProc.cs (1)
43Contract.ThrowIfNull(wpfView, "We were unable to get the Code Definition Window view.");
Microsoft.VisualStudio.LanguageServices (16)
Interop\ComAggregate.cs (3)
44Contract.ThrowIfNull(value, "value"); 57Contract.ThrowIfNull(comWrapper, "comWrapper"); 62Contract.ThrowIfNull(target, "target");
LanguageService\AbstractLanguageService`2.cs (1)
182Contract.ThrowIfNull(wpfTextView, "Could not get IWpfTextView for IVsTextView");
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.");
Packaging\PackageInstallerServiceFactory.cs (2)
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?");
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.");
ProjectSystem\VisualStudioWorkspaceImpl.cs (3)
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.");
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.");
Microsoft.VisualStudio.LanguageServices.Implementation (3)
RoslynVisualStudioWorkspace.cs (2)
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\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (1)
182Contract.ThrowIfNull(_items, "We only subscribe to events after we create the items, so this should not be null.");