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 c10257d
Show file tree
Hide file tree
Showing 2 changed files with 6 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

0 comments on commit c10257d

Please sign in to comment.