Skip to content

Projectile detecting sub-projects, update-project-type doesn't seem to work #2008

Description

@eviefp

This is all happening in a cloned git repo, it's detecting "emacs" as a project in "./foo/emacs/*" because there's a default.nix there, and it seems to be discovering the project as a nix project.

The most obvious problem is when trying to use projectile-find-file, it only looks in path/to/project/foo/emacs rather than path/to/project. If I add a .projectile file in path/to/project, that fixes it, but I'd rather not do that.

So I tried adding a projectile-update-project-type (this is the whole use-package section for completeness):

(use-package projectile
  :ensure t
  :init
    (setq-default projectile-mode-line-prefix " Proj")
    (setq-default projectile-generic-command "rg --files --hidden -0")
    (setq projectile-project-search-path
          '("~/code/"
            "~/code/oss/"))
  :config
    (evil-define-key 'normal projectile-mode-map (kbd "SPC p") 'projectile-command-map)
    ; this uses "default.nix" files as the marker, which is wrong in larger/non-trivial nix projects,
    ; including my own nixfiles, so yeah. no thanks
    (projectile-update-project-type 'nix :project-file nil :marker-files nil :precedence 'low)

  :hook
    (after-init-hook . projectile-mode))

However, it's still not working despite me doing a clear project cache. The project-types variable also seems to show that the nix project is empty.

Alternatively, is there a setting I'm missing that makes "git repo root" as the highest precedence/override for project root? I'd rather do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions