haskell / haskell/lsp

feature: Option to disable automatic updates of VFS

Open
#601 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
423
Forks
105
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the library handles VFS updates for the open, close, and change operations, then inspect the server options exposed for these operations. Add per-operation controls that preserve the current enabled-by-default behavior, and verify that callers can manage VFS updates themselves while receiving each change before it is applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.