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

Issue:
Remove support for rustDocument/implementations
`rustDocument/implementations` was removed from rls back in July - at [this commit](https://github.com/rust-lang-nursery/rls/commit/addb8b52).  It now uses the standard `textDocument/implementation`.

Happy to submit a pull request deleting all references to it - though there'll be a (tiny) conflict with #648 so I'll probably wait for that to get through (or not!) first.


Discussion / hints:
+1

On Thu, Nov 8, 2018 at 05:08 David Hotham <notifications@github.com> wrote:

> rustDocument/implementations was removed from rls back in July - at this
> commit <https://github.com/rust-lang-nursery/rls/commit/addb8b52>. It now
> uses the standard textDocument/implementation.
>
> Happy to submit a pull request deleting all references to it - though
> there'll be a (tiny) conflict with #648
> <https://github.com/autozimu/LanguageClient-neovim/pull/648> so I'll
> probably wait for that to get through (or not!) first.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/autozimu/LanguageClient-neovim/issues/652>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ABYt77LbrL7dewEw_AHTgMnP6HMPJ_Yhks5utCzlgaJpZM4YUo-3>
> .
>


Fix patch:
diff --git a/autoload/LanguageClient.vim b/autoload/LanguageClient.vim
index 84b183bb7..ed44c31ca 100644
--- a/autoload/LanguageClient.vim
+++ b/autoload/LanguageClient.vim
@@ -625,18 +625,6 @@ function! LanguageClient#textDocument_rangeFormatting_sync(...) abort
     return l:result isnot v:null
 endfunction
 
-function! LanguageClient#rustDocument_implementations(...) abort
-    let l:params = {
-                \ 'filename': LSP#filename(),
-                \ 'text': LSP#text(),
-                \ 'line': LSP#line(),
-                \ 'character': LSP#character(),
-                \ }
-    call extend(l:params, a:0 >= 1 ? a:1 : {})
-    let l:Callback = a:0 >= 2 ? a:2 : v:null
-    return LanguageClient#Call('rustDocument/implementations', l:params, l:Callback)
-endfunction
-
 function! LanguageClient#textDocument_didOpen() abort
     return LanguageClient#Notify('textDocument/didOpen', {
                 \ 'filename': LSP#filename(),
diff --git a/src/languageclient.rs b/src/languageclient.rs
index 157224efd..5a7918329 100644
--- a/src/languageclient.rs
+++ b/src/languageclient.rs
@@ -2677,55 +2677,6 @@ impl State {
         Ok(())
     }
 
-    pub fn rustDocument_implementations(&mut self, params: &Value) -> Result<Value> {
-        info!("Begin {}", REQUEST__RustImplementations);
-        let (buftype, languageId, filename, word, line, character, handle): (
-            String,
-            String,
-            String,
-            String,
-            u64,
-            u64,
-            bool,
-        ) = self.gather_args(
-            &[
-                VimVar::Buftype,
-                VimVar::LanguageId,
-                VimVar::Filename,
-                VimVar::Cword,
-                VimVar::Line,
-                VimVar::Character,
-                VimVar::Handle,
-            ],
-            params,
-        )?;
-        if !buftype.is_empty() || languageId.is_empty() {
-            return Ok(Value::Null);
-        }
-
-        let result = self.call(
-            Some(&languageId),
-            REQUEST__RustImplementations,
-            TextDocumentPositionParams {
-                text_document: TextDocumentIdentifier {
-                    uri: filename.to_url()?,
-                },
-                position: Position { line, character },
-            },
-        )?;
-
-        if !handle {
-            return Ok(result);
-        }
-
-        let locations: Vec<Location> = serde_json::from_value(result.clone())?;
-        let title = format!("[LC]: implementations for {}", word);
-        self.display_locations(&locations, &title)?;
-
-        info!("End {}", REQUEST__RustImplementations);
-        Ok(result)
-    }
-
     pub fn rust_handleBeginBuild(&mut self, _params: &Value) -> Result<()> {
         info!("Begin {}", NOTIFICATION__RustBeginBuild);
         self.command(vec![
diff --git a/src/rpchandler.rs b/src/rpchandler.rs
index 7f7e9e8f8..1e07bd190 100644
--- a/src/rpchandler.rs
+++ b/src/rpchandler.rs
@@ -47,7 +47,6 @@ impl State {
             lsp::request::DocumentHighlightRequest::METHOD => {
                 self.textDocument_documentHighlight(&params)
             }
-            REQUEST__RustImplementations => self.rustDocument_implementations(&params),
             // Extensions.
             REQUEST__GetState => self.languageClient_getState(&params),
             REQUEST__IsAlive => self.languageClient_isAlive(&params),
diff --git a/src/types.rs b/src/types.rs
index 100cad8e0..c2a772f21 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -38,7 +38,6 @@ pub const NOTIFICATION__ServerExited: &str = "$languageClient/serverExited";
 pub const NOTIFICATION__ClearDocumentHighlight: &str = "languageClient/clearDocumentHighlight";
 
 // Extensions by language servers.
-pub const REQUEST__RustImplementations: &str = "rustDocument/implementations";
 pub const NOTIFICATION__RustBeginBuild: &str = "rustDocument/beginBuild";
 pub const NOTIFICATION__RustDiagnosticsBegin: &str = "rustDocument/diagnosticsBegin";
 pub const NOTIFICATION__RustDiagnosticsEnd: &str = "rustDocument/diagnosticsEnd";


Test patch: