diff options
| author | Stefan Kangas | 2023-02-08 06:30:15 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2023-02-08 06:30:15 +0100 |
| commit | d492be400e1676cee68432a1dc1009a0fa8b9a2b (patch) | |
| tree | 9fdf73418ee35249a22c752075da70404dee7ccb /lisp/progmodes/java-ts-mode.el | |
| parent | 2273cdb40e1939f7c29a669f6a64e6a27738c1a5 (diff) | |
| parent | c9ba05af8dfabca00023bd2312dec4ec59497801 (diff) | |
| download | emacs-d492be400e1676cee68432a1dc1009a0fa8b9a2b.tar.gz emacs-d492be400e1676cee68432a1dc1009a0fa8b9a2b.zip | |
Merge from origin/emacs-29
c9ba05af8df Fix crashes inside 'xfree' called from treesit.c
746748f5c28 Make java-ts-mode use the c-ts-common-indent-type-regexp-...
87d39a30b12 Fix c-ts-mode indentation
7cb92b53987 Fix c-ts-mode indentation
d68ff6016d0 Fix c-ts-mode indentation (bug#61291)
2ac8c4bbd6f (eglot-completion-at-point): Return correct values in :co...
321cbd9a601 Tighten and simplify typescript compilation-mode regexps ...
97533e73ad6 ; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibl...
9dfccb89fc5 Clarify bug-reference-auto-setup-functions docstring.
17ab426670a * lisp/treesit.el (treesit): Fix shortdoc example form (b...
5a6dfab1e4d Use c-ts-common-statement-offset in java-ts-mode (bug#61142)
c3262216abb Add array_initializer to java-ts-mode
79ab62e0bb5 go-ts-mode: Highlight variable declarations
1fab91d852e go-ts-mode: Fix highlighting of function name in call_exp...
07ffe902c63 c-ts-mode: Highlight "property functions" as functions
a529b0d6463 rust-ts-mode: Fix highlighting of function name in call_e...
088425538f2 rust-ts-mode--font-lock-settings: Improve consistency
793c24a6ac7 Make sure 'M-x show-paren-local-mode' turns on right away
60089dcfe06 Add to bug-reference-auto-setup-functions after its decla...
26e947ccb14 * lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (b...
948e343496b ; Fix byte-compilation warning
6568a1aaf9a Fix inability to turn show-paren-local-mode on manually (...
24085ba6105 ; go-ts-mode--indent-rules: Indent to 0 at top level
0862a79fef5 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
bb999df5d6f ; Fix whitespace of last change
929daafa1d6 ; Fix trivial mistake in emoji--choose-emoji
d7b4a8487f6 ; * lisp/isearch.el (emoji--read-emoji): Avoid compilatio...
e38ff004631 rust-ts-mode: Highlight variable declarations
d12727057d4 rust-ts-mode--indent-rules: Indent to 0 at top level
85705a7059f ; Move misplaces parenthesis in emoji--choose-emoji
18c43bb9d6c Ensure upper bound of font-lock region is less than point...
94f291d1505 ; * lisp/paren.el (show-paren-predicate): Doc fix. (Bug#...
3ffd0eddce6 Highlight more complex function parameters
58dc03ba7e4 No longer use transient in isearch-emoji-by-name
0c125fcc67a Make highlighting more regular across TS modes (bug#61205)
1dd751c3ac4 ; Improve documentation of 'proper-list-p'
96181ed3f09 Document 'plistp'
03d9d18513b Fix display of raised/lowered composed text
f13479d9556 Fix installation of tree-sitter grammar on MS-Windows
0358267204d Update the Emacs FAQ for Emacs 29
2c33e2889b4 Fix byte-compilation of *-ts-mode.el files
b40a929a3f2 ; ruby-ts--syntax-propertize: Amend commentary
b80f36b88c7 Make c-ts-mode-set-style's effect local (bug#61245)
671e5d9fad5 ; * lisp/treesit.el (treesit--font-lock-level-setter): Mi...
69380a88e92 c-ts-mode: Highlight name in parameter declarations
89b550eac29 Fix switch statement indentation for go-ts-mode (bug#61238)
1a123feb181 Fix bidi reordering of sequence of whitespace characters ...
8870b54db99 Add tests for compilation support for TypeScript (bug#61104)
873a0a15085 Add support for TypeScript compilation to compile.el (bug...
3a64f81ebc1 Don't clobber match data in 'y-or-n-p'
4c765d93ab3 Refine the previous change
d99b5151f8c Add syntax-propertize-function to ruby-ts-mode
f25c15ceb7d ; Fix typos
35e238cae8b Improve documentation of 'header-line-indent-mode'
c3f58a66514 Don't casemap erc-sasl-user when set to :nick
e444115d026 Improve keymap-global-set and keymap-local-set interactiv...
# Conflicts:
# etc/NEWS
Diffstat (limited to 'lisp/progmodes/java-ts-mode.el')
| -rw-r--r-- | lisp/progmodes/java-ts-mode.el | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index e4153725efd..5523b112d40 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el | |||
| @@ -70,21 +70,25 @@ | |||
| 70 | (defvar java-ts-mode--indent-rules | 70 | (defvar java-ts-mode--indent-rules |
| 71 | `((java | 71 | `((java |
| 72 | ((parent-is "program") point-min 0) | 72 | ((parent-is "program") point-min 0) |
| 73 | ((node-is "}") (and parent parent-bol) 0) | 73 | ((match "}" "element_value_array_initializer") |
| 74 | parent-bol 0) | ||
| 75 | ((node-is "}") point-min c-ts-common-statement-offset) | ||
| 74 | ((node-is ")") parent-bol 0) | 76 | ((node-is ")") parent-bol 0) |
| 77 | ((node-is "else") parent-bol 0) | ||
| 75 | ((node-is "]") parent-bol 0) | 78 | ((node-is "]") parent-bol 0) |
| 76 | ((and (parent-is "comment") c-ts-common-looking-at-star) | 79 | ((and (parent-is "comment") c-ts-common-looking-at-star) |
| 77 | c-ts-common-comment-start-after-first-star -1) | 80 | c-ts-common-comment-start-after-first-star -1) |
| 78 | ((parent-is "comment") prev-adaptive-prefix 0) | 81 | ((parent-is "comment") prev-adaptive-prefix 0) |
| 79 | ((parent-is "text_block") no-indent) | 82 | ((parent-is "text_block") no-indent) |
| 80 | ((parent-is "class_body") parent-bol java-ts-mode-indent-offset) | 83 | ((parent-is "class_body") point-min c-ts-common-statement-offset) |
| 81 | ((parent-is "annotation_type_body") parent-bol java-ts-mode-indent-offset) | 84 | ((parent-is "array_initializer") parent-bol java-ts-mode-indent-offset) |
| 82 | ((parent-is "interface_body") parent-bol java-ts-mode-indent-offset) | 85 | ((parent-is "annotation_type_body") point-min c-ts-common-statement-offset) |
| 83 | ((parent-is "constructor_body") parent-bol java-ts-mode-indent-offset) | 86 | ((parent-is "interface_body") point-min c-ts-common-statement-offset) |
| 87 | ((parent-is "constructor_body") point-min c-ts-common-statement-offset) | ||
| 84 | ((parent-is "enum_body_declarations") parent-bol 0) | 88 | ((parent-is "enum_body_declarations") parent-bol 0) |
| 85 | ((parent-is "enum_body") parent-bol java-ts-mode-indent-offset) | 89 | ((parent-is "enum_body") point-min c-ts-common-statement-offset) |
| 86 | ((parent-is "switch_block") parent-bol java-ts-mode-indent-offset) | 90 | ((parent-is "switch_block") point-min c-ts-common-statement-offset) |
| 87 | ((parent-is "record_declaration_body") parent-bol java-ts-mode-indent-offset) | 91 | ((parent-is "record_declaration_body") point-min c-ts-common-statement-offset) |
| 88 | ((query "(method_declaration (block _ @indent))") parent-bol java-ts-mode-indent-offset) | 92 | ((query "(method_declaration (block _ @indent))") parent-bol java-ts-mode-indent-offset) |
| 89 | ((query "(method_declaration (block (_) @indent))") parent-bol java-ts-mode-indent-offset) | 93 | ((query "(method_declaration (block (_) @indent))") parent-bol java-ts-mode-indent-offset) |
| 90 | ((parent-is "local_variable_declaration") parent-bol java-ts-mode-indent-offset) | 94 | ((parent-is "local_variable_declaration") parent-bol java-ts-mode-indent-offset) |
| @@ -117,7 +121,7 @@ | |||
| 117 | ((parent-is "case_statement") parent-bol java-ts-mode-indent-offset) | 121 | ((parent-is "case_statement") parent-bol java-ts-mode-indent-offset) |
| 118 | ((parent-is "labeled_statement") parent-bol java-ts-mode-indent-offset) | 122 | ((parent-is "labeled_statement") parent-bol java-ts-mode-indent-offset) |
| 119 | ((parent-is "do_statement") parent-bol java-ts-mode-indent-offset) | 123 | ((parent-is "do_statement") parent-bol java-ts-mode-indent-offset) |
| 120 | ((parent-is "block") (and parent parent-bol) java-ts-mode-indent-offset))) | 124 | ((parent-is "block") point-min c-ts-common-statement-offset))) |
| 121 | "Tree-sitter indent rules.") | 125 | "Tree-sitter indent rules.") |
| 122 | 126 | ||
| 123 | (defvar java-ts-mode--keywords | 127 | (defvar java-ts-mode--keywords |
| @@ -304,6 +308,23 @@ Return nil if there is no name or if NODE is not a defun node." | |||
| 304 | "text_block"))) | 308 | "text_block"))) |
| 305 | 309 | ||
| 306 | ;; Indent. | 310 | ;; Indent. |
| 311 | (setq-local c-ts-common-indent-type-regexp-alist | ||
| 312 | `((block . ,(rx (or "class_body" | ||
| 313 | "array_initializer" | ||
| 314 | "constructor_body" | ||
| 315 | "annotation_type_body" | ||
| 316 | "interface_body" | ||
| 317 | "enum_body" | ||
| 318 | "switch_block" | ||
| 319 | "record_declaration_body" | ||
| 320 | "block"))) | ||
| 321 | (close-bracket . "}") | ||
| 322 | (if . "if_statement") | ||
| 323 | (else . ("if_statement" . "alternative")) | ||
| 324 | (for . "for_statement") | ||
| 325 | (while . "while_statement") | ||
| 326 | (do . "do_statement"))) | ||
| 327 | (setq-local c-ts-common-indent-offset 'java-ts-mode-indent-offset) | ||
| 307 | (setq-local treesit-simple-indent-rules java-ts-mode--indent-rules) | 328 | (setq-local treesit-simple-indent-rules java-ts-mode--indent-rules) |
| 308 | 329 | ||
| 309 | ;; Electric | 330 | ;; Electric |