[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/projectile 76475745fb 2/2: Detect Nimble projects for Nim
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/projectile 76475745fb 2/2: Detect Nimble projects for Nim programming language (#1828) |
Date: |
Mon, 6 Mar 2023 02:00:41 -0500 (EST) |
branch: elpa/projectile
commit 76475745fb408fa716b2b43c436ba07a56836f89
Author: Eric Berquist <eric.berquist@gmail.com>
Commit: GitHub <noreply@github.com>
Detect Nimble projects for Nim programming language (#1828)
---
CHANGELOG.md | 1 +
projectile.el | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a302f8f4ec..214119c2d5 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 58cd2a6c0e..9d67f14f9b 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 <projectname>.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