Paul Jolly wrote:

> 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.

Not really.  It's quite specific and it's hard to imagine what would be
useful.  It's one of those things where the one who is first running
into it has to find a solution, and if it works well others will follow.

It probably works best with callbacks.  If your plugin has some way for
other plugins to know it exists, and then install callbacks for what
they are interested in, that could work.  You probably need to make sure
your plugin is loaded first.

-- 
He who laughs last, thinks slowest.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201905271110.x4RBALTW009323%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui