Move around java-ts-mode font-lock rules (bug#75154)

* lisp/progmodes/java-ts-mode.el:
(java-ts-mode--font-lock-settings): Move constant feature down
so it overrides expression and definition.
This commit is contained in:
Yuan Fu 2025-03-16 22:30:42 -07:00
parent 93cd55f40e
commit 3d2d95e284
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -236,11 +236,6 @@ For NODE, OVERRIDE, START, and END, see `treesit-font-lock-rules'."
(block_comment) @font-lock-comment-face)
:language 'java
:override t
:feature 'constant
`((identifier) @java-ts-mode--fontify-constant
[(true) (false)] @font-lock-constant-face)
:language 'java
:override t
:feature 'keyword
`([,@java-ts-mode--keywords
(this)
@ -346,7 +341,13 @@ For NODE, OVERRIDE, START, and END, see `treesit-font-lock-rules'."
(argument_list (identifier) @font-lock-variable-name-face)
(expression_statement (identifier) @font-lock-variable-use-face))
;; Make sure the constant feature is after expression and definition,
;; because those two applies variable-name-face on some constants.
:language 'java
:override t
:feature 'constant
`((identifier) @java-ts-mode--fontify-constant
[(true) (false)] @font-lock-constant-face)
:language 'java
:feature 'bracket
'((["(" ")" "[" "]" "{" "}"]) @font-lock-bracket-face)