bbatsov / projectile

Project Interaction Library for Emacs
https://docs.projectile.mx
GNU General Public License v3.0
3.98k stars 584 forks source link

Projectile can't recognise custom project type #1872

Open Orest58008 opened 8 months ago

Orest58008 commented 8 months ago

Expected behavior

Projectile switching to projectile:dub in directories containing dub.sdl or dub.json

Actual behavior

Projectile doesn't switch to projectile:dub and instead is projectile:dotnet-sln (as in all projects with src/ and not under any project type)

Steps to reproduce the problem

  1. Configure the type:

    (projectile-register-project-type 'dub '("dub.json" "dub.sdl")
                                    :project-file '("dub.json" "dub.sdl")
                                    :src-dir '("src/" "source/")
                                    :compile "dub build"
                                    :run "dub run"
                                    :test "dub test")
  2. Go into a directory containing dub.sdl or dub.json

  3. Don't get dub project type

Environment & Version information

Projectile version information

Projectile 2.8.0

Emacs version

29.1

Operating system

Arch Linux

Orest58008 commented 8 months ago

Entire init.el if something outside the project registration affects it: https://pastebin.com/zxCZqPjF

LaurenceWarne commented 8 months ago

Does:

(projectile-update-project-type 'dub :precedence 'high)

Make projectile pick up the expected project type?

Orest58008 commented 8 months ago

Unfortunately, it does not

pesterhazy commented 3 months ago

In case someone may be helped by this in the future, this is what allowed to me hard-code a project type

In .dir-locals.el

((nil . ((projectile-project-type . go))))
pesterhazy commented 3 months ago

where go could be any of the values in this list https://github.com/bbatsov/projectile/blob/0163b335a18af0f077a474d4dc6b36e22b5e3274/projectile.el#L3252