Documentation

Lapis.VFS.LineIndex

A line entry stores the byte length of a single line (including newline if present)

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

      Line index using a finger tree of line entries

      Instances For

        Create an empty line index (single empty line)

        Equations
        Instances For

          Get the number of lines

          Equations
          Instances For

            Check if a line number is valid

            Equations
            Instances For

              Build a complete line index from document content

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

                  Get byte offset for the start of a line - O(log n)

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

                    Get the byte range for a line - O(log n)

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

                      Find which line a byte offset falls on - O(log n)

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Lapis.VFS.LineIndex.LineIndex.applyEdit (idx : LineIndex) (startByte oldLength : Nat) (newText : String) (newDocLength : Nat) :

                        Apply an incremental edit to the line index - O(log n)

                        Parameters:

                        • startByte: byte offset where the edit starts
                        • oldLength: number of bytes removed (0 for pure insert)
                        • newText: the text being inserted
                        • newDocLength: total document length after the edit
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For