2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/java/config.el -*- lexical-binding: t; -*-
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2019-01-21 03:44:21 -05:00
|
|
|
(defvar +java-project-package-roots (list "java/" "test/" "main/" "src/" 1)
|
|
|
|
"A list of relative directories (strings) or depths (integer) used by
|
|
|
|
`+java-current-package' to delimit the namespace from the current buffer's full
|
|
|
|
file path. Each root is tried in sequence until one is found.
|
|
|
|
|
|
|
|
If a directory is encountered in the file path, everything before it (including
|
|
|
|
it) will be ignored when converting the path into a namespace.
|
|
|
|
|
|
|
|
An integer depth is how many directories to pop off the start of the relative
|
|
|
|
file path (relative to the project root). e.g.
|
|
|
|
|
|
|
|
Say the absolute path is ~/some/project/src/java/net/lissner/game/MyClass.java
|
|
|
|
The project root is ~/some/project
|
|
|
|
If the depth is 1, the first directory in src/java/net/lissner/game/MyClass.java
|
|
|
|
is removed: java.net.lissner.game.
|
|
|
|
If the depth is 2, the first two directories are removed: net.lissner.game.")
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; java-mode
|
|
|
|
|
2017-12-22 15:17:03 -05:00
|
|
|
(add-hook 'java-mode-hook #'rainbow-delimiters-mode)
|
|
|
|
|
2019-02-27 21:49:11 -05:00
|
|
|
(cond ((featurep! +lsp) (load! "+lsp"))
|
|
|
|
((featurep! +meghanada) (load! "+meghanada")))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
|
2017-10-03 00:50:33 +02:00
|
|
|
;;
|
2018-09-07 19:36:16 -04:00
|
|
|
;; Common packages
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! android-mode
|
2015-06-15 09:06:10 +02:00
|
|
|
:commands android-mode
|
|
|
|
:init
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook! (java-mode groovy-mode nxml-mode) #'+java|android-mode-maybe)
|
2016-04-23 22:08:46 -04:00
|
|
|
:config
|
2018-06-16 00:38:57 +02:00
|
|
|
(set-yas-minor-mode! 'android-mode))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! groovy-mode
|
2018-05-07 18:18:07 +02:00
|
|
|
:mode "\\.g\\(?:radle\\|roovy\\)$"
|
2016-05-20 19:08:02 -04:00
|
|
|
:config
|
2018-06-15 16:07:24 +02:00
|
|
|
(set-eval-handler! 'groovy-mode "groovy"))
|
2015-08-11 15:05:11 +02:00
|
|
|
|