diff --git a/CHANGELOG.md b/CHANGELOG.md index a302f8f4e..214119c2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### New features +* [#1828](https://github.com/bbatsov/projectile/pull/1828): Add Nimble-based Nim project discovery. * Add elm project type. * [#1821](https://github.com/bbatsov/projectile/pull/1821): Add `pyproject.toml` discovery for python projects. diff --git a/projectile.el b/projectile.el index 58cd2a6c0..9d67f14f9 100644 --- a/projectile.el +++ b/projectile.el @@ -3004,6 +3004,13 @@ it acts on the current project." :type 'function :package-version '(projectile . "1.0.0")) +(defun projectile-nimble-project-p (&optional dir) + "Check if a project contains a Nimble project marker. +Nim projects that use Nimble contain a .nimble file. +When DIR is specified it checks DIR's project, otherwise +it acts on the current project." + (projectile-verify-file-wildcard "?*.nimble" dir)) + ;;;; Constant signifying opting out of CMake preset commands. (defconst projectile--cmake-no-preset "*no preset*") @@ -3183,6 +3190,14 @@ a manual COMMAND-TYPE command is created with :compile "dotnet build" :run "dotnet run" :test "dotnet test") +(projectile-register-project-type 'nim-nimble #'projectile-nimble-project-p + :project-file "?*.nimble" + :compile "nimble --noColor build --colors:off" + :install "nimble --noColor install --colors:off" + :test "nimble --noColor test -d:nimUnittestColor:off --colors:off" + :run "nimble --noColor run --colors:off" + :src-dir "src" + :test-dir "tests") ;; File-based detection project types ;; Universal