1

Given a project directory my-project which projectile correctly identifies because it is a git project.

Inside my-project there is a my-module directory. It is a git submodule and therefor projectile identifies it as a project of it's own.

But I want all files inside of my-project/my-module to be considered as part of my-project.

What is the idiomatic way to configure this?

I would like a solution in dir-locals.el so it does not affect other projects.

2
  • Please don't post the same question in StackOverflow and emacs.SE. Choose one to keep and please delete the other. Thx. Commented Oct 18, 2021 at 15:02
  • You can try counsel-fd if your goal is to just browse subdirectories and files within my-project. Commented Oct 21, 2021 at 2:23

2 Answers 2

1

The solution was putting this into my-project/my-module/.dir-locals.el:

((nil . ((projectile-project-root . "/p/my-project/")))) 
0

See the issues: https://github.com/bbatsov/projectile/issues/712 / https://github.com/bbatsov/projectile/issues/1449.

One of the options suggested there is to (edit: I've changed projectile-project-root-files-functions -> projectile-project-root-functions which it was aliased to):

(setq projectile-project-root-functions '(projectile-root-local projectile-root-top-down projectile-root-top-down-recurring projectile-root-bottom-up)) 

Edit: I see you want this to not to affect other projects so you'd want to put this in .dir-locals.el in the project root.

4
  • This had no effect at all. Opening a file from the sub project and running projectile-project-info identifies the sub project as the project. Commented Oct 20, 2021 at 19:55
  • Have you tried updating projectile, and removing .projectile or .dir-locals vars which could be setting the project root? If you'd be open to sharing the project link, I could clone and see if I can reproduce what you're seeing. Commented Oct 21, 2021 at 10:13
  • I think moving the .dir-locals.el file you mention you have from the submodule root to the project root should also work. Commented Oct 21, 2021 at 10:49
  • I have reinstalled doom emacs configuration and it works now. Commented Oct 21, 2021 at 19:09

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.