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.")
|
|
|
|
|
2019-10-19 15:25:29 -04:00
|
|
|
(after! projectile
|
|
|
|
(pushnew! projectile-project-root-files "gradlew" "build.gradle"))
|
|
|
|
|
2019-01-21 03:44:21 -05:00
|
|
|
|
|
|
|
;;
|
2020-04-23 23:49:35 -04:00
|
|
|
;;; java-mode
|
2019-01-21 03:44:21 -05:00
|
|
|
|
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
|
|
|
;;
|
2020-04-23 23:49:35 -04:00
|
|
|
;;; Common packages
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! android-mode
|
2015-06-15 09:06:10 +02:00
|
|
|
:commands android-mode
|
|
|
|
:init
|
2019-07-26 19:57:13 +02:00
|
|
|
(add-hook! '(java-mode-hook groovy-mode-hook nxml-mode-hook)
|
|
|
|
#'+java-android-mode-maybe-h)
|
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
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-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"))
|