Skip to content

Commit

Permalink
Detect Nimble projects for Nim programming language (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist authored Mar 6, 2023
1 parent d43fae4 commit 7647574
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
15 changes: 15 additions & 0 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -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*")

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7647574

Please sign in to comment.