1

Add further integrations and fixes for lsp-mode

This commit is contained in:
Jessie Hildebrandt 2020-08-29 17:28:17 -04:00
parent b4d61a17b2
commit f20f31637d

36
init.el
View File

@ -412,15 +412,18 @@
("\\.lua\\'" . lua-mode)) ("\\.lua\\'" . lua-mode))
;; Load Web Mode ;; Load Web Mode
;; (Associated files: .php, .inc, .html) ;; (Associated files: .php, .html)
;; (In js-mode: .ts)
;; (In js-jsx-mode: .jsx, .tsx)
(use-package web-mode (use-package web-mode
:custom :custom
(web-mode-markup-indent-offset 2) (web-mode-markup-indent-offset 2)
(web-mode-enable-auto-quoting nil) (web-mode-enable-auto-quoting nil)
:mode :mode
(("\\.php\\'" . web-mode) (("\\.php\\'" . web-mode)
("\\.inc\\'" . web-mode) ("\\.html\\'" . web-mode)
("\\.html\\'" . web-mode))) ("\\.ts\\'" . js-mode)
("\\.[jt]sx\\'" . js-jsx-mode)))
;; Load JSON Mode ;; Load JSON Mode
;; (Associated files: .json) ;; (Associated files: .json)
@ -475,13 +478,38 @@
:hook :hook
(web-mode . lsp-deferred) (web-mode . lsp-deferred)
(js-mode . lsp-deferred) (js-mode . lsp-deferred)
(css-mode . lsp-deferred)
(json-mode . lsp-deferred) (json-mode . lsp-deferred)
(gdscript-mode . lsp-deferred) (gdscript-mode . lsp-deferred)
(rust-mode . lsp-deferred) (rust-mode . lsp-deferred)
:custom
(lsp-signature-auto-activate nil)
(lsp-signature-render-documentation nil)
(lsp-eldoc-hook nil)
:commands :commands
(lsp (lsp
lsp-deferred)) lsp-deferred))
;; Load LSP UI
(use-package lsp-ui
:custom
(lsp-ui-imenu-enable nil)
(lsp-ui-peek-enable t)
(lsp-ui-peek-always-show t)
(lsp-ui-doc-enable nil)
(lsp-ui-doc-max-width 50)
(lsp-ui-doc-max-height 10)
(lsp-ui-doc-position 'at-point)
(lsp-ui-doc-header t)
(lsp-ui-doc-include-signature t)
:config
(setq lsp-ui-doc-border (face-background 'lsp-ui-doc-background))
:bind
(:map lsp-ui-mode-map
("M-," . (lambda () (interactive) (lsp-ui-doc-mode t) (lsp-ui-doc-glance) (lsp-ui-doc-mode nil)))
("M-." . lsp-ui-peek-find-definitions)
("M-?" . lsp-ui-peek-find-references)))
;;==================== ;;====================
;; Package-Lint (Elisp Package Linter) ;; Package-Lint (Elisp Package Linter)
;;==================== ;;====================
@ -503,6 +531,8 @@
:hook :hook
(prog-mode . flycheck-mode) (prog-mode . flycheck-mode)
(c++-mode-hook . (lambda () (setq flycheck-clang-standard "c++17"))) (c++-mode-hook . (lambda () (setq flycheck-clang-standard "c++17")))
:config
(advice-add 'flycheck-eslint-config-exists-p :override (lambda() t))
:custom :custom
(flycheck-python-flake8-executable "flake8") (flycheck-python-flake8-executable "flake8")
(flycheck-python-pylint-executable "pylint") (flycheck-python-pylint-executable "pylint")