2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/scala/config.el -*- lexical-binding: t; -*-
|
2016-05-11 18:41:29 -04:00
|
|
|
|
2019-10-19 15:25:29 -04:00
|
|
|
(after! projectile
|
|
|
|
(add-to-list 'projectile-project-root-files "build.sbt"))
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Packages
|
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
(after! scala-mode
|
2019-06-27 23:56:17 +02:00
|
|
|
(setq scala-indent:align-parameters t
|
|
|
|
;; indent block comments to first asterix, not second
|
|
|
|
scala-indent:use-javadoc-style t)
|
|
|
|
|
2019-09-13 21:59:03 -04:00
|
|
|
(setq-hook! 'scala-mode-hook
|
2020-02-25 20:47:37 -05:00
|
|
|
comment-line-break-function #'+scala-comment-indent-new-line-fn)
|
2019-06-27 23:56:17 +02:00
|
|
|
|
2019-06-28 13:03:44 +02:00
|
|
|
(when (featurep! +lsp)
|
2020-10-27 09:09:11 -04:00
|
|
|
(setq-hook! 'scala-mode-hook lsp-enable-indentation nil)
|
2022-03-24 02:19:52 +01:00
|
|
|
(add-hook 'scala-mode-local-vars-hook #'lsp! 'append))
|
2020-06-07 14:21:45 -04:00
|
|
|
|
2020-08-12 18:52:14 -04:00
|
|
|
(set-ligatures! 'scala-mode
|
2020-06-07 14:21:45 -04:00
|
|
|
;; 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"))
|
2016-05-11 18:41:29 -04:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! sbt-mode
|
2018-05-25 00:46:11 +02:00
|
|
|
:after scala-mode
|
2020-02-25 20:49:26 -05:00
|
|
|
:config (set-repl-handler! 'scala-mode #'+scala/open-repl :persist t))
|
2021-10-19 01:54:17 +01:00
|
|
|
|
|
|
|
;; Tree sitter
|
|
|
|
(eval-when! (featurep! +tree-sitter)
|
2022-04-03 18:00:54 +01:00
|
|
|
(add-hook! 'scala-mode-local-vars-hook #'tree-sitter!))
|