Languageclient-neovim: Support custom cross references requests as per textDocument/references

Created on 21 Jan 2018  ·  4Comments  ·  Source: autozimu/LanguageClient-neovim

The cquery language server supports some custom methods $cquery/base $cquery/derived $cquery/callers $cquery/vars. The params used in request/response are identical to textDocument/references: send TextDocumentPositionParams and receive Location[].

    (defun my-cquery/base () (interactive) (lsp-ui-peek-find-custom 'base "$cquery/base"))
    (defun my-cquery/callers () (interactive) (lsp-ui-peek-find-custom 'callers "$cquery/callers"))
    (defun my-cquery/derived () (interactive) (lsp-ui-peek-find-custom 'derived "$cquery/derived"))
    (defun my-cquery/vars () (interactive) (lsp-ui-peek-find-custom 'vars "$cquery/vars"))

Most helpful comment

I am using my fork of cquery now https://github.com/MaskRay/ccls and it has been added to archlinuxcn/ccls-git

I've written some motivation for the fork in https://github.com/MaskRay/emacs-ccls/issues/1

The extensions it supports:

$cquery/derived ->            (textDocument/implementation)
$cquery/vars ->  -> $ccls/vars
$cquery/base -> $ccls/base
$cquery/callers -> $ccls/callers

It would be much appreciated if you could add a generic method

All 4 comments

This is actually more useful to other issues for Vim users. They currently just don't know there are other cross references.

Thanks for supporting these methods.. But is there a more general approach? I can think of cross reference extension s from other servers...

No, not yet.

Will make it generic only when there are more requests coming in.

I am using my fork of cquery now https://github.com/MaskRay/ccls and it has been added to archlinuxcn/ccls-git

I've written some motivation for the fork in https://github.com/MaskRay/emacs-ccls/issues/1

The extensions it supports:

$cquery/derived ->            (textDocument/implementation)
$cquery/vars ->  -> $ccls/vars
$cquery/base -> $ccls/base
$cquery/callers -> $ccls/callers

It would be much appreciated if you could add a generic method

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gleachkr picture gleachkr  ·  5Comments

macthecadillac picture macthecadillac  ·  5Comments

ABitMoreDepth picture ABitMoreDepth  ·  3Comments

languitar picture languitar  ·  7Comments

skywind3000 picture skywind3000  ·  5Comments