1111namespace Microsoft . AspNetCore . Razor . LanguageServer ;
1212
1313[ RazorLanguageServerEndpoint ( Methods . InitializeName ) ]
14- internal class RazorInitializeEndpoint (
15- LanguageServerFeatureOptions options ,
16- ITelemetryReporter telemetryReporter ) : IRazorDocumentlessRequestHandler < InitializeParams , InitializeResult >
14+ internal class RazorInitializeEndpoint ( ) : IRazorDocumentlessRequestHandler < InitializeParams , InitializeResult >
1715{
18- private static bool s_reportedFeatureFlagState = false ;
19-
20- private readonly LanguageServerFeatureOptions _options = options ;
21- private readonly ITelemetryReporter _telemetryReporter = telemetryReporter ;
22-
2316 public bool MutatesSolutionState { get ; } = true ;
2417
2518 public Task < InitializeResult > HandleRequestAsync ( InitializeParams request , RazorRequestContext requestContext , CancellationToken cancellationToken )
@@ -29,17 +22,6 @@ public Task<InitializeResult> HandleRequestAsync(InitializeParams request, Razor
2922 capabilitiesManager . SetInitializeParams ( request ) ;
3023 var serverCapabilities = capabilitiesManager . GetInitializeResult ( ) ;
3124
32- // Initialize can be called multiple times in a VS session, but the feature flag can't change in that time, so we only
33- // need to report once. In VS Code things could change between solution loads, but each solution load starts a new rzls
34- // process, so the static field gets reset anyway.
35- if ( ! s_reportedFeatureFlagState )
36- {
37- s_reportedFeatureFlagState = true ;
38- _telemetryReporter . ReportEvent ( "initialize" , Severity . Normal ,
39- new Property ( nameof ( LanguageServerFeatureOptions . ForceRuntimeCodeGeneration ) , _options . ForceRuntimeCodeGeneration ) ,
40- new Property ( nameof ( LanguageServerFeatureOptions . UseNewFormattingEngine ) , _options . UseNewFormattingEngine ) ) ;
41- }
42-
4325 return Task . FromResult ( serverCapabilities ) ;
4426 }
4527}
0 commit comments