Skip to content

Commit

Permalink
Fix AbstractLanguageService constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed May 25, 2022
1 parent 8ba416d commit d239220
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ internal abstract partial class AbstractLanguageService<TPackage, TLanguageServi
where TPackage : AbstractPackage<TPackage, TLanguageService>
where TLanguageService : AbstractLanguageService<TPackage, TLanguageService>
{
private readonly IGlobalOptionService _globalOptions;

public AbstractLanguageService(IGlobalOptionService globalOptions)
{
_globalOptions = globalOptions;
}

public int Format(IVsTextLayer textLayer, TextSpan[] selections)
{
var result = VSConstants.S_OK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ internal abstract partial class AbstractLanguageService<TPackage, TLanguageServi
where TPackage : AbstractPackage<TPackage, TLanguageService>
where TLanguageService : AbstractLanguageService<TPackage, TLanguageService>
{
private readonly IGlobalOptionService _globalOptions;

internal TPackage Package { get; }
internal VsLanguageDebugInfo LanguageDebugInfo { get; private set; }

Expand Down Expand Up @@ -70,19 +72,14 @@ internal abstract partial class AbstractLanguageService<TPackage, TLanguageServi
/// </remarks>
private bool _isSetUp;

protected AbstractLanguageService(
TPackage package)
protected AbstractLanguageService(TPackage package)
{
this.Package = package;
_globalOptions = package.ComponentModel.GetService<IGlobalOptionService>();
Package = package;
}

public override IServiceProvider SystemServiceProvider
{
get
{
return this.Package;
}
}
=> Package;

/// <summary>
/// Setup and TearDown go in reverse order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d239220

Please sign in to comment.