Projectile-project-type could return the wrong project type when called with argument#1806
Projectile-project-type could return the wrong project type when called with argument#1806bbatsov merged 10 commits intobbatsov:masterfrom
Conversation
bad6306 to
b542288
Compare
1baf138 to
2e79bfd
Compare
|
Your suggestions seem reasonable, but I'm not quite sure what exactly is the problem that you've encountered (and I don't see any new tests that's illustrate it). I got that somewhere the project detection is failing, because it's not acting on the right folder, but you didn't say where exactly. |
7c5e1d6 to
73e2042
Compare
73e2042 to
e8c5d50
Compare
Here is a branch with just the commit for the tests for the issues. Briefly, what I did was calling |

Expected behavior
(projectile-project-type DIR) should return the right project type.
Actual behavior
(projectile-project-type DIR) sometimes return the wrong project type
Why
The problem is, some logic branches inside
projectile-project-typeinvolve calling(projectile-detect-project-type)which use thedefault-directoryinstead of the DIR we supply.Potential Fix
Amend
projectile-detect-project-typeto take optional argument DIR(just likeprojectile-project-type).Pass along the input from the projectile-project-type to
projectile-detect-project-typeSteps to reproduce the problem
Let DIR1 and DIR2 be 2 directories from projects of different types
Call (projectile-project-type DIR2) from a DIR1, you will get DIR1's project type instead of DIR2's(given that DIR2's project type is not cached)
Environment & Version information
Projectile version information
Emacs version
GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.6 (Build 19G2021))
Operating system
macOS