From 73d02ab60344af6a4746e53afffb89ac30b1ee6f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 24 Sep 2022 12:35:03 -0700 Subject: fix(prog/lsp): apply a number of fixes related to LSP Now that I've switched back to LSP, there's some configuration to delete and some to update. The configuration related to rust is fixed (lsp-ui was not loading properly), and I'm also disabling the inlay hints (they are very intrusive, I'll need more tweaks to find something that works for me). For the LSP configuration itself, I'm tweaking a few more things, especially related to the UI. Finally, deleting configurations for eglot and go: eglot is replaced by lsp-mode, and go's configuration is in its own file. Change-Id: I73fb4b66c8816dd6e20efa358c81e3c306b8255f --- emacs/custom/my-prog.el | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'emacs/custom/my-prog.el') diff --git a/emacs/custom/my-prog.el b/emacs/custom/my-prog.el index 578207c..d11eebd 100644 --- a/emacs/custom/my-prog.el +++ b/emacs/custom/my-prog.el @@ -61,26 +61,6 @@ (add-hook 'makefile-mode-hook 'my/makefile-mode-hook) -(require 'go-mode) -(require 'gotest) - -(defun my/go-mode-hook () - "Hooks for `go-mode'." - (setq tab-width 4) - (setq go-test-verbose t) - - (set (make-local-variable 'compile-command) - "go build -v && go test -v -cover") - (define-key go-mode-map (kbd "C-c C-r") 'compile) - (define-key go-mode-map (kbd "C-c C-R") 'recompile) - (define-key go-mode-map (kbd "C-c C-n") 'go-run) - (define-key go-mode-map (kbd "C-c C-c") 'go-coverage) - (define-key go-mode-map (kbd "C-c .") 'go-test-current-test) - (define-key go-mode-map (kbd "C-c C-f") 'go-test-current-file) - (define-key go-mode-map (kbd "C-c C-p") 'go-test-current-project)) - -(add-hook 'go-mode-hook 'my/go-mode-hook) - (defun my/elisp-mode-hook () "Hooks for `elisp-mode'." (define-key emacs-lisp-mode-map (kbd "C-c C-e") 'eval-buffer) @@ -92,31 +72,6 @@ (dolist (hook '(prog-mode-hook conf-mode-hook)) (add-hook hook 'turn-on-eldoc-mode)) -(require 'eglot) -;; List of settings for gopls: -;; https://github.com/golang/tools/blob/master/gopls/doc/settings.md -(setq eglot-workspace-configuration - '((:gopls . - ((staticcheck . t) - (experimentalWorkspaceModule . t) - (matcher . "CaseSensitive") - (usePlaceholders . t))))) - -(defun my/eglot-install-save-hook () - "Install the local hooks that are executed before saving a buffer." - ;; the last thing we do is to format the buffer - (add-hook 'before-save-hook #'eglot-format-buffer 100 t)) - -;; ensure we load eglot for some specific modes -(dolist (hook '(go-mode-hook nix-mode-hook rust-mode-hook)) - (add-hook hook 'eglot-ensure) - (add-hook hook #'my/eglot-install-save-hook)) - -(require 'rustic) -(setq rustic-lsp-server 'rust-analyzer - rustic-lsp-client 'eglot - rustic-format-on-save t) - (provide 'my-prog) ;;; my-prog.el ends here -- cgit v1.2.3