 ;;   (add-hook 'objc-mode-hook 'irony-mode)
 ;;   (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
 ;;
-(use-package clang-format
-  :ensure t)
 ;;
 ;; (use-package company-tabnine
 ;;   :ensure t

  ;;  (lambda () (local-set-key (kbd "<tab>") #'company-complete)
  ;;    (local-set-key (kbd "C-SPC") #'company-complete-selection))))

(use-package company-lsp
  :ensure t
  :after (lsp-mode)
  :diminish company-lsp
  :config
  (push 'company-lsp company-backends)
  (setq company-lsp-async t)
  (setq company-lsp-cache-candidates t)
  (setq company-lsp-enable-recompletion t))
  ;; :config
  ;; (require 'company-lsp)
  ;; (push 'company-lsp company-backends)
  ;; (setq company-transformers nil
  ;;       company-lsp-async t
  ;;       company-lsp-cache-candidates nil))

;; (use-package company-c-headers
;;   :ensure t)
;;
;; (use-package ccls
;;   :preface
;;   (setq ccls-executable "/usr/local/bin/ccls"))
;;   :diminish t
;;   :hook ((c-mode c++-mode objc-mode cuda-mode) .
;;           (lambda () (require 'ccls) (lsp)))

;;
;; (use-package company-irony

(use-package lsp-mode
  :hook ((python-mode . lsp-deferred)
          (c-mode . lsp-deferred)
          (c++-mode . lsp-deferred))
  :commands lsp lsp-deferred
  :config
  (setq lsp-response-timeout 90000))

(use-package lsp-ui
  :ensure t
  :commands lsp-ui-mode
  :hook (lsp-mode-hook . lsp-ui-mode))

(use-package lsp-treemacs
  :ensure t
  :commands lsp-treemacs-errors-list)

(use-package company-lsp
  :ensure t
  :after (lsp-mode company)
  :commands company-lsp
  :diminish company-lsp
  :config
  (require 'company-lsp)
  (push 'company-lsp company-backends)
  (setq company-lsp-async t)
  (setq company-lsp-cache-candidates t)
  (setq company-lsp-enable-recompletion t))
  ;; :config
  ;; (require 'company-lsp)
  ;; (push 'company-lsp company-backends)
  ;; (setq company-transformers nil
  ;;       company-lsp-async t
  ;;       company-lsp-cache-candidates nil))

(use-package company
  :ensure t
