2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/cc/config.el --- c, c++, and obj-c -*- lexical-binding: t; -*-
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2019-03-02 01:51:51 -05:00
|
|
|
(defvar +cc-default-include-paths
|
|
|
|
(list "include"
|
|
|
|
"includes")
|
|
|
|
"A list of default relative paths which will be searched for up from the
|
|
|
|
current file, to be passed to irony as extra header search paths. Paths can be
|
|
|
|
absolute. This is ignored if your project has a compilation database.
|
|
|
|
|
|
|
|
This is ignored by ccls.")
|
2017-09-19 05:06:50 +02:00
|
|
|
|
2018-09-07 22:08:11 -04:00
|
|
|
(defvar +cc-default-header-file-mode 'c-mode
|
|
|
|
"Fallback major mode for .h files if all other heuristics fail (in
|
|
|
|
`+cc-c-c++-objc-mode').")
|
|
|
|
|
2017-12-27 17:10:21 -05:00
|
|
|
(defvar +cc-default-compiler-options
|
2017-09-19 05:06:50 +02:00
|
|
|
`((c-mode . nil)
|
|
|
|
(c++-mode
|
2018-06-04 00:11:13 +02:00
|
|
|
. ,(list "-std=c++1z" ; use C++17 draft by default
|
2022-08-18 17:06:42 +02:00
|
|
|
(when IS-MAC
|
2017-09-19 05:06:50 +02:00
|
|
|
;; NOTE beware: you'll get abi-inconsistencies when passing
|
2017-09-20 14:25:35 +02:00
|
|
|
;; std-objects to libraries linked with libstdc++ (e.g. if you
|
|
|
|
;; use boost which wasn't compiled with libc++)
|
2018-06-28 12:59:29 +02:00
|
|
|
"-stdlib=libc++")))
|
2017-09-19 05:06:50 +02:00
|
|
|
(objc-mode . nil))
|
|
|
|
"A list of default compiler options for the C family. These are ignored if a
|
2019-03-02 01:51:51 -05:00
|
|
|
compilation database is present in the project.
|
|
|
|
|
|
|
|
This is ignored by ccls.")
|
2017-09-19 05:06:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
2019-10-03 23:33:59 -04:00
|
|
|
;;; Packages
|
2017-09-19 05:06:50 +02:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! cc-mode
|
2018-06-04 00:12:02 +02:00
|
|
|
:mode ("\\.mm\\'" . objc-mode)
|
2020-03-27 01:25:30 -04:00
|
|
|
;; Use `c-mode'/`c++-mode'/`objc-mode' depending on heuristics
|
2022-08-17 01:16:08 +01:00
|
|
|
:mode ("\\.h\\'" . +cc-c-c++-objc-mode)
|
2020-03-27 01:25:30 -04:00
|
|
|
;; Ensure find-file-at-point recognize system libraries in C modes. It must be
|
|
|
|
;; set up before the likes of irony/lsp are initialized. Also, we use
|
|
|
|
;; local-vars hooks to ensure these only run in their respective major modes,
|
|
|
|
;; and not their derived modes.
|
2020-03-29 01:29:27 -04:00
|
|
|
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-ffap-integration-h)
|
2020-03-27 01:25:30 -04:00
|
|
|
;;; Improve fontification in C/C++ (also see `modern-cpp-font-lock')
|
|
|
|
:hook (c-mode-common . rainbow-delimiters-mode)
|
|
|
|
:hook ((c-mode c++-mode) . +cc-fontify-constants-h)
|
2016-04-23 22:08:46 -04:00
|
|
|
:config
|
feature/lookup: rewrite dash docset integration
+ Uses alist variable to store config, rather than hooks
+ Added check for installed docsets in +lookup/documentation
+ Set docsets for various language modules (c-mode, c++-mode, css-mode,
scss-mode, sass-mode, web-mode, go-mode, racket-mode, emacs-lisp-mode,
js2-mode, rjsx-mode, typescript-mode, rust-mode, and php-mode)
+ Made *eww* popups for dash docsets larger
+ Renamed set-docset! => set-docsets! (set-docset! is aliased to
set-docsets!)
+ New +lookup/install-docset alias
2018-08-31 02:44:49 +02:00
|
|
|
(set-docsets! 'c-mode "C")
|
|
|
|
(set-docsets! 'c++-mode "C++" "Boost")
|
2020-03-27 01:25:30 -04:00
|
|
|
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
|
2022-11-17 17:04:50 +00:00
|
|
|
(set-formatter!
|
|
|
|
'clang-format
|
|
|
|
'("clang-format"
|
|
|
|
"-assume-filename"
|
|
|
|
(or (buffer-file-name)
|
|
|
|
(cdr (assoc major-mode
|
|
|
|
'((c-mode . ".c")
|
|
|
|
(c++-mode . ".cpp")
|
|
|
|
(cuda-mode . ".cu")
|
|
|
|
(protobuf-mode . ".proto"))))))
|
|
|
|
:modes '(c-mode c++-mode protobuf-mode cuda-mode))
|
2018-09-27 23:52:22 -04:00
|
|
|
(set-rotate-patterns! 'c++-mode
|
|
|
|
:symbols '(("public" "protected" "private")
|
|
|
|
("class" "struct")))
|
2020-08-12 18:52:14 -04:00
|
|
|
(set-ligatures! '(c-mode c++-mode)
|
2018-06-16 19:32:25 +02:00
|
|
|
;; Functional
|
|
|
|
;; :def "void "
|
|
|
|
;; Types
|
|
|
|
:null "nullptr"
|
|
|
|
:true "true" :false "false"
|
|
|
|
:int "int" :float "float"
|
|
|
|
:str "std::string"
|
|
|
|
:bool "bool"
|
|
|
|
;; Flow
|
|
|
|
:not "!"
|
|
|
|
:and "&&" :or "||"
|
|
|
|
:for "for"
|
|
|
|
:return "return"
|
|
|
|
:yield "#require")
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +tree-sitter)
|
2022-07-25 17:34:44 +02:00
|
|
|
(add-hook! '(c-mode-local-vars-hook
|
|
|
|
c++-mode-local-vars-hook)
|
|
|
|
:append #'tree-sitter!))
|
|
|
|
|
2020-04-14 00:12:40 -04:00
|
|
|
;; HACK Suppress 'Args out of range' error in when multiple modifications are
|
|
|
|
;; performed at once in a `c++-mode' buffer, e.g. with `iedit' or
|
|
|
|
;; multiple cursors.
|
2021-08-04 01:18:06 -04:00
|
|
|
(undefadvice! +cc--suppress-silly-errors-a (fn &rest args)
|
2020-04-14 00:12:40 -04:00
|
|
|
:around #'c-after-change-mark-abnormal-strings
|
2021-08-04 01:18:06 -04:00
|
|
|
(ignore-errors (apply fn args)))
|
2020-04-14 00:12:40 -04:00
|
|
|
|
2018-02-23 04:44:02 -05:00
|
|
|
;; Custom style, based off of linux
|
2019-10-24 17:01:14 -04:00
|
|
|
(setq c-basic-offset tab-width
|
|
|
|
c-backspace-function #'delete-backward-char)
|
|
|
|
|
2019-03-02 01:51:51 -05:00
|
|
|
(c-add-style
|
2019-10-24 17:01:14 -04:00
|
|
|
"doom" '((c-comment-only-line-offset . 0)
|
2018-06-23 16:48:58 +02:00
|
|
|
(c-hanging-braces-alist (brace-list-open)
|
|
|
|
(brace-entry-open)
|
|
|
|
(substatement-open after)
|
|
|
|
(block-close . c-snug-do-while)
|
|
|
|
(arglist-cont-nonempty))
|
|
|
|
(c-cleanup-list brace-else-brace)
|
|
|
|
(c-offsets-alist
|
|
|
|
(knr-argdecl-intro . 0)
|
|
|
|
(substatement-open . 0)
|
|
|
|
(substatement-label . 0)
|
|
|
|
(statement-cont . +)
|
|
|
|
(case-label . +)
|
|
|
|
;; align args with open brace OR don't indent at all (if open
|
|
|
|
;; brace is at eolp and close brace is after arg with no trailing
|
|
|
|
;; comma)
|
2019-01-14 00:50:33 -05:00
|
|
|
(brace-list-intro . 0)
|
|
|
|
(brace-list-close . -)
|
2018-06-23 16:48:58 +02:00
|
|
|
(arglist-intro . +)
|
|
|
|
(arglist-close +cc-lineup-arglist-close 0)
|
|
|
|
;; don't over-indent lambda blocks
|
|
|
|
(inline-open . 0)
|
|
|
|
(inlambda . 0)
|
|
|
|
;; indent access keywords +1 level, and properties beneath them
|
|
|
|
;; another level
|
|
|
|
(access-label . -)
|
|
|
|
(inclass +cc-c++-lineup-inclass +)
|
2019-10-24 17:01:14 -04:00
|
|
|
(label . 0))))
|
|
|
|
|
2019-11-21 14:21:16 -05:00
|
|
|
(when (listp c-default-style)
|
2020-02-06 15:50:12 -05:00
|
|
|
(setf (alist-get 'other c-default-style) "doom"))
|
|
|
|
|
|
|
|
(after! ffap
|
2020-02-07 01:35:46 +01:00
|
|
|
(add-to-list 'ffap-alist '(c-mode . ffap-c-mode))))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! modern-cpp-font-lock
|
2017-12-08 22:33:12 -05:00
|
|
|
:hook (c++-mode . modern-c++-font-lock-mode))
|
2016-06-23 01:32:56 -04:00
|
|
|
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! irony
|
2022-08-12 20:29:19 +02:00
|
|
|
:unless (modulep! +lsp)
|
2020-03-27 01:25:30 -04:00
|
|
|
:commands irony-install-server
|
2017-09-19 05:06:50 +02:00
|
|
|
;; Initialize compilation database, if present. Otherwise, fall back on
|
2017-12-27 17:10:21 -05:00
|
|
|
;; `+cc-default-compiler-options'.
|
2020-03-27 01:25:30 -04:00
|
|
|
:hook (irony-mode . +cc-init-irony-compile-options-h)
|
|
|
|
;; Only initialize `irony-mode' if the server is available. Otherwise fail
|
|
|
|
;; quietly and gracefully.
|
2020-03-29 01:29:27 -04:00
|
|
|
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-irony-mode-maybe-h)
|
2022-08-14 18:10:01 +02:00
|
|
|
:preface (setq irony-server-install-prefix (concat doom-data-dir "irony-server/"))
|
2020-03-27 01:25:30 -04:00
|
|
|
:config
|
|
|
|
(defun +cc-init-irony-mode-maybe-h ()
|
|
|
|
(if (file-directory-p irony-server-install-prefix)
|
|
|
|
(irony-mode +1)
|
|
|
|
(message "Irony server isn't installed")))
|
|
|
|
|
|
|
|
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
2017-04-08 23:37:40 -04:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! irony-eldoc
|
2018-06-05 02:06:01 +02:00
|
|
|
:hook (irony-mode . irony-eldoc))
|
2016-04-23 22:08:46 -04:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! flycheck-irony
|
2022-08-17 01:16:08 +01:00
|
|
|
:when (and (modulep! :checkers syntax)
|
|
|
|
(not (modulep! :checkers syntax +flymake)))
|
2018-06-21 15:54:36 +02:00
|
|
|
:config (flycheck-irony-setup))
|
2018-05-16 00:16:05 +02:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! company-irony
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :completion company)
|
2020-03-27 01:25:30 -04:00
|
|
|
:init (set-company-backend! 'irony-mode '(:separate company-irony-c-headers company-irony))
|
|
|
|
:config (require 'company-irony-c-headers)))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Major modes
|
|
|
|
|
2020-03-27 01:25:30 -04:00
|
|
|
(after! cmake-mode
|
2020-11-17 12:45:02 -05:00
|
|
|
(set-docsets! 'cmake-mode "CMake")
|
|
|
|
(set-popup-rule! "^\\*CMake Help\\*" :size 0.4 :ttl t)
|
|
|
|
(set-lookup-handlers! 'cmake-mode
|
|
|
|
:documentation '+cc-cmake-lookup-documentation-fn))
|
2019-11-19 09:58:44 +10:00
|
|
|
|
2020-11-19 23:00:13 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! company-cmake ; for `cmake-mode'
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :completion company)
|
2018-08-08 00:11:20 +02:00
|
|
|
:after cmake-mode
|
|
|
|
:config (set-company-backend! 'cmake-mode 'company-cmake))
|
2017-12-26 14:14:36 -05:00
|
|
|
|
2018-06-05 02:06:01 +02:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! demangle-mode
|
2018-07-19 03:38:01 +02:00
|
|
|
:hook llvm-mode)
|
2018-06-05 02:06:01 +02:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! company-glsl ; for `glsl-mode'
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :completion company)
|
2017-12-26 14:14:36 -05:00
|
|
|
:after glsl-mode
|
2018-08-08 00:11:20 +02:00
|
|
|
:config (set-company-backend! 'glsl-mode 'company-glsl))
|
2017-07-06 12:44:03 +02:00
|
|
|
|
|
|
|
|
2017-12-26 18:12:36 -05:00
|
|
|
;;
|
|
|
|
;; Rtags Support
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! rtags
|
2022-08-12 20:29:19 +02:00
|
|
|
:unless (modulep! +lsp)
|
2020-03-27 01:25:30 -04:00
|
|
|
;; Only initialize rtags-mode if rtags and rdm are available.
|
2020-03-29 01:29:27 -04:00
|
|
|
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-rtags-maybe-h)
|
2022-08-14 18:10:01 +02:00
|
|
|
:preface (setq rtags-install-path (concat doom-data-dir "rtags/"))
|
2017-12-26 18:12:36 -05:00
|
|
|
:config
|
2020-03-27 01:25:30 -04:00
|
|
|
(defun +cc-init-rtags-maybe-h ()
|
|
|
|
"Start an rtags server in c-mode and c++-mode buffers.
|
|
|
|
If rtags or rdm aren't available, fail silently instead of throwing a breaking error."
|
|
|
|
(and (require 'rtags nil t)
|
|
|
|
(rtags-executable-find rtags-rdm-binary-name)
|
|
|
|
(rtags-start-process-unless-running)))
|
|
|
|
|
2017-12-26 18:12:36 -05:00
|
|
|
(setq rtags-autostart-diagnostics t
|
|
|
|
rtags-use-bookmarks nil
|
2017-12-26 23:34:17 -05:00
|
|
|
rtags-completions-enabled nil
|
2018-08-02 03:47:29 +02:00
|
|
|
rtags-display-result-backend
|
2022-08-12 20:29:19 +02:00
|
|
|
(cond ((modulep! :completion ivy) 'ivy)
|
|
|
|
((modulep! :completion helm) 'helm)
|
2018-08-02 03:47:29 +02:00
|
|
|
('default))
|
2019-07-14 22:03:45 +02:00
|
|
|
;; These executables are named rtags-* on debian
|
|
|
|
rtags-rc-binary-name
|
2019-07-24 15:25:42 +02:00
|
|
|
(or (cl-find-if #'executable-find (list rtags-rc-binary-name "rtags-rc"))
|
|
|
|
rtags-rc-binary-name)
|
2019-07-14 22:03:45 +02:00
|
|
|
rtags-rdm-binary-name
|
2019-07-24 15:25:42 +02:00
|
|
|
(or (cl-find-if #'executable-find (list rtags-rdm-binary-name "rtags-rdm"))
|
|
|
|
rtags-rdm-binary-name)
|
2017-12-26 19:24:12 -05:00
|
|
|
;; If not using ivy or helm to view results, use a pop-up window rather
|
|
|
|
;; than displaying it in the current window...
|
|
|
|
rtags-results-buffer-other-window t
|
|
|
|
;; ...and don't auto-jump to first match before making a selection.
|
|
|
|
rtags-jump-to-first-match nil)
|
|
|
|
|
2018-06-15 17:27:48 +02:00
|
|
|
(set-lookup-handlers! '(c-mode c++-mode)
|
2018-03-01 13:17:07 -05:00
|
|
|
:definition #'rtags-find-symbol-at-point
|
|
|
|
:references #'rtags-find-references-at-point)
|
|
|
|
|
2017-12-26 19:24:12 -05:00
|
|
|
;; Use rtags-imenu instead of imenu/counsel-imenu
|
2018-08-04 13:41:38 +02:00
|
|
|
(define-key! (c-mode-map c++-mode-map) [remap imenu] #'+cc/imenu)
|
2017-12-26 19:24:12 -05:00
|
|
|
|
2020-03-27 01:25:30 -04:00
|
|
|
;; Ensure rtags cleans up after itself properly when exiting Emacs, rather
|
|
|
|
;; than display a jarring confirmation prompt for killing it.
|
|
|
|
(add-hook! 'kill-emacs-hook (ignore-errors (rtags-cancel-process)))
|
|
|
|
|
2023-09-11 23:52:27 +02:00
|
|
|
(add-hook 'rtags-jump-hook #'better-jumper-set-jump))
|
2019-02-21 16:08:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; LSP
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +lsp)
|
2019-08-27 00:04:11 -04:00
|
|
|
(add-hook! '(c-mode-local-vars-hook
|
|
|
|
c++-mode-local-vars-hook
|
2020-11-17 12:37:28 -05:00
|
|
|
objc-mode-local-vars-hook
|
2023-12-02 11:32:28 -05:00
|
|
|
cmake-mode-local-vars-hook
|
|
|
|
;; HACK Can't use cude-mode-local-vars-hook because cuda-mode
|
|
|
|
;; isn't a proper major mode (just a plain function
|
|
|
|
;; masquarading as one, so your standard mode hooks won't fire
|
|
|
|
;; from switching to cuda-mode).
|
|
|
|
cuda-mode-hook)
|
2022-07-25 18:12:03 +02:00
|
|
|
:append #'lsp!)
|
2020-10-11 21:50:15 -04:00
|
|
|
|
|
|
|
(map! :after ccls
|
|
|
|
:map (c-mode-map c++-mode-map)
|
|
|
|
:n "C-h" (cmd! (ccls-navigate "U"))
|
|
|
|
:n "C-j" (cmd! (ccls-navigate "R"))
|
|
|
|
:n "C-k" (cmd! (ccls-navigate "L"))
|
|
|
|
:n "C-l" (cmd! (ccls-navigate "D"))
|
|
|
|
(:localleader
|
|
|
|
:desc "Preprocess file" "lp" #'ccls-preprocess-file
|
|
|
|
:desc "Reload cache & CCLS" "lf" #'ccls-reload)
|
|
|
|
(:after lsp-ui-peek
|
|
|
|
(:localleader
|
2020-10-11 21:52:21 -04:00
|
|
|
:desc "Callers list" "c" #'+cc/ccls-show-caller
|
|
|
|
:desc "Callees list" "C" #'+cc/ccls-show-callee
|
2020-10-11 21:50:15 -04:00
|
|
|
:desc "References (address)" "a" #'+cc/ccls-show-references-address
|
|
|
|
:desc "References (not call)" "f" #'+cc/ccls-show-references-not-call
|
|
|
|
:desc "References (Macro)" "m" #'+cc/ccls-show-references-macro
|
|
|
|
:desc "References (Read)" "r" #'+cc/ccls-show-references-read
|
|
|
|
:desc "References (Write)" "w" #'+cc/ccls-show-references-write)))
|
2020-07-23 01:04:04 -04:00
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! :tools lsp +eglot)
|
2020-07-23 01:04:04 -04:00
|
|
|
;; Map eglot specific helper
|
|
|
|
(map! :localleader
|
|
|
|
:after cc-mode
|
|
|
|
:map c++-mode-map
|
2020-10-11 21:50:15 -04:00
|
|
|
:desc "Show type inheritance hierarchy" "ct" #'+cc/eglot-ccls-inheritance-hierarchy)
|
2020-07-23 01:04:04 -04:00
|
|
|
|
|
|
|
;; NOTE : This setting is untested yet
|
|
|
|
(after! eglot
|
2022-08-18 17:06:42 +02:00
|
|
|
(when IS-MAC
|
2020-07-23 01:04:04 -04:00
|
|
|
(add-to-list 'eglot-workspace-configuration
|
|
|
|
`((:ccls . ((:clang . ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1"
|
|
|
|
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
|
|
|
"-isystem/usr/local/include"]
|
2020-09-02 13:58:27 -04:00
|
|
|
:resourceDir (cdr (doom-call-process "clang" "-print-resource-dir"))))))))))))
|
2020-07-23 01:04:04 -04:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! ccls
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! +lsp)
|
|
|
|
:unless (modulep! :tools lsp +eglot)
|
2021-08-29 11:09:32 +02:00
|
|
|
:defer t
|
2019-04-08 23:01:30 -04:00
|
|
|
:init
|
2020-10-13 21:26:38 -04:00
|
|
|
(defvar ccls-sem-highlight-method 'font-lock)
|
2019-04-08 23:01:30 -04:00
|
|
|
(after! projectile
|
2022-03-30 17:44:30 +02:00
|
|
|
(add-to-list 'projectile-globally-ignored-directories "^.ccls-cache$")
|
2019-04-08 23:01:30 -04:00
|
|
|
(add-to-list 'projectile-project-root-files-bottom-up ".ccls-root")
|
2019-12-13 14:24:17 -05:00
|
|
|
(add-to-list 'projectile-project-root-files-top-down-recurring "compile_commands.json"))
|
2020-10-13 21:26:38 -04:00
|
|
|
;; Avoid using `:after' because it ties the :config below to when `lsp-mode'
|
|
|
|
;; loads, rather than `ccls' loads.
|
|
|
|
(after! lsp-mode (require 'ccls))
|
2019-12-13 14:24:17 -05:00
|
|
|
:config
|
2020-09-01 20:26:56 +02:00
|
|
|
(set-evil-initial-state! 'ccls-tree-mode 'emacs)
|
2020-10-13 21:26:38 -04:00
|
|
|
;; Disable `ccls-sem-highlight-method' if `lsp-enable-semantic-highlighting'
|
|
|
|
;; is nil. Otherwise, it appears ccls bypasses it.
|
2020-10-14 21:39:56 -04:00
|
|
|
(setq-hook! 'lsp-configure-hook
|
|
|
|
ccls-sem-highlight-method (if lsp-enable-semantic-highlighting
|
|
|
|
ccls-sem-highlight-method))
|
2022-08-18 17:06:42 +02:00
|
|
|
(when (or IS-MAC
|
|
|
|
IS-LINUX)
|
2020-11-29 14:47:32 -05:00
|
|
|
(setq ccls-initialization-options
|
|
|
|
`(:index (:trackDependency 1
|
2021-03-02 10:02:12 +01:00
|
|
|
:threads ,(max 1 (/ (doom-system-cpus) 2))))))
|
2022-08-18 17:06:42 +02:00
|
|
|
(when IS-MAC
|
2019-12-13 14:24:17 -05:00
|
|
|
(setq ccls-initialization-options
|
2020-09-01 20:26:56 +02:00
|
|
|
(append ccls-initialization-options
|
|
|
|
`(:clang ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1"
|
|
|
|
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
|
|
|
"-isystem/usr/local/include"]
|
|
|
|
:resourceDir (cdr (doom-call-process "clang" "-print-resource-dir"))))))))
|