Skip to content

Feature Request: LSP Position to SourcePos helper function #199

@Alfus

Description

@Alfus

LSP provides (0-based) Line and Character for a position:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position
while a ast.SourcePos provides (1-based) Line, Col and (0-based) offset.

A helper function to take a Line and Col, and convert it back to an offset would be very helpful to an implementation that converts from a LSP Position to a SourcePos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions