From bbf9d296edd4745fb6b2961902c559438c61ed1f Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 22 Dec 2024 13:02:02 +0100 Subject: [PATCH] updaet go-mode Signed-off-by: Andreas Gerler --- elpa/go-mode-20230624.2315/go-mode-pkg.el | 14 ----- .../go-mode-autoloads.el | 59 ++++++++----------- elpa/go-mode-20240620.1948/go-mode-pkg.el | 8 +++ .../go-mode.el | 46 ++++++++++++++- elpa/go-mode-readme.txt | 10 ---- 5 files changed, 77 insertions(+), 60 deletions(-) delete mode 100644 elpa/go-mode-20230624.2315/go-mode-pkg.el rename elpa/{go-mode-20230624.2315 => go-mode-20240620.1948}/go-mode-autoloads.el (76%) create mode 100644 elpa/go-mode-20240620.1948/go-mode-pkg.el rename elpa/{go-mode-20230624.2315 => go-mode-20240620.1948}/go-mode.el (98%) delete mode 100644 elpa/go-mode-readme.txt diff --git a/elpa/go-mode-20230624.2315/go-mode-pkg.el b/elpa/go-mode-20230624.2315/go-mode-pkg.el deleted file mode 100644 index 73f169e0..00000000 --- a/elpa/go-mode-20230624.2315/go-mode-pkg.el +++ /dev/null @@ -1,14 +0,0 @@ -(define-package "go-mode" "20230624.2315" "Major mode for the Go programming language" - '((emacs "26.1")) - :commit "f21347ae9cf68ea33031bf5125896e8f16c8183c" :authors - '(("The go-mode Authors")) - :maintainers - '(("The go-mode Authors")) - :maintainer - '("The go-mode Authors") - :keywords - '("languages" "go") - :url "https://github.com/dominikh/go-mode.el") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/go-mode-20230624.2315/go-mode-autoloads.el b/elpa/go-mode-20240620.1948/go-mode-autoloads.el similarity index 76% rename from elpa/go-mode-20230624.2315/go-mode-autoloads.el rename to elpa/go-mode-20240620.1948/go-mode-autoloads.el index 3c049d97..d54b631a 100644 --- a/elpa/go-mode-20230624.2315/go-mode-autoloads.el +++ b/elpa/go-mode-20240620.1948/go-mode-autoloads.el @@ -1,12 +1,14 @@ -;;; go-mode-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- -;; +;;; go-mode-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "go-mode" "go-mode.el" (0 0 0 0)) ;;; Generated autoloads from go-mode.el (autoload 'go-mode "go-mode" "\ @@ -45,13 +47,13 @@ The following extra functions are defined: If you want to automatically run `gofmt' before saving a file, add the following hook to your Emacs configuration: -\(add-hook 'before-save-hook #'gofmt-before-save) +(add-hook 'before-save-hook #'gofmt-before-save) If you want to use `godef-jump' instead of etags (or similar), consider binding godef-jump to `M-.', which is the default key for `find-tag': -\(add-hook 'go-mode-hook (lambda () +(add-hook 'go-mode-hook (lambda () (local-set-key (kbd \"M-.\") #'godef-jump))) Please note that godef is an external dependency. You can install @@ -63,60 +65,51 @@ go get github.com/rogpeppe/godef If you're looking for even more integration with Go, namely on-the-fly syntax checking, auto-completion and snippets, it is recommended that you look at flycheck -\(see URL `https://github.com/flycheck/flycheck') or flymake in combination +(see URL `https://github.com/flycheck/flycheck') or flymake in combination with goflymake (see URL `https://github.com/dougm/goflymake'), gocode -\(see URL `https://github.com/nsf/gocode'), go-eldoc -\(see URL `github.com/syohex/emacs-go-eldoc') and yasnippet-go -\(see URL `https://github.com/dominikh/yasnippet-go') - -\(fn)" t nil) +(see URL `https://github.com/nsf/gocode'), go-eldoc +(see URL `github.com/syohex/emacs-go-eldoc') and yasnippet-go +(see URL `https://github.com/dominikh/yasnippet-go') +(fn)" t) (add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode)) - (autoload 'gofmt-before-save "go-mode" "\ Add this to .emacs to run gofmt on the current buffer when saving: -\(add-hook 'before-save-hook 'gofmt-before-save). +(add-hook 'before-save-hook 'gofmt-before-save). Note that this will cause ‘go-mode’ to get loaded the first time -you save any file, kind of defeating the point of autoloading." t nil) - +you save any file, kind of defeating the point of autoloading." t) (autoload 'godoc "go-mode" "\ Show Go documentation for QUERY, much like \\\\[man]. -\(fn QUERY)" t nil) - +(fn QUERY)" t) (autoload 'go-download-play "go-mode" "\ Download a paste from the playground and insert it in a Go buffer. Tries to look for a URL at point. -\(fn URL)" t nil) - +(fn URL)" t) (autoload 'go-dot-mod-mode "go-mode" "\ A major mode for editing go.mod files. -\(fn)" t nil) - +(fn)" t) (add-to-list 'auto-mode-alist '("go\\.mod\\'" . go-dot-mod-mode)) - (autoload 'go-dot-work-mode "go-mode" "\ A major mode for editor go.work files. -\(fn)" t nil) - +(fn)" t) (add-to-list 'auto-mode-alist '("go\\.work\\'" . go-dot-work-mode)) - (register-definition-prefixes "go-mode" '("go-" "god" "gofmt")) - -;;;*** -;;;### (autoloads nil nil ("go-mode-pkg.el") (0 0 0 0)) +;;; End of scraped data + +(provide 'go-mode-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; go-mode-autoloads.el ends here diff --git a/elpa/go-mode-20240620.1948/go-mode-pkg.el b/elpa/go-mode-20240620.1948/go-mode-pkg.el new file mode 100644 index 00000000..29c8528a --- /dev/null +++ b/elpa/go-mode-20240620.1948/go-mode-pkg.el @@ -0,0 +1,8 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "go-mode" "20240620.1948" + "Major mode for the Go programming language." + '((emacs "26.1")) + :url "https://github.com/dominikh/go-mode.el" + :commit "636d36e37a0d2b6adb2e12d802ff4794ccbba336" + :revdesc "636d36e37a0d" + :keywords '("languages" "go")) diff --git a/elpa/go-mode-20230624.2315/go-mode.el b/elpa/go-mode-20240620.1948/go-mode.el similarity index 98% rename from elpa/go-mode-20230624.2315/go-mode.el rename to elpa/go-mode-20240620.1948/go-mode.el index d1152eb0..3dd801b8 100644 --- a/elpa/go-mode-20230624.2315/go-mode.el +++ b/elpa/go-mode-20240620.1948/go-mode.el @@ -7,7 +7,8 @@ ;; license that can be found in the LICENSE file. ;; Author: The go-mode Authors -;; Version: 1.6.0 +;; Package-Version: 20240620.1948 +;; Package-Revision: 636d36e37a0d ;; Keywords: languages go ;; Package-Requires: ((emacs "26.1")) ;; URL: https://github.com/dominikh/go-mode.el @@ -2841,7 +2842,7 @@ If BUFFER, return the number of characters in that buffer instead." "Syntax table for `go-dot-mod-mode'.") (defconst go-dot-mod-mode-keywords - '("module" "go" "require" "replace" "exclude") + '("module" "go" "toolchain" "require" "exclude" "replace" "retract") "All keywords for go.mod files. Used for font locking.") (defgroup go-dot-mod nil @@ -2891,7 +2892,7 @@ If BUFFER, return the number of characters in that buffer instead." (add-to-list 'auto-mode-alist '("go\\.mod\\'" . go-dot-mod-mode)) (defconst go-dot-work-mode-keywords - '("go" "replace" "use") + '("go" "toolchain" "use" "replace") "All keywords for go.work files. Used for font locking.") ;;;###autoload @@ -3051,6 +3052,45 @@ This handles multi-line comments with a * prefix on each line." +;; Convenient go-* functions for gopls features available through code +;; actions, that work across LSP clients: + +(defun go-mode--code-action (kind) + "Request and invoke the specified kind of code actions for the current selection." + (cond + ((and (boundp 'eglot--managed-mode) eglot--managed-mode) + (let ((beg-end (eglot--code-action-bounds))) + (eglot-code-actions (car beg-end) (cadr beg-end) kind t))) + ((and (boundp 'lsp-mode) lsp-mode) + (lsp-execute-code-action-by-kind kind)) + (error "buffer is not managed by a known LSP client"))) + +(defun go-browse-freesymbols () + "View free symbols referenced by the current selection in a browser. Requires gopls v0.16." + (interactive) + (go-mode--code-action "source.freesymbols")) + +(defun go-browse-doc () + "View documentation for the current Go package in a browser. Requires gopls v0.16." + (interactive) + (go-mode--code-action "source.doc")) + +(defun go-browse-assembly () + "View assembly for the enclosing Go function in a browser. Requires gopls v0.16." + (interactive) + (go-mode--code-action "source.assembly")) + +(defun go-rename () + "Rename a Go symbol, prompting for the new name." + (interactive) + (cond + ((and (boundp 'eglot--managed-mode) eglot--managed-mode) + (call-interactively #'eglot-rename)) + ((and (boundp 'lsp-mode) lsp-mode) + (call-interactively #'lsp-rename)) + (error "buffer is not managed by a known LSP client"))) + + (provide 'go-mode) ;;; go-mode.el ends here diff --git a/elpa/go-mode-readme.txt b/elpa/go-mode-readme.txt deleted file mode 100644 index 07a602b3..00000000 --- a/elpa/go-mode-readme.txt +++ /dev/null @@ -1,10 +0,0 @@ -Copyright 2013 The go-mode Authors. All rights reserved. -Use of this source code is governed by a BSD-style -license that can be found in the LICENSE file. - -Author: The go-mode Authors -Version: 1.5.0 -Keywords: languages go -URL: https://github.com/dominikh/go-mode.el - -This file is not part of GNU Emacs. -- 2.47.3