Repository: autozimu/LanguageClient-neovim (language: rust)

Issue:
Make `explainErrorAtPoint()` behave similar to `textDocument_hover()`
## Is your feature request related to a problem? Please describe.

With Rust, `explainErrorAtPoint()` is amazingly useful for viewing error messages without having to compile my sources and losing focus by switching to another terminal window. However, Rust's error messages can get surprisingly long.

## Describe the solution you'd like

The `textDocument_hover()` function has this amazing functionality to switch *into* the floating window on a second call. It would be awesome if `explainErrorAtPoint()` had that as well.


Discussion / hints:
I know it's not exactly what you're looking for but you should be able to move into it by pressing `<c-w><c-w>`.

Fix patch:
diff --git a/autoload/LanguageClient.vim b/autoload/LanguageClient.vim
index 07fac5bee..e6877be99 100644
--- a/autoload/LanguageClient.vim
+++ b/autoload/LanguageClient.vim
@@ -1327,6 +1327,10 @@ function! LanguageClient_NCM2OnComplete(context) abort
 endfunction
 
 function! LanguageClient#explainErrorAtPoint(...) abort
+    if s:ShouldUseFloatWindow() && s:MoveIntoHoverPreview()
+        return
+    endif
+
     let l:Callback = get(a:000, 1, v:null)
     let l:params = {
                 \ 'buftype': &buftype,


Test patch: