Last active
August 7, 2019 10:05
-
-
Save wedens/1211482f2bfa97d8e6c501f7c630a796 to your computer and use it in GitHub Desktop.
full sql-mode in doobie interpolators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package polymode | |
:commands poly-scala-mode | |
:mode ("\\.scala\\'" . poly-scala-mode) | |
:config | |
(define-hostmode poly-scala-hostmode | |
:protect-syntax nil | |
:protect-font-lock t | |
:mode 'scala-mode) | |
(define-innermode poly-scala-sql-multiline-innermode | |
:mode 'sql-mode | |
:body-indent-offset 'scala-indent:step | |
:head-matcher "\\(sql\\|fr\\)\"\"\"[ \t]*\n?" | |
:tail-matcher "[ \t]*\"\"\"") | |
(define-innermode poly-scala-sql-innermode | |
:mode 'sql-mode | |
:head-matcher "\\(sql\\|fr\\)\"" | |
:tail-matcher (cons "\\(^\\|[^\\\\]\\)\\(\"\\)" 2)) | |
(define-polymode poly-scala-mode | |
:hostmode 'poly-scala-hostmode | |
:innermodes '(poly-scala-sql-multiline-innermode | |
poly-scala-sql-innermode)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment