Fix go-ts-mode const_spec highlighting (Bug#76330)
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Handle multiple const_spec identifiers. * test/lisp/progmodes/go-ts-mode-resources/font-lock.go: Add test case.
This commit is contained in:
parent
bd1d6761f4
commit
b531bbf73e
2 changed files with 8 additions and 1 deletions
|
@ -154,7 +154,8 @@
|
|||
,@(when (go-ts-mode--iota-query-supported-p)
|
||||
'((iota) @font-lock-constant-face))
|
||||
(const_declaration
|
||||
(const_spec name: (identifier) @font-lock-constant-face)))
|
||||
(const_spec name: (identifier) @font-lock-constant-face
|
||||
("," name: (identifier) @font-lock-constant-face)*)))
|
||||
|
||||
:language 'go
|
||||
:feature 'delimiter
|
||||
|
|
|
@ -3,3 +3,9 @@ for idx, val := range arr {}
|
|||
// ^ font-lock-variable-name-face
|
||||
for idx := 0; idx < n; idx++ {}
|
||||
// ^ font-lock-variable-name-face
|
||||
|
||||
const (
|
||||
zero, one = 0, 1
|
||||
// ^ font-lock-constant-face
|
||||
// ^ font-lock-constant-face
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue