Hi all,
As a brief summary, govim (
https://github.com/myitcv/govim) is a
Vim8.1 channel-based plugin, written in Go, that is a Language Server
Protocol (LSP) client
(
https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md).
The TL;DR version is that such a plugin can, with the LSP server it
connects to, provide answers on everything from jump-to-definition,
code completion... and much more. This functionality is exposed via
functions, commands and autocmds.
A recent issue raised highlighted the fact that YouCompleteMe (YCM)
does not appear to play well with govim:
https://github.com/myitcv/govim/issues/247
This was effectively tracked down to the fact that both govim and YCM
rely on TextChanged/TextChangedI autocmds to do their work; YCM to
trigger an omnifunc completion when a '.' character is pressed, and
govim to update the LSP server with the latest buffer contents:
https://github.com/Valloric/YouCompleteMe/issues/3408
The issue reported occurs when the YCM TextChangedI autocmd fires
before the govim autocmd; effectively a completion is attempted beyond
the end of a line (in some cases).
Ignoring for one second that there is significant overlap between what
YCM and govim are trying to do here from a completion perspective, it
strikes me that plugins like govim might well want to expose events
that other plugins can hook into. In this case, on such event would be
"post LSP textDocument/didChange" (textDocument/didChange is the LSP
event notified from client -> server when a document loaded in the
editor changes)
Is there a standard means by which plugins like govim should expose such events?
Any pointers would be much appreciated.
Thanks,
Paul