programming-eglot.el (1399B)
1 ;;; programming-eglot.el --- -*- lexical-binding: t; -*- 2 ;;; Commentary: 3 ;;; Eglot configuration 4 ;;; Code: 5 (use-package eglot 6 :bind 7 (:map eglot-mode-map 8 ("C-c e a" . eglot-code-actions) 9 ("C-c e r" . eglot-reconnect) 10 ("<f2>" . eglot-rename) 11 ("C-c e ?" . eldoc-print-current-symbol-info)) 12 :config 13 (add-to-list 'eglot-ignored-server-capabilities :documentHighlightProvider) 14 (add-to-list 'eglot-server-programs `(json-mode "vscode-json-language-server" "--stdio")) 15 (setq-default eglot-workspace-configuration 16 '(:gopls (:usePlaceholders t))) 17 (setq-default 18 eglot-workspace-configuration 19 '((:gopls . ((gofumpt . t))))) 20 :hook 21 (before-save . gofmt-before-save) 22 (before-save . eglot-format-buffer) 23 (rust-mode . eglot-ensure) 24 (rust-ts-mode . eglot-ensure) 25 (sh-script-mode . eglot-ensure) 26 (python-mode . eglot-ensure) 27 (json-mode . eglot-ensure) 28 (yaml-mode . eglot-ensure) 29 (c-mode . eglot-ensure) 30 (cc-mode . eglot-ensure) 31 (go-mode . eglot-ensure) 32 (go-ts-mode . eglot-ensure) 33 (js-mode . eglot-ensure) 34 (js2-mode . eglot-ensure) 35 (typescript-mode . eglot-ensure) 36 (typescript-ts-mode . eglot-ensure) 37 :custom 38 rustic-lsp-client 'eglot) 39 40 (use-package eldoc-box 41 :hook 42 (eglot-managed-mode . eldoc-box-hover-mode) 43 :custom 44 (eldoc-box-max-pixel-width 1024)) 45 46 47 (provide 'programming-eglot) 48 ;;; programming-eglot.el ends here