"|=" "~" ">>" ">>>" "<<" "::" "?" "&=")
"Java operators for tree-sitter font-locking.")
+(defun java-ts-mode--string-highlight-helper ()
+"Returns, for strings, a query based on what is supported by
+the available version of Tree-sitter for java."
+ (condition-case nil
+ (progn (treesit-query-capture 'java '((text_block) @font-lock-string-face))
+ `((string_literal) @font-lock-string-face
+ (text_block) @font-lock-string-face))
+ (error
+ `((string_literal) @font-lock-string-face))))
+
(defvar java-ts-mode--font-lock-settings
(treesit-font-lock-rules
:language 'java
:language 'java
:override t
:feature 'string
- `((string_literal) @font-lock-string-face
- (text_block) @font-lock-string-face)
+ (java-ts-mode--string-highlight-helper)
:language 'java
:override t
:feature 'literal