LSP

(use-package lsp-mode
  :ensure t
  :init (setq lsp-keymap-prefix "C-c C-l"
              lsp-prefer-flymake nil)
  :commands (lsp make-lsp-client lsp-register-client)
  :hook (lsp-mode . lsp-enable-which-key-integration)
  :config
  ;; this is a particularly nasty bug
  ;; https://github.com/bbatsov/projectile/issues/1387
  (defun do.lsp/dont-resolve-symlinks-projectile (fun &rest args)
    "Call FUN with ARGS but disable the effects of `file-truename'."
    (cl-letf (((symbol-function 'file-truename) #'identity))
      (apply fun args)))
  (advice-add 'lsp--suggest-project-root :around
              #'do.lsp/dont-resolve-symlinks-projectile))

(use-package lsp-ui
  :ensure t
  :init (setq lsp-ui-flycheck-enable t)
  :commands lsp-ui-mode)

(use-package dap-mode
  :ensure t :after lsp-mode
  :config
  (dap-mode t)
  (dap-ui-mode t))