Skip to content

[Fix #1909] Pass the project root to predicate marker-files functions#2023

Merged
bbatsov merged 1 commit into
masterfrom
feature/1909-function-marker-root
Jun 20, 2026
Merged

[Fix #1909] Pass the project root to predicate marker-files functions#2023
bbatsov merged 1 commit into
masterfrom
feature/1909-function-marker-root

Conversation

@bbatsov

@bbatsov bbatsov commented Jun 20, 2026

Copy link
Copy Markdown
Owner

When a project type's marker-files is a predicate function, projectile-detect-project-type called it with dir, which is nil when detecting the current project's type. So a predicate marker could never match the current project (it always got nil). Now the root is resolved up front and passed to the predicate (and reused for the type-cache key). The predicate contract is also documented in projectile-register-project-type.

Fixes #1909.

When `marker-files' is a predicate, `projectile-detect-project-type'
called it with DIR, which is nil when detecting the current project's
type - so the predicate could never match the current project. Resolve
the root up front and pass it to the predicate (and reuse it for the
type cache key). Also document the predicate contract in
`projectile-register-project-type'.
@bbatsov bbatsov merged commit 9d636dd into master Jun 20, 2026
10 checks passed
@bbatsov bbatsov deleted the feature/1909-function-marker-root branch June 20, 2026 08:00
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.

Custom .projectile in sub-dir does not work

1 participant