45 references to ThrowIfNull
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
87Contract.ThrowIfNull(typeInferenceService, nameof(typeInferenceService));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
ReassignedVariable\CSharpReassignedVariableService.cs (1)
84Contract.ThrowIfNull(current, "Couldn't find a suitable parent of this local declaration");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (2)
273Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???"); 286Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???");
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
35Contract.ThrowIfNull(_testDocument, "markup does not contain a cursor position"); 47Contract.ThrowIfNull(ProjectToBeModified, "Project with the given name does not exist");
Workspaces\EditorTestHostDocument.cs (2)
119Contract.ThrowIfNull(ExportProvider, $"Can only create text view for {nameof(TestHostDocument)} created with {nameof(ExportProvider)}"); 150Contract.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)
61Contract.ThrowIfNull(line, "line"); 83Contract.ThrowIfNull(line, @"line"); 84Contract.ThrowIfNull(predicate, @"tree");
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\SignatureHelp\FSharpSignatureHelpProvider.cs (1)
57Contract.ThrowIfNull(_legacyProvider, "Either the new or legacy provider must be available");
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (2)
Testing\RazorTestCapabilitiesProvider.cs (2)
26Contract.ThrowIfNull(RazorTestCapabilities, nameof(RazorTestCapabilities)); 27Contract.ThrowIfNull(JsonSerializerOptions, nameof(JsonSerializerOptions));
Microsoft.CodeAnalysis.Features (4)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
546Contract.ThrowIfNull(containingMember,
EditAndContinue\EditAndContinueService.cs (1)
188Contract.ThrowIfNull(debuggingSession, "Debugging session has not started.");
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
439Contract.ThrowIfNull(parameterSymbol, "We filtered out varags methods earlier.");
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
390Contract.ThrowIfNull(compilation, "We are trying to produce a key for a language that doesn't support compilations.");
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Extensions\ProtocolConversions.Diagnostics.cs (1)
114Contract.ThrowIfNull(diagnosticData.Message, $"Got a document diagnostic that did not have a {nameof(diagnosticData.Message)}");
ExternalAccess\Razor\SemanticTokensRangesHandler.cs (1)
40Contract.ThrowIfNull(request.TextDocument, "TextDocument is null.");
Handler\CodeActions\CodeActionFixAllResolveHandler.cs (1)
70Contract.ThrowIfNull(resolveData, "Missing data for fix all code action resolve request");
Handler\CodeActions\CodeActionResolveHandler.cs (1)
101Contract.ThrowIfNull(resolveData, "Missing data for code action resolve request");
Handler\CodeLens\CodeLensResolveHandler.cs (1)
96Contract.ThrowIfNull(resolveData, "Missing data for code lens resolve request");
Handler\InlayHint\InlayHintResolveHandler.cs (1)
86Contract.ThrowIfNull(resolveData, "Missing data for inlay hint resolve request");
Handler\SemanticTokens\SemanticTokensRangeHandler.cs (1)
35Contract.ThrowIfNull(request.TextDocument, "TextDocument is null.");
Handler\SourceGenerators\SourceGeneratedDocumentGetTextHandler.cs (1)
64Contract.ThrowIfNull(request.ResultId, "Attempted to reuse cache entry but given no resultId");
RoslynLanguageServer.cs (2)
193Contract.ThrowIfNull(textDocumentIdentifier, "Failed to deserialize text document identifier property"); 204Contract.ThrowIfNull(data, "Failed to document resolve data object");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
TestConfigurableDocumentHandler.cs (1)
56Contract.ThrowIfNull(_response, $"{nameof(ConfigureHandler)} has not been called");
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteServiceBrokerProvider.cs (1)
34Contract.ThrowIfNull(s_instance, "Global service broker not registered");
Microsoft.CodeAnalysis.Workspaces (12)
Remote\RemoteArguments.cs (1)
63Contract.ThrowIfNull(project, WorkspacesResources.Symbols_project_could_not_be_found_in_the_provided_solution);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
312Contract.ThrowIfNull(_cachedResult, $"We called {nameof(CompleteWithTask)} with a result, there should be a cached result.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (3)
54Contract.ThrowIfNull(concatenatedLowerCaseWords, nameof(_concatenatedLowerCaseWords)); 67Contract.ThrowIfNull(value, nameof(value)); 68Contract.ThrowIfNull(_concatenatedLowerCaseWords, nameof(_concatenatedLowerCaseWords));
TemporaryStorage\TemporaryStorageService.cs (2)
177Contract.ThrowIfNull(storageIdentifier.Name, $"{nameof(GetStreamHandle)} should only be called for VS on Windows (where named memory mapped files as supported)"); 188Contract.ThrowIfNull(storageIdentifier.Name, $"{nameof(GetTextHandle)} should only be called for VS on Windows (where named memory mapped files as supported)");
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
495Contract.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."); 600Contract.ThrowIfNull(documentInfo.FilePath, "We shouldn't be adding documents without file paths.");
Workspace\Solution\Solution.cs (2)
339Contract.ThrowIfNull(generatedDocument, "The call to GetDocumentState found a SourceGeneratedDocumentState, so we should have found it now."); 1679Contract.ThrowIfNull(newDocumentState, "Because we just froze this document, it should always exist.");
Workspace\Workspace_Editor.cs (1)
272Contract.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.LanguageServices.Implementation (2)
RoslynVisualStudioWorkspace.cs (2)
159Contract.ThrowIfNull(tree, "We have a location that was in source, but doesn't have a SourceTree."); 162Contract.ThrowIfNull(document, "We have a symbol coming from a tree, and that tree isn't in the Project it supposedly came from.");