From b6d1f62e1088657d0e52df99b45698ed105063cd Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 11 Feb 2019 23:53:57 +0800 Subject: [PATCH] . --- Build.md | 2 +- Customization.md | 2 ++ lsp-mode.md | 30 +++++++++--------------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/Build.md b/Build.md index d467f64..20760ea 100644 --- a/Build.md +++ b/Build.md @@ -9,7 +9,7 @@ Otherwise, you'll need to build **ccls** from source. You will need: * GCC 7.2 or higher (`optional,string_view` require libstdc++7 or higher) * MSVC 2017 or higher (included with VS2017 Build Tools) * On POSIX systems, either GNU make or Ninja (optional on other systems) -* Clang+LLVM headers and libraries +* Clang+LLVM headers and libraries, version >= 7 ([0.20181225.8](https://github.com/MaskRay/ccls/releases/tag/0.20181225.8) is the last release that supports clang 6) The simplest/quickest build with all defaults (only for POSIX systems) is: diff --git a/Customization.md b/Customization.md index 32b0835..5cda7f5 100644 --- a/Customization.md +++ b/Customization.md @@ -33,6 +33,8 @@ will show the compiler arguments used to index files. ## Initialization Options +Initialization options are defined in [config.hh](https://github.com/MaskRay/ccls/blob/master/src/config.hh). + Each language client may have its own way to specify initialization options. Also, initialization options can be specified on the `ccls` command line using the [`--init` option](#--initjson). diff --git a/lsp-mode.md b/lsp-mode.md index 2ac3619..bb6b5db 100644 --- a/lsp-mode.md +++ b/lsp-mode.md @@ -33,20 +33,10 @@ The only required configuration is `ccls-executable`. Others have good defaults. ```elisp (setq ccls-executable "/path/to/ccls/Release/ccls") -;; ;; Some Linux distributions have packages that install to /usr/bin/ccls -;; (setq ccls-executable "/usr/bin/ccls") - -;; ;; Log file ;; (setq ccls-args '("--log-file=/tmp/ccls.log")) ``` -A more flexible way is to leave `ccls-executable` unchanged (default: `ccls`) and create a shell wrapper named `ccls` that is in your `PATH`: -```zsh -#!/bin/zsh -#export CCLS_TRACEME=1 # if you want to debug ccls, stop it right after main() is called -#export LD_LIBRARY_PATH=~/llvm/Release/lib # if you link against shared library libLLVM.so, not statically -exec ~/ccls/Release/ccls --log-file=/tmp/ccls.log "$@" -``` +You may leave `ccls-executable` unchanged (default: `ccls`) and create a [shell script wrapper](Install#shell-script-wrapper). Some common settings to lsp-mode lsp-ui and emacs-ccls: @@ -58,11 +48,13 @@ Some common settings to lsp-mode lsp-ui and emacs-ccls: When `M-x lsp` is invoked, projectile is consulted to locate the project root which determines the associated lsp-mode workspace. If your project has subprojects, `(projectile-project-root)` may think files in the subproject belong to the child workspace, which is not desired. `touch .ccls-root` in the root directory to override projectile roots. -Read `lsp-project-whitelist lsp-project-blacklist` if you don't want to start ccls for some paths. - - #### flycheck -If you are flycheck user, make sure ` (setq-default flycheck-disabled-checkers '(c/c++-clang c/c++-cppcheck c/c++-gcc))`, otherwise wrong error messages may occur. + +flymake is used by default. + +To use flycheck, `(setq lsp-prefer-flymake nil)`. You may also need `(setq-default flycheck-disabled-checkers '(c/c++-clang c/c++-cppcheck c/c++-gcc))` to disable other checkers. + +![](https://ptpb.pw/5KIc.jpg) ### Diagnostics @@ -74,9 +66,9 @@ The buffer `*lsp-ccls stderr*` and `--log-file=/tmp/cq.log` contain logs. Also refer to [[Debugging]]. -## [[Initialization options|Project-Setup#InitializationOptions]] +## [[Initialization options|Customization#initialization-options]] -Initialization options are defined in [config.hh](https://github.com/MaskRay/ccls/blob/master/src/config.hh), but you need to customize them in S-exp. +You need to customize initialization options in S-exp. Use `t` for true, `:json-false` for false, `:json-null` for null. ```elisp @@ -208,10 +200,6 @@ Add `company-lsp` to `company-backends`. ccls has a fuzzy matching algorithm to ![company-lsp + company-quickhelp](https://ptpb.pw/AC6J.jpg) -### lsp-ui-flycheck - -![](https://ptpb.pw/5KIc.jpg) - ### Semantic highlighting To enable semantic highlighting: