Java SE 15 adds (finally) support for multiline string literals that start with """\n and end with """.
Has anyone updated java-mode (CC Mode) to recognize this construct?
Java SE 15 adds (finally) support for multiline string literals that start with """\n and end with """.
Has anyone updated java-mode (CC Mode) to recognize this construct?
I've updated my java mode hook to use mmm-mode here:
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(mmm-add-classes
'((java-text-block
:submode fundamental-mode
:front ".+\"\"\"$"
:back ".*\"\"\".*"
:face mmm-code-submode-face
)))
(mmm-add-mode-ext-class 'java-mode "\\.java$" 'java-text-block)
works well enough, although I'd like a better way to make mmm-mode smarter to the content of the block. e.g. entering json-mode for json text, xml-mode for xml, etc...
I've done this previously in ruby with ruby's unique heredoc string syntax, but I can't figure out a clean way to make it work in Java.