Moved add-hook calls (for tree-sitter initialization) into their respective modes' config blocks, or nearby, to be consistent with how other, similar tools (like lsp!) are initialized, and does so at runtime, rather than at expansion/compile time, which eval-when! caused.
55 lines
1.3 KiB
EmacsLisp
55 lines
1.3 KiB
EmacsLisp
;;; lang/scala/config.el -*- lexical-binding: t; -*-
|
|
|
|
(after! projectile
|
|
(add-to-list 'projectile-project-root-files "build.sbt"))
|
|
|
|
|
|
;;
|
|
;;; Packages
|
|
|
|
(after! scala-mode
|
|
(setq scala-indent:align-parameters t
|
|
;; indent block comments to first asterix, not second
|
|
scala-indent:use-javadoc-style t)
|
|
|
|
(setq-hook! 'scala-mode-hook
|
|
comment-line-break-function #'+scala-comment-indent-new-line-fn)
|
|
|
|
(when (featurep! +lsp)
|
|
(setq-hook! 'scala-mode-hook lsp-enable-indentation nil)
|
|
(add-hook 'scala-mode-local-vars-hook #'lsp! 'append))
|
|
|
|
(when (featurep! +tree-sitter)
|
|
(add-hook 'scala-mode-local-vars-hook #'tree-sitter! 'append))
|
|
|
|
(set-ligatures! 'scala-mode
|
|
;; Functional
|
|
:def "def"
|
|
:composition "compose"
|
|
;; HKT
|
|
:lambda "Lambda"
|
|
;; Types
|
|
:null "none"
|
|
:null "None"
|
|
:true "true"
|
|
:false "false"
|
|
:int "Int"
|
|
:str "String"
|
|
:float "Float"
|
|
:bool "Boolean"
|
|
:list "List"
|
|
;; Flow
|
|
:for "for"
|
|
:not "!"
|
|
:and "&&"
|
|
:or "||"
|
|
:yield "yield"
|
|
;; Other
|
|
:union "union"
|
|
:intersect "intersect"
|
|
:diff "diff"))
|
|
|
|
|
|
(use-package! sbt-mode
|
|
:after scala-mode
|
|
:config (set-repl-handler! 'scala-mode #'+scala/open-repl :persist t))
|