コード例 #1
0
 /// <summary>
 /// Registers all handlers necessary to provide the language server integration of dafny.
 /// </summary>
 /// <param name="options">The language server where the handlers should be registered to.</param>
 /// <returns>The language server enriched with the dafny handlers.</returns>
 public static LanguageServerOptions WithDafnyHandlers(this LanguageServerOptions options)
 {
     return(options
            .WithHandler <DafnyTextDocumentHandler>()
            .WithHandler <DafnyDocumentSymbolHandler>()
            .WithHandler <DafnyHoverHandler>()
            .WithHandler <DafnyDefinitionHandler>()
            .WithHandler <DafnyCompletionHandler>()
            .WithHandler <DafnySignatureHelpHandler>()
            .WithHandler <DafnyCounterExampleHandler>());
 }
コード例 #2
0
 /// <summary>
 /// Registers all handlers necessary to provide the language server integration of dafny.
 /// </summary>
 /// <param name="options">The language server where the handlers should be registered to.</param>
 /// <returns>The language server enriched with the dafny handlers.</returns>
 public static LanguageServerOptions WithDafnyHandlers(this LanguageServerOptions options)
 {
     return(options
            .WithHandler <DafnyTextDocumentHandler>()
            // TODO Disabled since its functionallity cannot be observed in VS Code (yet).
            //.WithHandler<DafnyDocumentSymbolHandler>()
            .WithHandler <DafnyHoverHandler>()
            .WithHandler <DafnyDefinitionHandler>()
            .WithHandler <DafnyCompletionHandler>()
            .WithHandler <DafnySignatureHelpHandler>()
            .WithHandler <DafnyCounterExampleHandler>());
 }
コード例 #3
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);
            }
        }