cquery-project / emacs-cquery

Emacs client for cquery, a low-latency language server supporting multi-million line C++ code-bases
116 stars 14 forks source link

eldoc error: (wrong-type-argument lsp--workspace nil) in indirect buffer #59

Open andrelkin opened 5 years ago

andrelkin commented 5 years ago

When I create an indirect buffer from a buffer where lsp/cquery is set up and works, the above error occurs once an identifier is pointed in there instead of expected documentation line.

chenl commented 5 years ago

For me this was resolved by updating lsp-ui.

Consider closing this issue.

andrelkin commented 5 years ago

Well, after updating lsp-ui the error has changed to

eldoc error: (wrong-type-argument arrayp nil)

The error also happens when I run in clean mode:

emacs -q

to (require 'lsp-mode) and then (require 'cquery).

The main buffer is handled as supposed, but C-x-4-c indirectly created one yields to the eldoc error.

andrelkin commented 5 years ago

While the latest error can be removed indeed with

(setq-local eldoc-documentation-function #'ignore)

lsp-mode/cquery does not work in an indirect buffer. How-to-repeat is like above.

  1. open a file as main buffer
  2. C-x-4-c to clone it as indirect buffer
  3. M-x lsp in the main buffer => works out ok including status bar reflecting that
  4. M-x lsp or lsp-mode in the indirect buffer => nothing good happens, disconnected - in the status bar
andrelkin commented 5 years ago

While leaving the ticket active - lsp-ui upgrade has not helped as reported - I found a workaround for my specific purpose.

I needed indirect buffer as it's supposed to alias a primary one and in both lsp/cquery be running. I could not tame the indirect one case having as it looks eldoc-mode errors (the last one of (wrong-type-argument arrayp nil) is still there). But I when I create a symbolic link file and forcing emacs to open it not to follow the link makes the 2nd-ry buffer where

lsp/cquery works!