提交 f20d3090 编写于 作者: G Gen Lu

Fix NRT warnings

上级 d1644a97
......@@ -88,7 +88,7 @@ private HashSet<string> GetNamespacesInScope(Document document, SyntaxContext sy
var importedNamespaces = GetImportedNamespaces(syntaxContext.LeftToken.Parent, semanticModel, cancellationToken);
// This hashset will be used to match namespace names, so it must have the same case-sensitivity as the source language.
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>()!;
var namespacesInScope = new HashSet<string>(importedNamespaces, syntaxFacts.StringComparer);
// Get containing namespaces.
......@@ -121,7 +121,7 @@ internal override async Task<CompletionChange> GetChangeAsync(Document document,
var addImportContextNode = root.FindToken(completionListSpan.Start, findInsideTrivia: true).Parent;
// Add required using/imports directive.
var addImportService = document.GetLanguageService<IAddImportsService>();
var addImportService = document.GetLanguageService<IAddImportsService>()!;
var optionSet = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false);
var placeSystemNamespaceFirst = optionSet.GetOption(GenerationOptions.PlaceSystemNamespaceFirst, document.Project.Language);
var compilation = (await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false))!;
......
......@@ -28,7 +28,7 @@ protected override async Task AddCompletionItemsAsync(CompletionContext completi
var document = completionContext.Document;
var project = document.Project;
var workspace = project.Solution.Workspace;
var typeImportCompletionService = document.GetLanguageService<ITypeImportCompletionService>();
var typeImportCompletionService = document.GetLanguageService<ITypeImportCompletionService>()!;
var tasksToGetCompletionItems = ArrayBuilder<Task<ImmutableArray<CompletionItem>>>.GetInstance();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册