コード例 #1
0
        public static void ConfigureLanguageServer(LanguageServerOptions options, Action <ILoggingBuilder> configureLoggingAction = null)
        {
            // Hack to circumvent OmniSharp bug: https://github.com/OmniSharp/csharp-language-server-protocol/issues/609
            options.Services.AddSingleton <IReceiver, RhetosJsonRpcReceiver>();

            options
            .WithHandler <TextDocumentHandler>()
            .WithHandler <RhetosHoverHandler>()
            .WithHandler <RhetosSignatureHelpHandler>()
            .WithHandler <RhetosCompletionHandler>()
            .WithUnhandledExceptionHandler(UnhandledExceptionHandler)
            .WithServices(ConfigureServices)
            .OnInitialize(OnInitializeAsync)
            .OnInitialized(OnInitializedAsync);

            if (configureLoggingAction != null)
            {
                options.ConfigureLogging(configureLoggingAction);
            }
        }