Skip to content

feature: Option to disable automatic updates of VFS #601

@wenkokke

Description

@wenkokke

I'm using lsp to implement a language server using incremental parsing. To update the parse tree, I need each partial document change together with the rope before applying that change. Specifically, I need this to convert positions to byte indexes into the document. This isn't possible with the current version of the library, since it automatically applies the document changes. To work around this, I'm maintaining a separate VFS, but since I'm doing all the same work, it would be much easier and less expensive to simply disable automatic updates of the VFS and perform them myself.

To make this a non-breaking change, I'd suggest a server option that enables/disables automatic VFS maintenance on a per operation basis—i.e., open, close, change—that are all enabled by default.

I'm happy to implement this.

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