]> git.eshelyaron.com Git - emacs.git/commitdiff
go-ts-mode: Highlight variable declarations
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 6 Feb 2023 02:42:12 +0000 (04:42 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 6 Feb 2023 02:42:12 +0000 (04:42 +0200)
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Highlight variable declarations in 'definition' feature.

lisp/progmodes/go-ts-mode.el

index dbb08c8144722e62445e3305afb5b7b82f5854e4..7802c1fbfcc26fff713714b0c65003941f54e8a0 100644 (file)
      (field_declaration
       name: (field_identifier) @font-lock-property-face)
      (parameter_declaration
-      name: (identifier) @font-lock-variable-name-face))
+      name: (identifier) @font-lock-variable-name-face)
+     (short_var_declaration
+      left: (expression_list
+             (identifier) @font-lock-variable-name-face
+             ("," (identifier) @font-lock-variable-name-face)*))
+     (var_spec name: (identifier) @font-lock-variable-name-face
+               ("," name: (identifier) @font-lock-variable-name-face)*))
 
    :language 'go
    :feature 'function