Ejemplo n.º 1
0
        public static async Task <ILanguageServer> From(LanguageServerOptions options)
        {
            var server = new LanguageServer(
                options.Input,
                options.Output,
                options.Reciever,
                options.RequestProcessIdentifier,
                options.LoggerFactory,
                options.Serializer,
                options.Services,
                options.HandlerTypes.Select(x => x.Assembly)
                .Distinct().Concat(options.HandlerAssemblies),
                options.InitializeDelegates,
                options.InitializedDelegates
                );

            if (options.AddDefaultLoggingProvider)
            {
                options.LoggerFactory.AddProvider(new LanguageServerLoggerProvider(server));
            }

            await server.Initialize();

            return(server);
        }
Ejemplo n.º 2
0
        public async Task RunAsync(CancellationToken cancellationToken)
        {
            await server.Initialize(cancellationToken);

            server.LogInfo($"Running on processId {Environment.ProcessId}");

            if (bool.TryParse(Environment.GetEnvironmentVariable("BICEP_TRACING_ENABLED"), out var enableTracing) && enableTracing)
            {
                Trace.Listeners.Add(new ServerLogTraceListener(server));
            }

            var scheduler = server.GetService <IModuleRestoreScheduler>();

            scheduler.Start();

            await server.WaitForExit;
        }
Ejemplo n.º 3
0
        public async Task RunAsync(CancellationToken cancellationToken)
        {
            await server.Initialize(cancellationToken);

            server.LogInfo($"Running on processId {Environment.ProcessId}");

            if (FeatureProvider.TracingEnabled)
            {
                Trace.Listeners.Add(new ServerLogTraceListener(server));
            }

            using (FeatureProvider.TracingEnabled ? AzureEventSourceListenerFactory.Create(FeatureProvider.TracingVerbosity) : null)
            {
                var scheduler = server.GetRequiredService <IModuleRestoreScheduler>();
                scheduler.Start();

                await server.WaitForExit;
            }
        }
Ejemplo n.º 4
0
        public async Task RunAsync(CancellationToken cancellationToken)
        {
            await server.Initialize(cancellationToken);

            await server.WaitForExit;
        }