Skip to content

Load the known projects before listing them - #2171

Merged
bbatsov merged 1 commit into
masterfrom
fix/known-projects-cold-start
Aug 24, 2026
Merged

Load the known projects before listing them#2171
bbatsov merged 1 commit into
masterfrom
fix/known-projects-cold-start

Conversation

@bbatsov

@bbatsov bbatsov commented Aug 24, 2026

Copy link
Copy Markdown
Owner

projectile-known-projects is both a variable and the accessor that lazily loads it from disk, and nothing loads it at startup. Five commands read the variable, so whichever one a session reached for first got nil.

On a cold Emacs with 124 saved projects, projectile-all-project-files returned 0 files before the accessor had been called and 118604 after. So s-p F completed over an empty list - as did projectile-vc, projectile-remove-known-project and the "Switch to project" prompt projectile-require-project-root can raise.

Running projectile-switch-project first hides it, which is presumably how it survived this long.

`projectile-known-projects' is both a variable and the accessor that
lazily loads it from disk, and nothing loads it at startup.  Five
commands read the variable, so whichever of them a session reached for
first was handed nil: `projectile-find-file-in-known-projects' completed
over an empty list, and so did `projectile-vc',
`projectile-remove-known-project' and the "Switch to project" prompt
`projectile-require-project-root' can raise.

Measured on a cold Emacs with 124 saved projects:
`projectile-all-project-files' returned 0 files before the accessor had
been called and 118604 after.

Anything that ran `projectile-switch-project' first hid it, which is
presumably how it survived this long.
@bbatsov
bbatsov merged commit df51a18 into master Aug 24, 2026
10 checks passed
@bbatsov
bbatsov deleted the fix/known-projects-cold-start branch August 24, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant