Emacs: Rearrange clangd argument stuff.

This commit is contained in:
tastytea 2020-01-26 01:30:13 +01:00
parent 5906b26237
commit 1b3fcad20e

View File

@ -1,6 +1,6 @@
;;; common.el --- Common programming settings. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-01-26T01:24:11+0100>
;; Time-stamp: <2020-01-26T01:29:29+0100>
;;; Commentary:
@ -319,19 +319,19 @@ purpose or not wide enough."
:after (whitespace company)
:defines (lsp-clients-clangd-args)
:init
(defvar my/clangd-args "-compile-commands-dir=build")
;; Add “-clang-tidy” to clangd args if the version supports it.
(if (>= (cdr (company-clang-version)) 9.0)
(setq my/clangd-args (concat my/clangd-args " -clang-tidy")))
:custom
(lsp-prefer-flymake nil) ; Disable flymake.
(lsp-auto-guess-root t) ; Don't ask for project root.
(lsp-eldoc-render-all t) ; Display all eldoc information.
(lsp-clients-clangd-args '(my/clang-args)) ; Arguments to clangd.
:config
;; Add “-clang-tidy” to clangd args if the version supports it.
(if (>= (cdr (company-clang-version)) 9.0)
(setq lsp-clients-clangd-args
'("-compile-commands-dir=build -clang-tidy"))
(setq lsp-clients-clangd-args
'("-compile-commands-dir=build")))
(defun my/lsp-ws-toggle ()
(if lsp-ui-peek-mode
(my/whitespace-mode-off)