lsp-mode: adapt to lsp.el

Fangrui Song 2018-12-01 23:12:38 -08:00
parent cc3ca9bfaf
commit 48fdc216af

@ -2,7 +2,11 @@
2. Install [lsp-mode](https://github.com/emacs-lsp/lsp-mode) and optionally, [lsp-ui](https://github.com/emacs-lsp/lsp-ui) + [company-lsp](https://github.com/tigersoldier/company-lsp)
3. Install [emacs-ccls](https://github.com/MaskRay/emacs-ccls) (ccls on Melpa) and [configure](#configure) it
4. Open a source file where either [[.ccls|Getting-started#ccls]] or [[compile_commands.json]] is in the project root (it works without them, if you don't need extra compiler command line options like `-I`)
5. `M-x lsp-ccls-enable`. Don't invoke `M-x lsp-mode`. `lsp-ccls-enable` will turn on `lsp-mode` for you
5. `(require 'ccls)`, `M-x lsp`
`ccls.el` used to be based on the old interface `lsp-mode.el` of lsp-mode and the entry was `lsp-ccls-enable`.
`(require 'lsp)` and `M-x lsp` should be used instead now. See https://github.com/emacs-lsp/lsp-mode/issues/479 , the old interface `lsp-mode.el` is deperecated.
Alternatively, you may install https://github.com/joaotavora/eglot
@ -26,7 +30,7 @@ The only required configuration is `ccls-executable`. Others have good defaults.
;; ;; Log file
;; (setq ccls-extra-args '("--log-file=/tmp/cq.log"))
;; ;; Cache directory, both relative and absolute paths are supported
;; (setq ccls-cache-dir ".ccls-cache")
;; (setq ccls-initialization-options '(:cacheDirectory ".ccls-cache"))
```
A more flexible way is to leave `ccls-executable` unchanged (default: `ccls`) and create a shell wrapper named `ccls` that is in your `PATH`:
@ -91,7 +95,7 @@ Initialization options are defined in [config.hh](https://github.com/MaskRay/ccl
Use `t` for true, `:json-false` for false, `:json-null` for null.
```elisp
(setq ccls-extra-init-params '(:index (:comments 2) :completion (:detailedLabel t)))
(setq ccls-initialization-options '(:index (:comments 2) :completion (:detailedLabel t)))
```
### Find definitions/references