]> git.eshelyaron.com Git - emacs.git/commit
Fix assorted cquery-related bugs
authorJoão Távora <joaotavora@gmail.com>
Sun, 27 May 2018 10:41:24 +0000 (11:41 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 27 May 2018 10:41:24 +0000 (11:41 +0100)
commitf20edc04ed67a086d608ed3af9702f09481e9c92
tree3723f15075300442f2637b32f5a71c09adf69487
parent9b468c1cc19a75455bdeddb10f0405e0612ebaa7
Fix assorted cquery-related bugs

Some versions of cquery send a :role key as part of the response to
textDocument/documentHighlight. Ignore it for now.

Also cquery sometimes send 0-length ranges upon which we now fallback
to flymake-diag-region.

Finally, in eglot-eldoc-funciton, the previous hack of calling the
eglot--hover-info outside of the when-buffer-window macrolet contained
a bug. It must be called in the correct buffer. Revert the hack and do
it by querying from eglot.el if ert is running tests.

* eglot.el (eglot--range-region): Return a cons and fallback to
flymake-diag-region if server returned a useless range.
(eglot-handle-notification, eglot--hover-info): Update call to
eglot--range-region.
(eglot-help-at-point): Ensure `eglot--hover-info` runs in right
buffer.
(eglot-eldoc-function): Don't abuse eldoc-last-message like this.
Also update call to eglot--range-region. Consider ert-running-test
(eglot--apply-text-edits): Use pcase-lambda.
(ert): require it.
lisp/progmodes/eglot.el