Add basic LSP support
Still needs to be documented, but includes support for the following languages: + C/C++/ObjC + Go + Java + Javascript + OCaml + PHP + Python + Ruby + Scala + Swift + HTML/CSS Relevant to #460, #716, #1186
This commit is contained in:
parent
d7308799f6
commit
cb923eadcc
25 changed files with 182 additions and 57 deletions
7
modules/tools/lsp/autoload.el
Normal file
7
modules/tools/lsp/autoload.el
Normal file
|
@ -0,0 +1,7 @@
|
|||
;;; feature/lsp/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +lsp|init ()
|
||||
"Enable LSP as late as possible, to allow users to customize it via file or
|
||||
dir local variables."
|
||||
(add-hook 'hack-local-variables-hook #'lsp nil t))
|
21
modules/tools/lsp/config.el
Normal file
21
modules/tools/lsp/config.el
Normal file
|
@ -0,0 +1,21 @@
|
|||
;;; tools/lsp/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! lsp-ui
|
||||
:hook (lsp-mode . lsp-ui-mode)
|
||||
:config
|
||||
(setq lsp-prefer-flymake nil
|
||||
lsp-ui-doc-max-height 8
|
||||
lsp-ui-doc-max-width 35
|
||||
lsp-ui-sideline-ignore-duplicate t)
|
||||
(define-key! lsp-ui-mode-map
|
||||
[remap xref-find-definitions] #'lsp-ui-peek-find-definitions
|
||||
[remap xref-find-references] #'lsp-ui-peek-find-references)
|
||||
(set-lookup-handlers! 'lsp-ui-mode
|
||||
:definition #'lsp-ui-peek-find-definitions
|
||||
:references #'lsp-ui-peek-find-references))
|
||||
|
||||
(def-package! company-lsp
|
||||
:when (featurep! :completion company)
|
||||
:after lsp-mode
|
||||
:config
|
||||
(set-company-backend! 'lsp-mode 'company-lsp))
|
7
modules/tools/lsp/packages.el
Normal file
7
modules/tools/lsp/packages.el
Normal file
|
@ -0,0 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/lsp/packages.el
|
||||
|
||||
(package! lsp-mode)
|
||||
(package! lsp-ui)
|
||||
(when (featurep! :completion company)
|
||||
(package! company-lsp))
|
Loading…
Add table
Add a link
Reference in a new issue