58 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)
50Contract.ThrowIfNull(current, "Couldn't find a suitable parent of this local declaration");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (2)
267Contract.ThrowIfNull(nonTerminalNode, @"Malformed code or bug in parser???"); 280Contract.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 (1)
Cohost\Handlers\InlayHints.cs (1)
48Contract.ThrowIfNull(s_resolveCache, "Cache should never be null for resolve, since it should have been created by the original request");
Microsoft.CodeAnalysis.Features (4)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
546Contract.ThrowIfNull(containingMember,
EditAndContinue\EditAndContinueService.cs (1)
198Contract.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)
378Contract.ThrowIfNull(compilation, "We are trying to produce a key for a language that doesn't support compilations.");
Microsoft.CodeAnalysis.LanguageServer (11)
BrokeredServices\MefServiceBrokerOfExportedServices.cs (1)
30Contract.ThrowIfNull(_containerTask, $"{nameof(SetContainer)} should have already been called.");
HostWorkspace\LoadedProject.cs (2)
102Contract.ThrowIfNull(_mostRecentFileInfo, "We haven't been given a loaded project yet, so we can't provide the existing TFM."); 241Contract.ThrowIfNull(_projectSystemProject.CompilationOptions, "Compilation options cannot be null for C#/VB project");
HostWorkspace\ProjectDependencyHelper.cs (1)
129Contract.ThrowIfNull(LanguageServerHost.Instance, "We don't have an LSP channel yet to send this request through.");
HostWorkspace\ProjectInitializationHandler.cs (1)
47Contract.ThrowIfNull(LanguageServerHost.Instance, "We don't have an LSP channel yet to send this request through.");
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (1)
94Contract.ThrowIfNull(instance, nameof(instance));
HostWorkspace\WorkspaceProject.cs (1)
178Contract.ThrowIfNull(_project.FilePath, "We don't have a project path at this point.");
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (1)
33Contract.ThrowIfNull(context.Solution, nameof(context.Solution));
Logging\ShowToastNotification.cs (1)
29Contract.ThrowIfNull(LanguageServerHost.Instance, "We don't have an LSP channel yet to send this request through.");
Services\StarredCompletions\StarredCompletionProvider.cs (2)
32Contract.ThrowIfNull(provider, "ProvideCompletionsAsync must have completed successfully for GetChangeAsync to be called"); 39Contract.ThrowIfNull(provider, "ProvideCompletionsAsync must have completed successfully for GetDescriptionAsync to be called");
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Extensions\ProtocolConversions.Diagnostics.cs (1)
110Contract.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)
69Contract.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)
95Contract.ThrowIfNull(resolveData, "Missing data for code lens resolve request");
Handler\InlayHint\InlayHintResolveHandler.cs (1)
85Contract.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)
197Contract.ThrowIfNull(textDocumentIdentifier, "Failed to deserialize text document identifier property"); 208Contract.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)
338Contract.ThrowIfNull(generatedDocument, "The call to GetDocumentState found a SourceGeneratedDocumentState, so we should have found it now."); 1640Contract.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.MSBuild (3)
MSBuild\BuildHostProcessManager.cs (2)
111Contract.ThrowIfNull(process, "Process.Start failed to launch a process."); 180Contract.ThrowIfNull(sender, $"{nameof(BuildHostProcess)}.{nameof(BuildHostProcess.Disconnected)} was raised with a null sender.");
Rpc\RpcClient.cs (1)
136Contract.ThrowIfNull(result, "We expected a non-null result but got null back.");
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.");