summaryrefslogtreecommitdiff
path: root/lisp/progmodes/go-ts-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/go-ts-mode.el')
-rw-r--r--lisp/progmodes/go-ts-mode.el26
1 files changed, 17 insertions, 9 deletions
diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el
index 95dcf653fc6..4b14e55281e 100644
--- a/lisp/progmodes/go-ts-mode.el
+++ b/lisp/progmodes/go-ts-mode.el
@@ -124,16 +124,25 @@
'((["," "." ";" ":"]) @font-lock-delimiter-face)
:language 'go
+ :feature 'definition
+ '((function_declaration
+ name: (identifier) @font-lock-function-name-face)
+ (method_declaration
+ name: (field_identifier) @font-lock-function-name-face)
+ (method_spec
+ name: (field_identifier) @font-lock-function-name-face)
+ (field_declaration
+ name: (field_identifier) @font-lock-property-face)
+ (parameter_declaration
+ name: (identifier) @font-lock-variable-name-face))
+
+ :language 'go
:feature 'function
'((call_expression
function: (identifier) @font-lock-function-name-face)
(call_expression
function: (selector_expression
- field: (field_identifier) @font-lock-function-name-face))
- (function_declaration
- name: (identifier) @font-lock-function-name-face)
- (method_declaration
- name: (field_identifier) @font-lock-function-name-face))
+ field: (field_identifier) @font-lock-function-name-face)))
:language 'go
:feature 'keyword
@@ -221,11 +230,10 @@
;; Font-lock.
(setq-local treesit-font-lock-settings go-ts-mode--font-lock-settings)
(setq-local treesit-font-lock-feature-list
- '(( comment)
+ '(( comment definition)
( keyword string type)
- ( constant escape-sequence function label number
- property variable)
- ( bracket delimiter error operator)))
+ ( constant escape-sequence label number)
+ ( bracket delimiter error function operator property variable)))
(treesit-major-mode-setup)))