]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix indent and font-lock for annotation_type
authorTheodor Thornhill <theo@thornhill.no>
Sat, 14 Jan 2023 14:18:40 +0000 (15:18 +0100)
committerTheodor Thornhill <theo@thornhill.no>
Sat, 14 Jan 2023 14:20:49 +0000 (15:20 +0100)
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Indent
inside body.
(java-ts-mode--font-lock-settings): Add rule for name in
annotation_type_element_declaration.

lisp/progmodes/java-ts-mode.el

index 1d704f16b473d9969b5bd54396c24fb6c56b7637..03342ab52bb40e3513a26963d15b61ac25772f38 100644 (file)
@@ -78,6 +78,7 @@
      ((parent-is "comment") prev-adaptive-prefix 0)
      ((parent-is "text_block") no-indent)
      ((parent-is "class_body") parent-bol java-ts-mode-indent-offset)
+     ((parent-is "annotation_type_body") parent-bol java-ts-mode-indent-offset)
      ((parent-is "interface_body") parent-bol java-ts-mode-indent-offset)
      ((parent-is "constructor_body") parent-bol java-ts-mode-indent-offset)
      ((parent-is "enum_body") parent-bol java-ts-mode-indent-offset)
    :language 'java
    :override t
    :feature 'definition
-   `((method_declaration
+   `((annotation_type_element_declaration
+      name: (identifier) @font-lock-function-name-face)
+
+     (method_declaration
       name: (identifier) @font-lock-function-name-face)
 
      (variable_declarator