rubberduck-vba / Rubberduck3

COM add-in for the VBIDE
GNU General Public License v3.0
89 stars 17 forks source link

Implement DidChangeTextDocument LSP handler #52

Open retailcoder opened 1 year ago

retailcoder commented 1 year ago

Specification (LSP)

The document change notification is sent from the client to the server to signal changes to a text document. Before a client can change a text document it must claim ownership of its content using the textDocument/didOpen notification.

The notification sends an array of TextDocumentContentChangeEvent objects, each representing a distinct change of state for a specific Range in a given version of a given document. Client may send the full document every time, or send incremental edits (let's start with full-document only for now).

The editor may send didChange notifications on an idle timer - that is, whenever the user stops typing for a certain (configurable) amount of time.

Alternatively (through editor settings), the user might prefer sending this notification manually; the editor UI should expose a command to do so - the flow is then similar to Rubberduck 2.x, where the parser state is manually refreshed; the command should send a content changed event for each document that was modified since the last synchronization.