diff options
| author | Bozhidar Batsov <bozhidar@batsov.dev> | 2025-01-31 21:56:18 +0200 |
|---|---|---|
| committer | Bozhidar Batsov <bozhidar@batsov.dev> | 2025-01-31 21:56:18 +0200 |
| commit | 7d5e81689566a507b5602c812426933a6481185c (patch) | |
| tree | 5ecf7a0f846a6e80ba4d6b32677b639026104c0c /test | |
| parent | 74a4ca36ea28dec920caa7c713aa8632d8d690cc (diff) | |
Speed-up load time by moving known projects initialization
It's now done outside of `projectile-mode`'s init, which should make Projectile
load faster.
* As a side effect the known projects will be initialized properly even if you're not using `projectile-mode`.
* The projects are read from disk the first time you invoke
`projectile-switch-project` or a similar command.
* We no longer do auto-cleanup of known projects when projectile-mode
starts. I'll think about how to handle this in an efficient manner.
Diffstat (limited to 'test')
| -rw-r--r-- | test/projectile-test.el | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/test/projectile-test.el b/test/projectile-test.el index 7b40e15..8c62a63 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -529,17 +529,7 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'. (projectile-mode 1) (expect (memq 'projectile-find-file-hook-function find-file-hook) :to-be-truthy) (projectile-mode -1) - (expect (memq 'projectile-find-file-hook-function find-file-hook) :not :to-be-truthy)) - (it "respects projectile-auto-discover setting" - (unwind-protect - (progn - (let ((projectile-auto-discover nil)) - (projectile-mode 1) - (expect 'projectile-discover-projects-in-search-path :not :to-have-been-called)) - (let ((projectile-auto-discover t)) - (projectile-mode 1) - (expect 'projectile-discover-projects-in-search-path :to-have-been-called))) - (projectile-mode -1)))) + (expect (memq 'projectile-find-file-hook-function find-file-hook) :not :to-be-truthy))) (describe "projectile-relevant-known-projects" (it "returns a list of known projects" @@ -1039,8 +1029,8 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'. (describe "projectile-switch-project" (it "fails if there are no projects" - (let ((projectile-known-projects nil)) - (expect (projectile-switch-project) :to-throw)))) + (spy-on 'projectile-relevant-known-projects :and-return-value nil) + (expect (projectile-switch-project) :to-throw))) (describe "projectile-delete-dir-local-variable" (it "Deletes existing dir-local variables" |
