Skip to content

Support retrieving entire file span from *ast.FileNode #360

@stefanvanburen

Description

@stefanvanburen

In buf beta lsp we have a handle on a set of *ast.FileNodes that the user has open. For formatting, we format the node, and then construct a range from the node, using the FileNode's Start() and End(). However, because Start() doesn't take into account leading comments, we had a bug. (It looks like End() does handle up to the EOF correctly.)

Ideally, we'd be able to retrieve the full file span from an *ast.FileNode. (Perhaps there's a way to do this already; open to pointers!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions