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

cquery.elc failed to define function lsp-cquery-enable #58

Open jeffpollock9 opened 5 years ago

jeffpollock9 commented 5 years ago

After doing a package update lsp-cquery-enable doesn't seem to work for me, on startup I get this in my messages:

File mode specification error: (error Autoloading file /home/jeff/.emacs.d/elpa/cquery-20181203.1829/cquery.elc failed to define function lsp-cquery-enable)

My emacs skills are somewhat lacking so please forgive me if I have done something stupid here. Relevant part of my .emacs.d/init.el (which I mostly took from the wiki):

  (use-package cquery
    :ensure t
    :bind
    (:map c++-mode-map
          ("C-b" . clang-format-buffer)
          ("C-d" . duplicate-thing))
    :commands lsp-cquery-enable
    :init
    (defun cquery//enable ()
      (condition-case nil (lsp-cquery-enable) (user-error nil)))
    (add-hook 'c-mode-hook #'cquery//enable)
    (add-hook 'c++-mode-hook #'cquery//enable))

and the full config is here

Any help is much appreciated and please let me know if there is anything I can do to help.

brucestephens commented 5 years ago

The function to call is now just lsp, I think. (But there are other things that are slightly different/broken, so you might try using a slightly older version if you can until it's all resolved.)

jeffpollock9 commented 5 years ago

@brucestephens thanks for the prompt reply! I have things mostly working by replacing lsp-cquery-enable with lsp.

Please feel free to close this issue now - or keep it open until the documentation/whatever is updated - whatever suits you.

verminniu commented 5 years ago

I called lsp but still not work....

andrelkin commented 5 years ago

@verminniu Make sure you have updated lsp package. I only needed

(require 'cquery)

and then M-x lsp to make it work again (after the former method unimpressively deceased).

jeffpollock9 commented 5 years ago

@verminniu I have actually moved to ccls which has all of this documented, as far as I can tell it works pretty much the same as cquery