예제 #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);
        }
예제 #2
0
파일: Server.cs 프로젝트: rynowak/bicep
        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;
        }
예제 #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;
            }
        }
예제 #4
0
        public async Task RunAsync(CancellationToken cancellationToken)
        {
            await server.Initialize(cancellationToken);

            await server.WaitForExit;
        }