コード例 #1
0
        public static ILanguageServer BuildLanguageServer(Stream inputStream, Stream outputStream)
        {
            var server = LanguageServer.Create(options =>
            {
                options
                .WithInput(inputStream)
                .WithOutput(outputStream);

                ConfigureLanguageServer(options, ConfigureLoggingDefaults);
            });

            return(server);
        }
コード例 #2
0
            public ActionDelegateData()
            {
                {
                    var baseOptions = new LanguageServerOptions().WithPipe(new Pipe());

                    void BaseDelegate(LanguageServerOptions o)
                    {
                        o.WithPipe(new Pipe());
                    }

                    var serviceProvider = new ServiceCollection().BuildServiceProvider();
                    Add(new ActionDelegate("create (server): options", () => LanguageServer.Create(baseOptions)));
                    Add(new ActionDelegate("create (server): options, serviceProvider", () => LanguageServer.Create(baseOptions, serviceProvider)));
                    Add(new ActionDelegate("create (server): action", () => LanguageServer.Create(BaseDelegate)));
                    Add(new ActionDelegate("create (server): action, serviceProvider", () => LanguageServer.Create(BaseDelegate, serviceProvider)));

                    Add(new ActionDelegate("from (server): options", () => LanguageServer.From(baseOptions)));
                    Add(new ActionDelegate("from (server): options, cancellationToken", () => LanguageServer.From(baseOptions, CancellationToken.None)));
                    Add(
                        new ActionDelegate(
                            "from (server): options, serviceProvider, cancellationToken",
                            () => LanguageServer.From(baseOptions, serviceProvider, CancellationToken.None)
                            )
                        );
                    Add(new ActionDelegate("from (server): options, serviceProvider", () => LanguageServer.From(baseOptions, serviceProvider)));
                    Add(new ActionDelegate("from (server): action", () => LanguageServer.From(BaseDelegate)));
                    Add(new ActionDelegate("from (server): action, cancellationToken", () => LanguageServer.From(BaseDelegate, CancellationToken.None)));
                    Add(
                        new ActionDelegate(
                            "from (server): action, serviceProvider, cancellationToken",
                            () => LanguageServer.From(BaseDelegate, serviceProvider, CancellationToken.None)
                            )
                        );
                    Add(new ActionDelegate("from (server): action, serviceProvider", () => LanguageServer.From(BaseDelegate, serviceProvider)));
                }
                {
                    var baseOptions = new LanguageClientOptions().WithPipe(new Pipe());

                    void BaseDelegate(LanguageClientOptions o)
                    {
                        o.WithPipe(new Pipe());
                    }

                    var serviceProvider = new ServiceCollection().BuildServiceProvider();
                    Add(new ActionDelegate("create (client): options", () => LanguageClient.Create(baseOptions)));
                    Add(new ActionDelegate("create (client): options, serviceProvider", () => LanguageClient.Create(baseOptions, serviceProvider)));
                    Add(new ActionDelegate("create (client): action", () => LanguageClient.Create(BaseDelegate)));
                    Add(new ActionDelegate("create (client): action, serviceProvider", () => LanguageClient.Create(BaseDelegate, serviceProvider)));

                    Add(new ActionDelegate("from (client): options", () => LanguageClient.From(baseOptions)));
                    Add(new ActionDelegate("from (client): options, cancellationToken", () => LanguageClient.From(baseOptions, CancellationToken.None)));
                    Add(
                        new ActionDelegate(
                            "from (client): options, serviceProvider, cancellationToken",
                            () => LanguageClient.From(baseOptions, serviceProvider, CancellationToken.None)
                            )
                        );
                    Add(new ActionDelegate("from (client): options, serviceProvider", () => LanguageClient.From(baseOptions, serviceProvider)));
                    Add(new ActionDelegate("from (client): action", () => LanguageClient.From(BaseDelegate)));
                    Add(new ActionDelegate("from (client): action, cancellationToken", () => LanguageClient.From(BaseDelegate, CancellationToken.None)));
                    Add(
                        new ActionDelegate(
                            "from (client): action, serviceProvider, cancellationToken",
                            () => LanguageClient.From(BaseDelegate, serviceProvider, CancellationToken.None)
                            )
                        );
                    Add(new ActionDelegate("from (client): action, serviceProvider", () => LanguageClient.From(BaseDelegate, serviceProvider)));
                }
            }