Reduce list of root files projectile searches for

And define them on a per-module basis. This reduces the number of file
checks it performs, particularly for non-project files.

Might help #1317
This commit is contained in:
Henrik Lissner 2019-10-19 15:25:29 -04:00
parent e1edbcb3d9
commit 9b25582be1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
12 changed files with 82 additions and 1 deletions

View file

@ -1,5 +1,12 @@
;;; lang/clojure/config.el -*- lexical-binding: t; -*-
(after! projectile
(pushnew! projectile-project-root-files "project.clj" "build.boot" "deps.edn"))
;;
;;; Packages
;;;###package clojure-mode
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)

View file

@ -1,5 +1,12 @@
;;; lang/elixir/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "mix.exs"))
;;
;;; Packages
(use-package! elixir-mode
:defer t
:init

View file

@ -1,5 +1,12 @@
;;; lang/ess/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "DESCRIPTION"))
;;
;;; Packages
(use-package! ess
:commands stata SAS
:init

View file

@ -1,5 +1,8 @@
;;; lang/haskell/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "stack.yaml"))
(cond ((featurep! +intero) (load! "+intero"))
((featurep! +dante) (load! "+dante"))
((featurep! +lsp) (load! "+lsp")))

View file

@ -17,6 +17,9 @@ 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.")
(after! projectile
(pushnew! projectile-project-root-files "gradlew" "build.gradle"))
;;
;; java-mode

View file

@ -1,5 +1,12 @@
;;; lang/php/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "composer.json"))
;;
;;; Packages
(use-package! php-mode
:mode "\\.inc\\'"
:config

View file

@ -8,6 +8,9 @@ called.")
"CLI arguments to initialize 'jupiter console %s' with when
`+python/open-ipython-repl' is called.")
(after! projectile
(pushnew! projectile-project-root-files "setup.py" "requirements.txt"))
;;
;; Packages

View file

@ -1,5 +1,12 @@
;;; lang/racket/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "info.rkt"))
;;
;;; Packages
(use-package! racket-mode
:hook (racket-repl-mode . racket-unicode-input-method-enable)
:config

View file

@ -1,5 +1,9 @@
;;; lang/ruby/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "Gemfile"))
;;
;;; Packages

View file

@ -1,5 +1,12 @@
;;; lang/rust/config.el -*- lexical-binding: t; -*-
(after! projectile
(add-to-list 'projectile-project-root-files "Cargo.toml"))
;;
;;; Packages
(use-package! rust-mode
:defer t
:config

View file

@ -1,5 +1,12 @@
;;; 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