288 references to AssumeNotNull
Microsoft.AspNetCore.Mvc.Razor.Extensions.UnitTests (12)
IsViewComponentTest.cs (12)
27
TestViewComponentAttributeSymbol = Compilation.GetTypeByMetadataName(typeof(TestViewComponentAttribute).FullName.
AssumeNotNull
()).
AssumeNotNull
();
28
TestNonViewComponentAttributeSymbol = Compilation.GetTypeByMetadataName(typeof(TestNonViewComponentAttribute).FullName.
AssumeNotNull
()).
AssumeNotNull
();
35
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Valid_PlainViewComponent).FullName.
AssumeNotNull
());
49
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Valid_DecoratedVC).FullName.
AssumeNotNull
());
63
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Valid_InheritedVC).FullName.
AssumeNotNull
());
77
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_AbstractViewComponent).FullName.
AssumeNotNull
());
91
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_GenericViewComponent<>).FullName.
AssumeNotNull
());
105
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_InternalViewComponent).FullName.
AssumeNotNull
());
119
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_DecoratedViewComponent).FullName.
AssumeNotNull
());
133
var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_InheritedViewComponent).FullName.
AssumeNotNull
());
Microsoft.AspNetCore.Razor.Microbenchmarks (5)
Formatting\DocumentFormattingBenchmark.cs (3)
72
var document = _workspace.CurrentSolution.GetAdditionalDocument(documentId).
AssumeNotNull
();
126
var changes = _formattingService.
AssumeNotNull
().GetDocumentFormattingChangesAsync(
127
_documentContext.
AssumeNotNull
(),
Serialization\CompletionListSerializationBenchmark.cs (2)
44
deserializedCompletions = JsonSerializer.Deserialize<CompletionList>(stream).
AssumeNotNull
();
61
deserializedCompletions = JsonSerializer.Deserialize<CompletionList>(stream).
AssumeNotNull
();
Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler (11)
TagHelperCollectionAccessBenchmark.cs (9)
30
var collection = _collection1.
AssumeNotNull
();
46
var collection = _collection1.
AssumeNotNull
();
60
var collection = _collection1.
AssumeNotNull
();
74
var collection = _collection1.
AssumeNotNull
();
88
var collection = _collection1.
AssumeNotNull
();
98
var collection1 = _collection1.
AssumeNotNull
();
99
var collection2 = _collection2.
AssumeNotNull
();
107
var collection = _collection1.
AssumeNotNull
();
114
var collection = _collection1.
AssumeNotNull
();
TagHelperCollectionMergeBenchmark.cs (2)
77
var collection1 = _collection1.
AssumeNotNull
();
78
var collection2 = _collection2.
AssumeNotNull
();
Microsoft.AspNetCore.Razor.Test.Common.Cohosting (11)
CohostTestBase.cs (7)
45
private protected TestIncompatibleProjectService IncompatibleProjectService => _incompatibleProjectService.
AssumeNotNull
();
48
private protected CodeAnalysis.Workspace LocalWorkspace => _localWorkspace.
AssumeNotNull
();
49
private protected IClientSettingsManager ClientSettingsManager => _clientSettingsManager.
AssumeNotNull
();
54
private protected ExportProvider LocalExportProvider => _localExportProvider.
AssumeNotNull
();
59
private protected ExportProvider OOPExportProvider => _exportProvider.
AssumeNotNull
();
116
remoteClientManager.Update(_clientSettingsManager.
AssumeNotNull
().GetClientSettings());
277
return builder.Build(solution).GetAdditionalDocument(documentId).
AssumeNotNull
();
RazorProjectBuilder.cs (3)
136
build_property.MSBuildProjectDirectory = {Path.GetDirectoryName(ProjectFilePath).
AssumeNotNull
()}
140
var projectBasePath = Path.GetDirectoryName(ProjectFilePath).
AssumeNotNull
();
152
[{additionalDocument.filePath.
AssumeNotNull
().Replace('\\', '/')}]
TestFileSystem.cs (1)
24
=> files.
AssumeNotNull
().Single(f => FilePathNormalizingComparer.Instance.Equals(f.filePath, filePath)).contents;
Microsoft.AspNetCore.Razor.Test.Common.Tooling (8)
LanguageServer\CSharpTestLspServer.cs (2)
167
await (Task)shutdownAsyncMethod.Invoke(_roslynLanguageServer, parameters: [$"{nameof(CSharpTestLspServer)} shutting down"]).
AssumeNotNull
();
173
await (Task)exitAsyncMethod.Invoke(_roslynLanguageServer, parameters: [null]).
AssumeNotNull
();
LanguageServer\TestRazorDocumentServiceProvider.cs (1)
35
return (this as TService).
AssumeNotNull
();
Mef\ExportProviderExtensions.cs (1)
82
contractType = contractType.GetElementType().
AssumeNotNull
();
Workspaces\WorkspaceTestBase.cs (4)
77
_hostServices.
AssumeNotNull
();
78
_workspace.
AssumeNotNull
();
79
_workspaceProvider.
AssumeNotNull
();
80
_languageServerFeatureOptions.
AssumeNotNull
();
Microsoft.AspNetCore.Razor.Utilities.Shared (3)
FileUtilities.cs (1)
63
var directoryName = Path.GetDirectoryName(path).
AssumeNotNull
();
PooledObjects\PooledArrayBuilder`1.cs (2)
672
=> ImmutableCollectionsMarshal.AsArray(ToImmutable()).
AssumeNotNull
();
675
=> ImmutableCollectionsMarshal.AsArray(ToImmutableAndClear()).
AssumeNotNull
();
Microsoft.CodeAnalysis.Razor.Compiler (51)
CSharp\DefaultTagHelperDescriptorFactory.cs (1)
36
typeName.FullName.
AssumeNotNull
(), assemblyName,
Language\BoundAttributeDescriptor.cs (1)
23
public string TypeName => TypeNameObject.FullName.
AssumeNotNull
();
Language\BoundAttributeParameterDescriptor.cs (1)
19
public string TypeName => TypeNameObject.FullName.
AssumeNotNull
();
Language\CodeGeneration\CodeRenderingContext.cs (1)
30
public IntermediateNodeVisitor Visitor => _visitor.
AssumeNotNull
();
Language\Components\ComponentBindLoweringPass.cs (5)
113
var bindNode = existingEntry.BindNode.
AssumeNotNull
();
426
var bindGetNode = bindEntry.BindGetNode.
AssumeNotNull
();
568
: ComponentAttributeIntermediateNode.From(getNode.
AssumeNotNull
(), addChildren: false);
591
: ComponentAttributeIntermediateNode.From(getNode.
AssumeNotNull
(), addChildren: false);
618
: ComponentAttributeIntermediateNode.From(getNode.
AssumeNotNull
(), addChildren: false);
Language\Components\ComponentDesignTimeNodeWriter.cs (1)
547
context.CodeWriter.Write(node.Component.TypeNamespace.
AssumeNotNull
());
Language\Components\ComponentEventHandlerLoweringPass.cs (1)
177
var eventArgsType = node.TagHelper.GetEventArgsType().
AssumeNotNull
();
Language\Components\ComponentGenericTypePass.cs (2)
417
var @namespace = documentNode.FindPrimaryNamespace().
AssumeNotNull
().Name;
419
@namespace += "." + documentNode.FindPrimaryClass().
AssumeNotNull
().Name;
Language\Components\ComponentTemplateDiagnosticPass.cs (1)
60
_candidates.Add(new IntermediateNodeReference(node, Parent.
AssumeNotNull
()));
Language\Components\EventHandlerMetadata.cs (1)
26
EventArgsType = EventArgsType.
AssumeNotNull
()
Language\DefaultRazorCSharpLoweringPhase.cs (1)
111
var filePath = sourceDocument.FilePath.
AssumeNotNull
();
Language\DefaultRazorTagHelperContextDiscoveryPhase.cs (2)
90
protected RazorSourceDocument Source => _source.
AssumeNotNull
();
240
var tagHelpers = _tagHelpers.
AssumeNotNull
();
Language\Extensions\PreallocatedTagHelperAttributeOptimizationPass.cs (2)
60
foreach (var current in _classDeclaration.
AssumeNotNull
().Children)
109
foreach (var current in _classDeclaration.
AssumeNotNull
().Children)
Language\Intermediate\TagHelperDirectiveAttributeParameterIntermediateNode.cs (1)
20
public BoundAttributeParameterDescriptor BoundAttributeParameter => _match.Parameter.
AssumeNotNull
();
Language\Legacy\ClassifiedSpanVisitor.cs (1)
411
=> _currentBlockSpan ??= _currentBlock.
AssumeNotNull
().GetSourceSpan(_source);
Language\Legacy\TagHelperParseTreeRewriter.cs (3)
279
tracker.
AssumeNotNull
().OpenMatchingTags++;
333
if (tracker.
AssumeNotNull
().OpenMatchingTags > 0)
671
return CurrentTagHelperTracker.
AssumeNotNull
().AllowedChildren.Length > 0;
Language\RazorCodeDocument.cs (7)
112
=> _tagHelpers.
AssumeNotNull
();
133
=> _referencedTagHelpers.
AssumeNotNull
();
154
=> _syntaxTree.
AssumeNotNull
();
176
=> _tagHelperRewrittenSyntaxTree.
AssumeNotNull
();
225
=> _tagHelperContext.
AssumeNotNull
();
248
=> _documentNode.
AssumeNotNull
();
270
=> _csharpDocument.
AssumeNotNull
();
Language\RazorEngineFeatureBase.cs (1)
16
get => _engine.
AssumeNotNull
(Resources.FeatureMustBeInitialized);
Language\RazorEnginePhaseBase.cs (1)
16
get => _engine.
AssumeNotNull
(Resources.PhaseMustBeInitialized);
Language\RazorProjectEngineFeatureBase.cs (1)
15
get => _projectEngine.
AssumeNotNull
(Resources.FeatureMustBeInitialized);
Language\Syntax\BaseMarkupEndTagSyntax.cs (1)
89
.
AssumeNotNull
($"ToListNode should not return null since builder was not empty.");
Language\Syntax\BaseMarkupStartTagSyntax.cs (1)
120
.
AssumeNotNull
($"ToListNode should not return null since builder was not empty.");
Language\Syntax\SyntaxList`1.cs (1)
83
return (TNode)Node.GetNodeSlot(index).
AssumeNotNull
();
Language\Syntax\SyntaxSerializer.cs (1)
129
var tagHelperInfo = node.TagHelperInfo.
AssumeNotNull
();
Language\TagHelperDescriptor.cs (1)
28
public string TypeName => TypeNameObject.FullName.
AssumeNotNull
();
Language\TagHelperDescriptorBuilder.cs (2)
41
public string Name => _name.
AssumeNotNull
();
42
public string AssemblyName => _assemblyName.
AssumeNotNull
();
Language\TagHelperMatchingConventions.cs (2)
291
return attributeValue.StartsWith(descriptor.Value.
AssumeNotNull
(), StringComparison.Ordinal);
293
return attributeValue.EndsWith(descriptor.Value.
AssumeNotNull
(), StringComparison.Ordinal);
Language\TagHelperObjectBuilderCollection`2.cs (1)
28
=> _builders.
AssumeNotNull
()[index];
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (3)
100
TagHelperKind.Component, typeName.FullName.
AssumeNotNull
(), assemblyName, out var builder);
230
if (property.SetMethod.
AssumeNotNull
().IsInitOnly)
292
var methodSymbol = ((INamedTypeSymbol)prop.Type).DelegateInvokeMethod.
AssumeNotNull
();
Mvc.Version2_X\PagesPropertyInjectionPass.cs (1)
27
var @class = visitor.Class.
AssumeNotNull
();
Mvc\PagesPropertyInjectionPass.cs (1)
31
var @class = visitor.Class.
AssumeNotNull
();
Mvc\ViewComponentMetadata.cs (1)
37
=> new(Name.
AssumeNotNull
(), OriginalTypeNameObject);
Microsoft.CodeAnalysis.Razor.UnitTests (1)
IsTagHelperTest.cs (1)
15
ITagHelperSymbol = Compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper).
AssumeNotNull
();
Microsoft.CodeAnalysis.Razor.Workspaces (38)
AdhocServices.cs (2)
33
.
AssumeNotNull
();
57
return result.
AssumeNotNull
();
CodeActions\CodeActionResolveService.cs (2)
63
resolvedDelegatedCodeAction.
AssumeNotNull
(),
69
resolvedDelegatedCodeAction.
AssumeNotNull
(),
CodeActions\Models\CodeActionExtensions.cs (4)
45
var serializedParams = JsonSerializer.SerializeToNode(razorCodeAction.Data).
AssumeNotNull
();
112
var nestedCodeAction = nestedAction.Deserialize<RazorVSInternalCodeAction>(JsonHelpers.JsonSerializerOptions).
AssumeNotNull
();
123
var newActionData = JsonSerializer.SerializeToNode(resolutionParams).
AssumeNotNull
();
140
var newArg = JsonSerializer.SerializeToNode(arg, JsonHelpers.JsonSerializerOptions).
AssumeNotNull
();
CodeActions\Razor\ComponentAccessibilityCodeActionProvider.cs (1)
180
additionalEdit = CreateRenameTagEdit(context, startTag, newTagName).DocumentChanges!.Value.First().First.
AssumeNotNull
();
CodeActions\Razor\ExtractToComponentCodeActionResolver.cs (1)
46
var directoryName = Path.GetDirectoryName(path).
AssumeNotNull
();
CodeActions\Razor\GenerateEventHandlerCodeActionProvider.cs (1)
32
var owner = syntaxRoot.FindToken(context.StartAbsoluteIndex).Parent.
AssumeNotNull
();
CodeActions\Razor\PromoteUsingCodeActionResolver.cs (1)
40
var folder = Path.GetDirectoryName(file).
AssumeNotNull
();
Completion\AbstractRazorCompletionFactsService.cs (2)
92
return previousToken.Parent.
AssumeNotNull
();
102
return previousToken2.Parent.
AssumeNotNull
();
Completion\DirectiveAttributeCompletionItemProvider.cs (1)
223
var indexerNamePrefix = indexerAttribute.IndexerNamePrefix.
AssumeNotNull
();
Completion\DirectiveAttributeCompletionItemProviderBase.cs (2)
83
var nameEnd = attributeNameNode?.Span.End ?? directiveAttributeTransition.
AssumeNotNull
().Span.End;
97
var nameEnd = attributeNameNode?.Span.End ?? directiveAttributeTransition.
AssumeNotNull
().Span.End;
Completion\RazorCompletionListProvider.cs (1)
116
var filePath = codeDocument.Source.FilePath.
AssumeNotNull
();
DocumentMapping\RazorEditService_UsingDirectives.cs (1)
187
@namespace.
AssumeNotNull
();
Extensions\RazorSyntaxNodeExtensions.cs (1)
276
node.
AssumeNotNull
();
Extensions\RazorSyntaxNodeOrTokenExtensions.cs (2)
13
: nodeOrToken.AsNode().
AssumeNotNull
().ContainsOnlyWhitespace(includingNewLines);
18
: nodeOrToken.AsNode().
AssumeNotNull
().GetLinePositionSpan(source);
Extensions\TextLineExtensions.cs (3)
16
var text = line.Text.
AssumeNotNull
();
26
? line.Text.
AssumeNotNull
().ToString(TextSpan.FromBounds(line.Start, line.Start + offset))
32
var text = line.Text.
AssumeNotNull
();
Formatting\FormattingUtilities.cs (2)
54
var text = line.Text.
AssumeNotNull
();
463
var lineText = formattedLine.Text.
AssumeNotNull
();
Formatting\Passes\CSharpFormattingPass.CSharpDocumentGenerator.cs (1)
168
private readonly RazorCSharpDocument _csharpDocument = codeDocument.GetCSharpDocument().
AssumeNotNull
();
Formatting\Passes\CSharpOnTypeFormattingPass.cs (1)
499
nextSpan.AsNode().
AssumeNotNull
().FirstAncestorOrSelf<CSharpTemplateBlockSyntax>() is { } template &&
Formatting\Passes\RazorFormattingPass.cs (1)
169
var codeNode = code.
AssumeNotNull
();
Formatting\UsingDirectiveHelper.cs (1)
100
var nameSyntax = usingDirectiveSyntax.Name.
AssumeNotNull
();
Hover\HoverFactory.cs (3)
95
var filePath = codeDocument.Source.FilePath.
AssumeNotNull
();
106
var containingTag = containingTagNameToken.Parent.
AssumeNotNull
();
129
selectedAttributeName.
AssumeNotNull
(),
Logging\ILoggerFactoryExtensions.cs (1)
18
return factory.GetOrCreateLogger(TrimTypeName(type.FullName.
AssumeNotNull
()));
Rename\RenameService.cs (1)
146
var directoryName = Path.GetDirectoryName(originalPath).
AssumeNotNull
();
Tooltip\BoundAttributeDescriptionInfo.cs (1)
44
returnTypeName.
AssumeNotNull
(),
UriExtensions.cs (1)
22
=> uri.ParsedUri.
AssumeNotNull
();
Microsoft.CodeAnalysis.Remote.Razor (20)
Completion\RemoteCompletionService.cs (1)
384
var item = JsonHelpers.Convert<CompletionItem, VSInternalCompletionItem>(result).
AssumeNotNull
();
DocumentMapping\RemoteSpanMappingService.cs (1)
112
var filePath = codeDocument.Source.FilePath.
AssumeNotNull
();
ProjectSystem\Extensions.cs (1)
28
var document = solution.GetAdditionalDocument(documentId).
AssumeNotNull
();
ProjectSystem\RemoteDocumentSnapshot.cs (5)
35
public string FilePath => TextDocument.FilePath.
AssumeNotNull
();
36
public string TargetPath => TextDocument.FilePath.
AssumeNotNull
();
82
.
AssumeNotNull
();
105
return new(tree.
AssumeNotNull
());
115
return tree.
AssumeNotNull
();
ProjectSystem\RemoteProjectSnapshot.cs (2)
42
.Select(static d => d.FilePath.
AssumeNotNull
());
44
public string FilePath => _project.FilePath.
AssumeNotNull
();
RazorBrokeredServiceBase.cs (1)
56
return RazorBrokeredServiceImplementation.RunServiceAsync(solutionInfo, _serviceBrokerClient.
AssumeNotNull
(), implementation, cancellationToken);
RazorBrokeredServiceBase.FactoryBase`1.cs (2)
102
var inProcArgs = new ServiceArgs(ServiceBroker: null, exportProvider, targetLoggerFactory, workspaceProvider, ServerConnection: null, brokeredServiceData.
AssumeNotNull
().Interceptor);
115
var args = new ServiceArgs(serviceBroker.
AssumeNotNull
(), exportProvider, targetLoggerFactory, workspaceProvider, serverConnection, brokeredServiceData?.Interceptor);
RemoteHostServicesProvider.cs (1)
25
return _workspaceProvider.
AssumeNotNull
().GetWorkspace().Services.HostServices;
RemoteMefComposition.cs (2)
120
var cacheDirectory = Path.GetDirectoryName(compositionCacheFile).
AssumeNotNull
();
169
var assemblyPath = assembly.Location.
AssumeNotNull
();
Rename\RemoteRenameService.cs (1)
166
var declaration = tree.
AssumeNotNull
().DescendantNodes().OfType<ClassDeclarationSyntax>().FirstOrDefault();
src\Razor\src\Razor\src\Microsoft.VisualStudio.LanguageServices.Razor\Telemetry\TelemetryReporter.cs (3)
30
typeof(Assumed).FullName.
AssumeNotNull
(),
31
typeof(NullableExtensions).FullName.
AssumeNotNull
(),
32
typeof(ThrowHelper).FullName.
AssumeNotNull
()
Microsoft.VisualStudio.LanguageServices.Razor (19)
LanguageClient\Cohost\CohostDocumentPullDiagnosticsEndpoint.cs (1)
109
var vsDiagnostic = JsonHelpers.Convert<LspDiagnostic, VSDiagnostic>(diagnostics[i]).
AssumeNotNull
();
LanguageClient\Cohost\HtmlDocumentPublisher.cs (1)
61
var changes = textChanges.SelectAsArray(c => new VisualStudioTextChange(c.Span.Start, c.Span.Length, c.NewText.
AssumeNotNull
()));
LanguageClient\Cohost\HtmlRequestInvoker.cs (1)
55
var existingChecksum = (ChecksumWrapper)htmlDocument.State.
AssumeNotNull
();
LanguageClient\Cohost\IncompatibleProjectNotifier.cs (1)
38
if (_frameworkProjects.Contains(project.FilePath.
AssumeNotNull
()))
LanguageClient\Cohost\SemanticTokensRefreshNotifier.cs (1)
49
_razorClientLanguageServerManager.
AssumeNotNull
().SendNotificationAsync(Methods.WorkspaceSemanticTokensRefreshName, CancellationToken.None).Forget();
LanguageClient\Options\OptionsStorage.cs (2)
116
if (_unifiedSettingsReader.
AssumeNotNull
().GetValue<bool>(name) is { Outcome: SettingRetrievalOutcome.Success, Value: { } unifiedValue })
126
if (_unifiedSettingsReader.
AssumeNotNull
().GetValue<string>(name) is { Outcome: SettingRetrievalOutcome.Success, Value: { } unifiedValue })
Logging\RazorLogHubTraceProvider.cs (1)
45
var serviceBroker = _serviceBroker.
AssumeNotNull
();
ProjectCapabilityResolver.cs (1)
85
var session = _liveShareSessionAccessor.Session.
AssumeNotNull
();
Snippets\XmlSnippetParser.ExpansionTemplate.cs (1)
213
xmlFunctionText.
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\CodeActions\CohostCodeActionsEndpoint.cs (2)
94
RazorLanguageKind.CSharp => await GetCSharpCodeActionsAsync(razorDocument, requestInfo.CSharpRequest.
AssumeNotNull
(), correlationId, cancellationToken).ConfigureAwait(false),
113
var csharpRequest = JsonHelpers.Convert<VSCodeActionParams, CodeActionParams>(request).
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\CodeActions\CohostCodeActionsResolveEndpoint.cs (1)
93
var uri = resolveParams.DelegatedDocumentUri.
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Completion\CohostDocumentCompletionEndpoint.cs (1)
312
_snippetCompletionItemProvider.
AssumeNotNull
().AddSnippetCompletions(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\HtmlDocumentServices\HtmlDocumentSynchronizer.SynchronizationRequest.cs (1)
38
var tcs = (TaskCompletionSource<SynchronizationResult>)state.
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\InlayHints\CohostInlayHintResolveEndpoint.cs (1)
56
var razorData = GetInlayHintResolveData(request).
AssumeNotNull
();
Telemetry\TelemetryReporter.cs (3)
30
typeof(Assumed).FullName.
AssumeNotNull
(),
31
typeof(NullableExtensions).FullName.
AssumeNotNull
(),
32
typeof(ThrowHelper).FullName.
AssumeNotNull
()
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (70)
Cohost\CohostDocumentSpellCheckEndpointTest.cs (1)
101
var ranges = result.First().Ranges.
AssumeNotNull
();
Cohost\CohostEndpointTestBase.cs (5)
27
private protected override IRemoteServiceInvoker RemoteServiceInvoker => _remoteServiceInvoker.
AssumeNotNull
();
28
private protected TestRemoteServiceInvoker TestRemoteServiceInvoker => _remoteServiceInvoker.
AssumeNotNull
();
29
private protected override IFilePathService FilePathService => _filePathService.
AssumeNotNull
();
30
private protected ISemanticTokensLegendService SemanticTokensLegendService => _semanticTokensLegendService.
AssumeNotNull
();
114
remoteDocument.FilePath.
AssumeNotNull
(),
Cohost\CohostRoslynCodeActionTest.cs (3)
227
var invoker = LocalExportProvider.
AssumeNotNull
().GetExportedValue<ExportableRemoteServiceInvoker>();
256
var codeAction = codeActions.First(a => ((JsonElement)a.Data.
AssumeNotNull
()).TryGetProperty("CustomTags", out var value) &&
262
var workspaceEdit = resolvedCodeAction.Edit.
AssumeNotNull
();
Cohost\CohostRoslynGoToDefTest.cs (1)
65
var invoker = LocalExportProvider.
AssumeNotNull
().GetExportedValue<ExportableRemoteServiceInvoker>();
Cohost\CohostRoslynRenameTest.cs (8)
220
? generatedDocument.
AssumeNotNull
()
234
var symbol = FindSymbolToRename(compilation.
AssumeNotNull
(), node);
257
var tree = await document.
AssumeNotNull
().GetSyntaxTreeAsync(DisposalToken);
258
var root = await tree.
AssumeNotNull
().GetRootAsync(DisposalToken);
275
Assert.True(documentMappingService.TryMapToCSharpDocumentPosition(codeDocument.GetCSharpDocument().
AssumeNotNull
(), position, out csharpPosition, out _));
292
var csharpDocumentAfterRename = solution.GetDocument(csharpDocument.Id).
AssumeNotNull
();
306
var razorDocumentAfterRename = solution.GetAdditionalDocument(razorDocument.Id).
AssumeNotNull
();
322
var invoker = LocalExportProvider.
AssumeNotNull
().GetExportedValue<ExportableRemoteServiceInvoker>();
Cohost\ExportableRemoteServiceInvoker.cs (1)
29
=> _remoteServiceInvoker.
AssumeNotNull
().TryInvokeAsync(solution, invocation, cancellationToken, callerFilePath, callerMemberName);
Cohost\Formatting\FormattingLogTest.cs (7)
69
var contents = GetResource(testName.
AssumeNotNull
(), "InitialDocument.txt").
AssumeNotNull
();
79
options = (RazorFormattingOptions)JsonSerializer.Deserialize(optionsFile, typeof(RazorFormattingOptions), JsonHelpers.JsonSerializerOptions).
AssumeNotNull
();
92
var linePositionSpan = (LinePositionSpan)JsonSerializer.Deserialize(rangeFile, typeof(LinePositionSpan), JsonHelpers.JsonSerializerOptions).
AssumeNotNull
();
99
var edits = await GetFormattingEditsAsync(document, htmlEdits, span, options.CodeBlockBraceOnNextLine, options.AttributeIndentStyle, options.InsertSpaces, options.TabSize, options.CSharpSyntaxFormattingOptions.
AssumeNotNull
());
104
var finalFormattedDocument = finalFormattedDocumentFile.
AssumeNotNull
();
117
return (RazorFileKind)JsonSerializer.Deserialize(fileKindFile, typeof(RazorFileKind), JsonHelpers.JsonSerializerOptions).
AssumeNotNull
();
Cohost\Formatting\FormattingTestBase.cs (1)
99
var delta = lastLine - firstLine + changes.Count(e => e.NewText.
AssumeNotNull
().Contains(Environment.NewLine));
Cohost\HtmlDocumentSynchronizerTest.cs (20)
37
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
49
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
68
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
100
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
123
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
146
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
160
document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
183
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
195
var solution = Workspace.CurrentSolution.WithAdditionalDocumentText(_documentId.
AssumeNotNull
(), SourceText.From("<span></span>"));
196
document = solution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
225
var document1 = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
234
Assert.True(Workspace.TryApplyChanges(Workspace.CurrentSolution.WithAdditionalDocumentText(_documentId.
AssumeNotNull
(), SourceText.From("<span></span>"))));
235
var document2 = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
256
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
281
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
291
var solution = Workspace.CurrentSolution.WithAdditionalDocumentText(_documentId.
AssumeNotNull
(), SourceText.From("<span></span>"));
292
document = solution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
312
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
337
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
386
return (TResult)(object)(await solution.GetAdditionalDocument(_documentId).
AssumeNotNull
().GetTextAsync(cancellationToken)).ToString();
Cohost\HtmlRequestInvokerTest.cs (3)
39
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
61
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
83
var document = Workspace.CurrentSolution.GetAdditionalDocument(_documentId).
AssumeNotNull
();
Cohost\RazorRefactorNotifyServiceTest.cs (2)
114
var symbol = FindSymbolToRename(compilation.
AssumeNotNull
(), node);
147
var root = await tree.
AssumeNotNull
().GetRootAsync(DisposalToken);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (2)
56
? codeAction.Edit.
AssumeNotNull
()
127
var nestedCodeAction = data["NestedCodeActions"].
AssumeNotNull
().AsArray()[childActionIndex];
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\ComputedTargetPathTest.cs (8)
48
var document = solution.GetAdditionalDocument(id).
AssumeNotNull
();
75
var document = solution.GetAdditionalDocument(id).
AssumeNotNull
();
101
var doc1 = solution.GetAdditionalDocument(doc1Id).
AssumeNotNull
();
102
var doc2 = solution.GetAdditionalDocument(doc2Id).
AssumeNotNull
();
133
var doc1 = solution.GetAdditionalDocument(doc1Id).
AssumeNotNull
();
134
var doc2 = solution.GetAdditionalDocument(doc2Id).
AssumeNotNull
();
165
var doc1 = solution.GetAdditionalDocument(doc1Id).
AssumeNotNull
();
166
var doc2 = solution.GetAdditionalDocument(doc2Id).
AssumeNotNull
();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\DocumentExcerpt\DocumentExcerptServiceTestBase.cs (1)
38
return (snapshot, generatedDocument.
AssumeNotNull
());
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostFindAllReferencesEndpointTest.cs (1)
320
return referenceItem.Text.
AssumeNotNull
().ToString()!;
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostFoldingRangeEndpointTest.cs (1)
403
var actual = GenerateTestInput(inputText, htmlSpans, result.
AssumeNotNull
());
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
240
var serializedHint = JsonSerializer.Deserialize<InlayHint>(JsonSerializer.SerializeToElement(hint)).
AssumeNotNull
();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSignatureHelpEndpointTest.cs (1)
125
var actual = Assert.Single(result.
AssumeNotNull
().Signatures);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\HtmlFormattingPassTest.cs (1)
143
var logger = loggerFactory.CreateLogger(document.FilePath.
AssumeNotNull
(), "Html");
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (1)
1325
var responseTextChanges = await _razorEditService.
AssumeNotNull
().MapCSharpEditsAsync(
Telemetry\TelemetryReporterTests.cs (1)
516
((object?)null).
AssumeNotNull
();
Microsoft.VisualStudio.Razor.IntegrationTests (4)
AbstractRazorEditorTest.cs (2)
35
private protected virtual ILogger Logger => _testLogger.
AssumeNotNull
();
37
protected string ProjectFilePath => _projectFilePath.
AssumeNotNull
();
Semantic\RazorSemanticTokensTests.cs (2)
107
GenerateSemanticBaseline(actual, testName.
AssumeNotNull
());
110
var expectedClassifications = await ReadSemanticBaselineAsync(snapshot, testName.
AssumeNotNull
(), cancellationToken);
Microsoft.VisualStudio.RazorExtension (2)
RazorPackage.cs (1)
110
return new SnippetService(joinableTaskContext.Factory, this, cache, _optionsStorage.
AssumeNotNull
());
Snippets\SnippetService.cs (1)
111
_vsExpansionManager.
AssumeNotNull
();
Microsoft.VisualStudioCode.RazorExtension (10)
Services\HtmlDocumentPublisher.cs (1)
27
var clientConnection = _razorClientServerManagerProvider.ClientLanguageServerManager.
AssumeNotNull
();
Services\HtmlRequestInvoker.cs (1)
49
var clientConnection = _razorClientServerManagerProvider.ClientLanguageServerManager.
AssumeNotNull
();
Services\InProcServiceFactory.cs (1)
44
var factory = (IInProcServiceFactory)Activator.CreateInstance(type).
AssumeNotNull
();
Services\VSCodeBrokeredServiceInterceptor.cs (1)
20
=> implementation(solutionInfo.Solution.
AssumeNotNull
());
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\CodeActions\CohostCodeActionsEndpoint.cs (2)
94
RazorLanguageKind.CSharp => await GetCSharpCodeActionsAsync(razorDocument, requestInfo.CSharpRequest.
AssumeNotNull
(), correlationId, cancellationToken).ConfigureAwait(false),
113
var csharpRequest = JsonHelpers.Convert<VSCodeActionParams, CodeActionParams>(request).
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\CodeActions\CohostCodeActionsResolveEndpoint.cs (1)
93
var uri = resolveParams.DelegatedDocumentUri.
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Completion\CohostDocumentCompletionEndpoint.cs (1)
312
_snippetCompletionItemProvider.
AssumeNotNull
().AddSnippetCompletions(
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\HtmlDocumentServices\HtmlDocumentSynchronizer.SynchronizationRequest.cs (1)
38
var tcs = (TaskCompletionSource<SynchronizationResult>)state.
AssumeNotNull
();
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\InlayHints\CohostInlayHintResolveEndpoint.cs (1)
56
var razorData = GetInlayHintResolveData(request).
AssumeNotNull
();
Microsoft.VisualStudioCode.RazorExtension.UnitTests (23)
CohostConfigurationChangedServiceTest.cs (3)
28
""").
AssumeNotNull
();
48
""").
AssumeNotNull
();
60
""").
AssumeNotNull
();
CohostEndpointTestBase.cs (3)
28
private protected override IRemoteServiceInvoker RemoteServiceInvoker => _remoteServiceInvoker.
AssumeNotNull
();
29
private protected override IFilePathService FilePathService => _filePathService.
AssumeNotNull
();
30
private protected ISemanticTokensLegendService SemanticTokensLegendService => _semanticTokensLegendService.
AssumeNotNull
();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (2)
56
? codeAction.Edit.
AssumeNotNull
()
127
var nestedCodeAction = data["NestedCodeActions"].
AssumeNotNull
().AsArray()[childActionIndex];
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\ComputedTargetPathTest.cs (8)
48
var document = solution.GetAdditionalDocument(id).
AssumeNotNull
();
75
var document = solution.GetAdditionalDocument(id).
AssumeNotNull
();
101
var doc1 = solution.GetAdditionalDocument(doc1Id).
AssumeNotNull
();
102
var doc2 = solution.GetAdditionalDocument(doc2Id).
AssumeNotNull
();
133
var doc1 = solution.GetAdditionalDocument(doc1Id).
AssumeNotNull
();
134
var doc2 = solution.GetAdditionalDocument(doc2Id).
AssumeNotNull
();
165
var doc1 = solution.GetAdditionalDocument(doc1Id).
AssumeNotNull
();
166
var doc2 = solution.GetAdditionalDocument(doc2Id).
AssumeNotNull
();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\DocumentExcerpt\DocumentExcerptServiceTestBase.cs (1)
38
return (snapshot, generatedDocument.
AssumeNotNull
());
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostFindAllReferencesEndpointTest.cs (1)
320
return referenceItem.Text.
AssumeNotNull
().ToString()!;
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostFoldingRangeEndpointTest.cs (1)
403
var actual = GenerateTestInput(inputText, htmlSpans, result.
AssumeNotNull
());
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
240
var serializedHint = JsonSerializer.Deserialize<InlayHint>(JsonSerializer.SerializeToElement(hint)).
AssumeNotNull
();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSignatureHelpEndpointTest.cs (1)
125
var actual = Assert.Single(result.
AssumeNotNull
().Signatures);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\HtmlFormattingPassTest.cs (1)
143
var logger = loggerFactory.CreateLogger(document.FilePath.
AssumeNotNull
(), "Html");
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (1)
1325
var responseTextChanges = await _razorEditService.
AssumeNotNull
().MapCSharpEditsAsync(