2022-11-19 04:33:22 +01:00
|
|
|
;;; init-eglot.el --- Configuración de eglot (LSP) -*- lexical-binding: t -*-
|
2022-11-19 03:56:34 +01:00
|
|
|
|
|
|
|
;; Author: kj <webmaster@outcontrol.net>
|
|
|
|
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
2023-04-14 18:39:19 +02:00
|
|
|
;; Este archivo tiene todo lo relacionado con eglot.
|
|
|
|
;; Eglot es un cliente LSP para Emacs que desde la
|
|
|
|
;; versión 29 viene integrado dentro del mismo.
|
|
|
|
;;
|
|
|
|
;; El nombre Eglot es un apócope de "Emacs polyglot"
|
|
|
|
;; ya que con este cliente podemos añadir soporte para
|
|
|
|
;; muchísimos lenguajes, puesto que actualente el que
|
|
|
|
;; un lenguaje tenga su propio LSP es muy normal.
|
|
|
|
;;
|
|
|
|
;; Como añadido:
|
|
|
|
;;
|
|
|
|
;; Un Languaje Server Provider (LSP), es un protocolo
|
|
|
|
;; mediante el cual existen servidores para lenguajes
|
|
|
|
;; en específico, los cuales proveen cosas como el
|
|
|
|
;; autocompletado, linting, documentación, ir a la
|
|
|
|
;; definición, etc.
|
|
|
|
;;
|
|
|
|
;; Este protocolo viene a solucionar el problema de
|
|
|
|
;; que cada herramienta de programación tenga que
|
|
|
|
;; volver a crear su propio soporte para cada uno
|
|
|
|
;; de los lenguajes (DRY).
|
|
|
|
|
2022-11-19 03:56:34 +01:00
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(use-package eglot
|
|
|
|
:defer t
|
|
|
|
:straight (:type built-in)
|
2022-11-19 18:59:47 +01:00
|
|
|
:hook ((css-mode . eglot-ensure)
|
2022-11-23 17:30:07 +01:00
|
|
|
(html-mode . eglot-ensure)
|
|
|
|
(php-mode . eglot-ensure)
|
2023-02-05 22:28:21 +01:00
|
|
|
(rust-mode . eglot-ensure)
|
2022-11-23 17:30:07 +01:00
|
|
|
(sh-mode . eglot-ensure))
|
2022-11-19 03:56:34 +01:00
|
|
|
:config
|
2023-03-25 18:01:11 +01:00
|
|
|
;; (add-to-list 'eglot-server-programs '(php-mode . ("intelephense" "--stdio")))
|
|
|
|
(add-to-list 'eglot-server-programs '(php-mode . ("phpactor" "language-server" "-vvv")))
|
2023-04-13 09:28:20 +02:00
|
|
|
(setq eglot-stay-out-of '(company))
|
2022-11-23 04:06:05 +01:00
|
|
|
;; (add-to-list 'eglot-ignored-server-capabilites :hoverProvider)
|
2022-11-19 20:44:14 +01:00
|
|
|
;; (add-to-list 'eglot-server-programs '(css-mode . ("vscode-css-language-server" "--stdio")))
|
|
|
|
;; (add-to-list 'eglot-server-programs '(html-mode . ("vscode-html-language-server" "--stdio")))
|
2022-11-19 19:25:30 +01:00
|
|
|
|
2022-11-23 00:35:03 +01:00
|
|
|
;; (add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))
|
2022-11-19 20:44:14 +01:00
|
|
|
)
|
2022-11-19 03:56:34 +01:00
|
|
|
|
2022-11-19 18:59:47 +01:00
|
|
|
;; Emmet (mientras veo como hacer funcionar emmet-ls)
|
|
|
|
(use-package emmet-mode
|
|
|
|
:defer t
|
|
|
|
:straight t
|
|
|
|
:hook
|
|
|
|
((html-mode . emmet-mode)
|
|
|
|
(web-mode . emmet-mode))
|
|
|
|
)
|
|
|
|
|
2022-11-23 04:06:05 +01:00
|
|
|
;; Revisar por errores en el código
|
|
|
|
(use-package flymake
|
|
|
|
:defer t
|
|
|
|
:straight (:type built-in)
|
|
|
|
:hook (prog-mode . (lambda ()
|
|
|
|
(unless (derived-mode-p 'makefile-mode)
|
|
|
|
(flymake-mode))))
|
2023-05-02 06:29:31 +02:00
|
|
|
:config
|
|
|
|
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
|
2022-11-23 04:06:05 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
;; Mostar los errores de flymake en un popup-tip
|
|
|
|
(use-package flymake-diagnostic-at-point
|
|
|
|
:defer t
|
|
|
|
:straight t
|
|
|
|
:after flymake
|
|
|
|
:hook (flymake-mode . flymake-diagnostic-at-point-mode))
|
|
|
|
|
2022-11-19 04:33:22 +01:00
|
|
|
(provide 'init-eglot)
|
|
|
|
;;; init-eglot.el ends here
|