mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 03:40:56 -08:00
Merge from origin/emacs-29
f0300fb059; Tweak "(emacs)Bug Reference" formatting/wording.ea62a14ea3Fix display of vscrolled windows4cefa3c0b1; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#...db7b571aaa; Improve documentation of 'world-clock'6a0bb7beae* doc/emacs/misc.texi (emacsclient Options): Suggest forw...859b4227e3Update go-ts-mode to support latest tree-sitter-go grammar407e85ce13Fix c++-ts-mode defun navigation (bug#65885)aca5064f12; Fix last change.55aab2d471; * etc/PROBLEMS: An entry about focus issues with XFCE (...19cee16576; * doc/emacs/misc.texi (emacsclient Options): Fix typo. ...2a41b6ba51; * src/filelock.c (Flock_file): Doc fix (bug#70216).
This commit is contained in:
commit
adbcf268bc
9 changed files with 94 additions and 43 deletions
|
|
@ -113,6 +113,13 @@
|
|||
(ignore-errors
|
||||
(or (treesit-query-string "" '((iota) @font-lock-constant-face) 'go) t)))
|
||||
|
||||
;; tree-sitter-go changed method_spec to method_elem in
|
||||
;; https://github.com/tree-sitter/tree-sitter-go/commit/b82ab803d887002a0af11f6ce63d72884580bf33
|
||||
(defun go-ts-mode--method-elem-supported-p ()
|
||||
"Return t if Go grammar uses `method_elem' instead of `method_spec'."
|
||||
(ignore-errors
|
||||
(or (treesit-query-string "" '((method_elem) @cap) 'go) t)))
|
||||
|
||||
(defvar go-ts-mode--font-lock-settings
|
||||
(treesit-font-lock-rules
|
||||
:language 'go
|
||||
|
|
@ -137,11 +144,13 @@
|
|||
|
||||
:language 'go
|
||||
:feature 'definition
|
||||
'((function_declaration
|
||||
`((function_declaration
|
||||
name: (identifier) @font-lock-function-name-face)
|
||||
(method_declaration
|
||||
name: (field_identifier) @font-lock-function-name-face)
|
||||
(method_spec
|
||||
(,(if (go-ts-mode--method-elem-supported-p)
|
||||
'method_elem
|
||||
'method_spec)
|
||||
name: (field_identifier) @font-lock-function-name-face)
|
||||
(field_declaration
|
||||
name: (field_identifier) @font-lock-property-name-face)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue