提交 cb81ade1 编写于 作者: S Sam Harwell

Code cleanup from review

上级 e3f4e62f
......@@ -39,7 +39,9 @@ public abstract class HostLanguageServices
// Producing a [MaybeNull]T value results in a warning like default(T).
// We are investigating a more complex design for nullable analysis to solve this. See:
// https://github.com/dotnet/roslyn/issues/38638
var service = GetService<TLanguageService>()!;
#pragma warning disable CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TLanguageService' is a non-nullable reference type.
var service = GetService<TLanguageService>();
#pragma warning restore CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TLanguageService' is a non-nullable reference type.
if (service == null)
{
throw new InvalidOperationException(string.Format(WorkspacesResources.Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace, typeof(TLanguageService)));
......
......@@ -44,7 +44,9 @@ public abstract class HostWorkspaceServices
// Producing a [MaybeNull]T value results in a warning like default(T).
// We are investigating a more complex design for nullable analysis to solve this. See:
// https://github.com/dotnet/roslyn/issues/38638
var service = GetService<TWorkspaceService>()!;
#pragma warning disable CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TWorkspaceService' is a non-nullable reference type.
var service = GetService<TWorkspaceService>();
#pragma warning restore CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TWorkspaceService' is a non-nullable reference type.
if (service == null)
{
throw new InvalidOperationException(string.Format(WorkspacesResources.Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace, typeof(TWorkspaceService).FullName));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册