Documentation

Lapis.VFS

Re-exports #

Document Store #

A store of open documents, keyed by URI

Instances For

    Create an empty document store

    Equations
    Instances For

      Get a document by URI

      Equations
      Instances For

        Check if a document exists

        Equations
        Instances For

          Document Lifecycle #

          def Lapis.VFS.DocumentStore.openDocument (store : DocumentStore) (uri languageId : String) (version : Int) (content : String) :

          Open a new document

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

            Close a document

            Equations
            Instances For

              Update document version (without content change)

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

                Editing #

                def Lapis.VFS.DocumentStore.applyEdit (store : DocumentStore) (uri : String) (range : LspRange) (newText : String) (newVersion : Int) :

                Apply a text edit to a document

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Lapis.VFS.DocumentStore.applyEdits (store : DocumentStore) (uri : String) (edits : List (LspRange × String)) (newVersion : Int) :

                  Apply multiple edits to a document (edits should be in reverse document order)

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Lapis.VFS.DocumentStore.setContent (store : DocumentStore) (uri content : String) (newVersion : Int) :

                    Replace entire document content

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

                      Reading #

                      Get text in a range

                      Equations
                      Instances For

                        Get a specific line

                        Equations
                        Instances For

                          Get full document content

                          Equations
                          Instances For

                            Get document version

                            Equations
                            Instances For

                              Get document line count

                              Equations
                              Instances For

                                Get document byte length

                                Equations
                                Instances For

                                  Position Conversion #

                                  Convert LSP position to byte offset

                                  Equations
                                  Instances For

                                    Convert byte offset to LSP position

                                    Equations
                                    Instances For

                                      Convert a byte range to an LSP range

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

                                        Convert an LSP range to a byte range

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

                                          Snapshots #

                                          Create a snapshot of the current document state

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

                                            Acquire a snapshot (increment reference count)

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

                                              Release a snapshot (decrement reference count)

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

                                                Prune unreferenced snapshots

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

                                                  Rebuild document line index

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

                                                    Get list of all open document URIs

                                                    Equations
                                                    Instances For

                                                      Modify a document with a function

                                                      Equations
                                                      Instances For

                                                        Convenience Functions #

                                                        Create a range at a single point

                                                        Equations
                                                        Instances For
                                                          def Lapis.VFS.mkPosition (line character : Nat) :

                                                          Create a position from line and character

                                                          Equations
                                                          Instances For
                                                            def Lapis.VFS.mkRange (start «end» : LspPosition) :

                                                            Create a range from start and end positions

                                                            Equations
                                                            Instances For
                                                              def Lapis.VFS.mkRangeFromCoords (startLine startChar endLine endChar : Nat) :

                                                              Create a range from line/character coordinates

                                                              Equations
                                                              • Lapis.VFS.mkRangeFromCoords startLine startChar endLine endChar = { start := { line := startLine, character := startChar }, «end» := { line := endLine, character := endChar } }
                                                              Instances For