Documentation

Lapis.Concurrent.LspActor

Request Context #

Context passed to request handlers

Instances For

    Check if request was cancelled

    Equations
    Instances For
      def Lapis.Concurrent.LspActor.RequestContext.getUserState {UserState : Type} (ctx : RequestContext UserState) :
      IO UserState

      Get user state

      Equations
      Instances For
        def Lapis.Concurrent.LspActor.RequestContext.setUserState {UserState : Type} (ctx : RequestContext UserState) (state : UserState) :

        Set user state

        Equations
        Instances For
          def Lapis.Concurrent.LspActor.RequestContext.modifyUserState {UserState : Type} (ctx : RequestContext UserState) (f : UserStateUserState) :

          Modify user state

          Equations
          Instances For

            Get a document snapshot

            Equations
            Instances For

              Get document content

              Equations
              Instances For

                Get a line from a document

                Equations
                Instances For

                  Get word at position

                  Equations
                  Instances For
                    def Lapis.Concurrent.LspActor.RequestContext.sendNotification {UserState : Type} (ctx : RequestContext UserState) (method : String) (params : Lean.Json) :

                    Send a notification to the client

                    Equations
                    Instances For

                      Send a request to the client

                      Equations
                      Instances For

                        Publish diagnostics

                        Equations
                        Instances For
                          def Lapis.Concurrent.LspActor.RequestContext.logMessage {UserState : Type} (ctx : RequestContext UserState) (type : Nat) (message : String) :

                          Log a message

                          Equations
                          Instances For
                            def Lapis.Concurrent.LspActor.RequestContext.logInfo {UserState : Type} (ctx : RequestContext UserState) (message : String) :

                            Log info

                            Equations
                            Instances For
                              def Lapis.Concurrent.LspActor.RequestContext.logWarning {UserState : Type} (ctx : RequestContext UserState) (message : String) :

                              Log warning

                              Equations
                              Instances For
                                def Lapis.Concurrent.LspActor.RequestContext.logError {UserState : Type} (ctx : RequestContext UserState) (message : String) :

                                Log error

                                Equations
                                Instances For
                                  def Lapis.Concurrent.LspActor.RequestContext.showMessage {UserState : Type} (ctx : RequestContext UserState) (type : Nat) (message : String) :

                                  Show a message to the user

                                  Equations
                                  Instances For
                                    def Lapis.Concurrent.LspActor.RequestContext.showInfo {UserState : Type} (ctx : RequestContext UserState) (message : String) :

                                    Show info message

                                    Equations
                                    Instances For

                                      Show warning message

                                      Equations
                                      Instances For
                                        def Lapis.Concurrent.LspActor.RequestContext.showError {UserState : Type} (ctx : RequestContext UserState) (message : String) :

                                        Show error message

                                        Equations
                                        Instances For
                                          def Lapis.Concurrent.LspActor.RequestContext.withProgress {UserState α : Type} (ctx : RequestContext UserState) (title : String) (cancellable : Bool := false) (action : Server.Progress.ProgressHandleIO α) :
                                          IO α

                                          Run an action with progress reporting

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Handler Types #

                                            Result of handling a request

                                            Instances For

                                              A notification handler in the actor model

                                              Equations
                                              Instances For

                                                LSP Messages #

                                                inductive Lapis.Concurrent.LspActor.LspMsg (UserState : Type) :

                                                Messages for the LSP actor

                                                Instances For

                                                  LSP Actor State #

                                                  Pending request tracking

                                                  Instances For

                                                    LSP Actor configuration

                                                    Instances For

                                                      LSP Actor state

                                                      • initialized : Bool

                                                        Server initialized

                                                      • shutdownRequested : Bool

                                                        Shutdown requested

                                                      • activeRequests : Nat

                                                        Count of active requests (for backpressure)

                                                      Instances For

                                                        LSP Actor Reference #

                                                        structure Lapis.Concurrent.LspActor.LspRef (UserState : Type) :

                                                        Handle to the LSP actor

                                                        Instances For

                                                          Send a request to be handled

                                                          Equations
                                                          Instances For

                                                            Send a notification to be handled

                                                            Equations
                                                            Instances For

                                                              Handle a response from client

                                                              Equations
                                                              Instances For

                                                                Handle an error response from client

                                                                Equations
                                                                Instances For
                                                                  def Lapis.Concurrent.LspActor.LspRef.shutdown {UserState : Type} (lsp : LspRef UserState) :

                                                                  Shutdown the actor

                                                                  Equations
                                                                  Instances For

                                                                    LSP Actor Context #

                                                                    Runtime context for the LSP actor

                                                                    Instances For

                                                                      LSP Actor Implementation #

                                                                      Spawn LSP Actor #

                                                                      def Lapis.Concurrent.LspActor.spawnLspActor {UserState : Type} (config : LspConfig UserState) (vfs : VfsActor.VfsRef) (outputChannel : Transport.OutputChannel) (pendingResponses : Server.Receiver.PendingResponses) (userStateRef : IO.Ref UserState) :
                                                                      IO (Actor.Actor (LspMsg UserState) (LspState UserState) × LspRef UserState)

                                                                      Spawn the LSP actor

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For

                                                                        Config Builder #

                                                                        def Lapis.Concurrent.LspActor.LspConfig.new {UserState : Type} (name : String) :
                                                                        LspConfig UserState

                                                                        Create a new LSP config

                                                                        Equations
                                                                        Instances For
                                                                          def Lapis.Concurrent.LspActor.LspConfig.withVersion {UserState : Type} (config : LspConfig UserState) (version : String) :
                                                                          LspConfig UserState

                                                                          Set version

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For

                                                                            Set capabilities

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              def Lapis.Concurrent.LspActor.LspConfig.onRequest {Params : Type u_1} {Result UserState : Type} [Lean.FromJson Params] [Lean.ToJson Result] (config : LspConfig UserState) (method : String) (handler : RequestContext UserStateParamsIO Result) :
                                                                              LspConfig UserState

                                                                              Add a request handler

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                def Lapis.Concurrent.LspActor.LspConfig.onRequestOpt {Params : Type u_1} {Result UserState : Type} [Lean.FromJson Params] [Lean.ToJson Result] (config : LspConfig UserState) (method : String) (handler : RequestContext UserStateParamsIO (Option Result)) :
                                                                                LspConfig UserState

                                                                                Add a request handler that can return null

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  def Lapis.Concurrent.LspActor.LspConfig.onNotification {Params : Type u_1} {UserState : Type} [Lean.FromJson Params] (config : LspConfig UserState) (method : String) (handler : RequestContext UserStateParamsIO Unit) :
                                                                                  LspConfig UserState

                                                                                  Add a notification handler

                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    def Lapis.Concurrent.LspActor.LspConfig.withMaxConcurrentRequests {UserState : Type} (config : LspConfig UserState) (n : Nat) :
                                                                                    LspConfig UserState

                                                                                    Set max concurrent requests

                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For
                                                                                      def Lapis.Concurrent.LspActor.LspConfig.onInitialize {UserState : Type} (config : LspConfig UserState) (hook : RequestContext UserStateProtocol.Messages.InitializeParamsIO Unit) :
                                                                                      LspConfig UserState
                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For