mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.99k stars 715 forks source link

[REQUEST] Incremental buffer synchronisation with coprocess (unidirectional) #5136

Closed tom-huntington closed 7 months ago

tom-huntington commented 7 months ago

Feature

https://phaazon.net/blog/kak-tree-sitter-v0.4

Note: currently, buffers must be entirely read by kak-tree-sitter ... Partial updates using %val{history} and %val{uncommitted_modifications} are planned for a future release.

I'd like to be able to have a coprocess that can listen to buffer changes, using the language server protocol i.e. when a buffer registered with a coprocess changes, Kakoune should send out a textDocument_didChange message to the coprocess with TextDocumentSyncKind = Incremental.

This would nicely complement https://github.com/mawww/kakoune/issues/4127

You'd also want a command to send LSP Content-Length: <NUM_BYTES>\r\n\r\n<BYTES> messages to a specific coprocess.

Helpful video on LSP: https://www.youtube.com/watch?v=YsdlcQoHqPY