diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs index 60f8123e66..32799f778a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs @@ -18,26 +18,17 @@ using StreamJsonRpc; namespace Microsoft.AspNetCore.Razor.LanguageServer; -internal abstract class AbstractRazorDelegatingEndpoint : IRazorRequestHandler - where TRequest : ITextDocumentPositionParams +internal abstract class AbstractRazorDelegatingEndpoint( + LanguageServerFeatureOptions languageServerFeatureOptions, + IDocumentMappingService documentMappingService, + IClientConnection clientConnection, + ILogger logger) + : IRazorRequestHandler where TRequest : ITextDocumentPositionParams { - private readonly LanguageServerFeatureOptions _languageServerFeatureOptions; - protected readonly IDocumentMappingService DocumentMappingService; - private readonly IClientConnection _clientConnection; - protected readonly ILogger Logger; - - protected AbstractRazorDelegatingEndpoint( - LanguageServerFeatureOptions languageServerFeatureOptions, - IDocumentMappingService documentMappingService, - IClientConnection clientConnection, - ILogger logger) - { - _languageServerFeatureOptions = languageServerFeatureOptions ?? throw new ArgumentNullException(nameof(languageServerFeatureOptions)); - DocumentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService)); - _clientConnection = clientConnection ?? throw new ArgumentNullException(nameof(clientConnection)); - - Logger = logger ?? throw new ArgumentNullException(nameof(logger)); - } + private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; + protected readonly IDocumentMappingService DocumentMappingService = documentMappingService; + private readonly IClientConnection _clientConnection = clientConnection; + protected readonly ILogger Logger = logger; /// /// The strategy to use to project the incoming caret position onto the generated C#/Html document