Documentation

Lapis.VFS.Position

UTF-16 Utilities #

Count UTF-16 code units in a string

Equations
Instances For

    Convert a UTF-8 byte offset to a UTF-16 offset within a string

    Equations
    Instances For
      @[irreducible]
      def Lapis.VFS.Position.utf8OffsetToUtf16.utf8ToUtf16Aux (utf8Offset : Nat) (s : String) (charIdx bytePos utf16Pos : Nat) :
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Convert a UTF-16 offset to a UTF-8 byte offset within a string

        Equations
        Instances For
          @[irreducible]
          def Lapis.VFS.Position.utf16OffsetToUtf8.utf16ToUtf8Aux (utf16Offset : Nat) (s : String) (charIdx bytePos utf16Pos : Nat) :
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Get the UTF-8 byte length up to a character index

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

                LSP Position Type #

                LSP Position (0-indexed line and UTF-16 character offset)

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

                      LSP Range

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

                            Create a range from a single position (zero-width)

                            Equations
                            Instances For

                              Position Conversion Context #

                              Context needed for position conversions

                              Instances For

                                Get the line content as a string

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

                                  Get line content up to (but not including) the newline

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

                                    Position to Byte Offset #

                                    Convert an LSP position to a byte offset

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

                                      Convert a byte offset to an LSP position

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

                                        Range Conversions #

                                        Convert an LSP range to a byte range

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

                                          Convert a byte range to an LSP range

                                          Equations
                                          Instances For

                                            Offset Utilities #

                                            Clamp a byte offset to valid document bounds

                                            Equations
                                            Instances For

                                              Check if a position is valid for the document

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

                                                Get the position at the end of a specific line

                                                Equations
                                                Instances For