diff --git a/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.IVsLanguageTextOps.cs b/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.IVsLanguageTextOps.cs index eec8ea795a38c..79a85b7deeaec 100644 --- a/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.IVsLanguageTextOps.cs +++ b/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.IVsLanguageTextOps.cs @@ -25,13 +25,6 @@ internal abstract partial class AbstractLanguageService where TLanguageService : AbstractLanguageService { - private readonly IGlobalOptionService _globalOptions; - - public AbstractLanguageService(IGlobalOptionService globalOptions) - { - _globalOptions = globalOptions; - } - public int Format(IVsTextLayer textLayer, TextSpan[] selections) { var result = VSConstants.S_OK; diff --git a/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.cs b/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.cs index 9f58f26ba33ec..20e9b0cca35ef 100644 --- a/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.cs +++ b/src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.cs @@ -34,6 +34,8 @@ internal abstract partial class AbstractLanguageService where TLanguageService : AbstractLanguageService { + private readonly IGlobalOptionService _globalOptions; + internal TPackage Package { get; } internal VsLanguageDebugInfo LanguageDebugInfo { get; private set; } @@ -70,19 +72,14 @@ internal abstract partial class AbstractLanguageService private bool _isSetUp; - protected AbstractLanguageService( - TPackage package) + protected AbstractLanguageService(TPackage package) { - this.Package = package; + _globalOptions = package.ComponentModel.GetService(); + Package = package; } public override IServiceProvider SystemServiceProvider - { - get - { - return this.Package; - } - } + => Package; /// /// Setup and TearDown go in reverse order. diff --git a/src/VisualStudio/VisualBasic/Impl/LanguageService/VisualBasicLanguageService.vb b/src/VisualStudio/VisualBasic/Impl/LanguageService/VisualBasicLanguageService.vb index 34765dc8ac257..6fd3e02680d29 100644 --- a/src/VisualStudio/VisualBasic/Impl/LanguageService/VisualBasicLanguageService.vb +++ b/src/VisualStudio/VisualBasic/Impl/LanguageService/VisualBasicLanguageService.vb @@ -4,6 +4,7 @@ Imports System.Runtime.InteropServices Imports Microsoft.CodeAnalysis +Imports Microsoft.CodeAnalysis.Options Imports Microsoft.CodeAnalysis.Editor Imports Microsoft.VisualStudio.LanguageServices.Implementation.DebuggerIntelliSense Imports Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService