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.