From 498f18c541c5d012db7d05ea403cc94dec61221e Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Tue, 19 Jan 2021 16:35:57 -0500 Subject: [PATCH] Add golang support --- README.org | 31 ++++++++++++++++++++++++------- init.el | 19 +++++++++++-------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/README.org b/README.org index d72601a..1cbca11 100644 --- a/README.org +++ b/README.org @@ -491,12 +491,12 @@ https://www.emacswiki.org/emacs/PythonProgrammingInEmacs + Built in mode #+begin_src emacs-lisp -;; (use-package python-mode -;; :hook (python-mode . lsp) -;; :config (require 'dap-python) -;; :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3. -;; (dap-python-executable "python3") ;; Same as above. -;; (dap-python-debugger 'debugpy)) +(use-package python-mode + :hook (python-mode . lsp) + :config (require 'dap-python) + :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3. + (dap-python-executable "python3") ;; Same as above. + (dap-python-debugger 'debugpy)) #+end_src ** Rust @@ -509,9 +509,26 @@ https://github.com/brotzeit/rustic + Install via ~lsp-install-server~ #+begin_src emacs-lisp -;; (use-package rustic) +(use-package rustic) #+end_src + +** Go + +Full *IDE* experience for Rust within Emacs. ++ Completion via =lsp-mode= ++ Debugging via =dap-mode= +Install the =gopls= language server. + +#+begin_src sh :tangle no +GO111MODULE=on go get golang.org/x/tools/gopls@latest +#+end_src + +#+begin_src emacs-lisp +(use-package go-mode + :hook (go-mode . lsp)) +#+end_src + * Writing :PROPERTIES: :header-args: :tangle init.el :results silent diff --git a/init.el b/init.el index 39294a2..58dd02e 100644 --- a/init.el +++ b/init.el @@ -177,14 +177,17 @@ :hook ((c-mode c++-mode objc-mode cuda-mode) . (lambda () (require 'ccls) (lsp)))) -;; (use-package python-mode -;; :hook (python-mode . lsp) -;; :config (require 'dap-python) -;; :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3. -;; (dap-python-executable "python3") ;; Same as above. -;; (dap-python-debugger 'debugpy)) - -;; (use-package rustic) +(use-package python-mode + :hook (python-mode . lsp) + :config (require 'dap-python) + :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3. + (dap-python-executable "python3") ;; Same as above. + (dap-python-debugger 'debugpy)) + +(use-package rustic) + +(use-package go-mode + :hook (go-mode . lsp)) (use-package org :hook